MCPcopy Create free account
hub / github.com/compozy/agh / nativeTaskLeaseActor

Method nativeTaskLeaseActor

internal/daemon/native_tools.go:4486–4517  ·  view source on GitHub ↗
(
	ctx context.Context,
	id toolspkg.ToolID,
	scope toolspkg.Scope,
	taskID string,
	runID string,
)

Source from the content-addressed store, hash-verified

4484}
4485
4486func (n *daemonNativeTools) nativeTaskLeaseActor(
4487 ctx context.Context,
4488 id toolspkg.ToolID,
4489 scope toolspkg.Scope,
4490 taskID string,
4491 runID string,
4492) (taskpkg.ActorContext, taskpkg.AutonomyLeaseHandle, error) {
4493 actor, sessionID, err := autonomyActorContext(id, scope)
4494 if err != nil {
4495 return taskpkg.ActorContext{}, taskpkg.AutonomyLeaseHandle{}, err
4496 }
4497 normalizedTaskID, err := requiredNativeString(id, "task_id", taskID)
4498 if err != nil {
4499 return taskpkg.ActorContext{}, taskpkg.AutonomyLeaseHandle{}, err
4500 }
4501 normalizedRunID, err := requiredNativeString(id, "run_id", runID)
4502 if err != nil {
4503 return taskpkg.ActorContext{}, taskpkg.AutonomyLeaseHandle{}, err
4504 }
4505 handle, err := n.lookupAutonomyLease(ctx, id, sessionID, normalizedRunID)
4506 if err != nil {
4507 return taskpkg.ActorContext{}, taskpkg.AutonomyLeaseHandle{}, err
4508 }
4509 if strings.TrimSpace(handle.TaskID) != normalizedTaskID {
4510 return taskpkg.ActorContext{}, taskpkg.AutonomyLeaseHandle{}, nativeAutonomyForeignRunTaskError(
4511 id,
4512 normalizedTaskID,
4513 normalizedRunID,
4514 )
4515 }
4516 return actor, handle, nil
4517}
4518
4519func nativeTaskBlockExpiresAt(expiresAt *time.Time) time.Time {
4520 if expiresAt == nil {

Callers 2

nativeTaskBlockActorMethod · 0.95
nativeTaskClearActorMethod · 0.95

Calls 4

lookupAutonomyLeaseMethod · 0.95
autonomyActorContextFunction · 0.85
requiredNativeStringFunction · 0.85

Tested by

no test coverage detected