( ctx context.Context, id toolspkg.ToolID, scope toolspkg.Scope, taskID string, runID string, )
| 4484 | } |
| 4485 | |
| 4486 | func (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 | |
| 4519 | func nativeTaskBlockExpiresAt(expiresAt *time.Time) time.Time { |
| 4520 | if expiresAt == nil { |
no test coverage detected