Skip to content

maxRuntimeSec is accepted but not enforced #23

@nficano

Description

@nficano

ArcpClient.SubmitAsync sends max_runtime_sec through JobSubmitPayload, but JobManager.SubmitAsync and JobManager.RunAsync never read it. A caller can request a runtime limit and the docs describe TIMEOUT and timed_out, but long-running agents continue until completion, lease expiration, cancellation, or transport shutdown.

The relevant locations are src/Arcp.Client/ArcpClient.Jobs.cs:15, src/Arcp.Client/ArcpClient.Jobs.cs:30, src/Arcp.Core/Messages/JobSubmitPayload.cs:24, and src/Arcp.Runtime/JobManager.cs:162.

Fix prompt: Add runtime-limit enforcement for JobSubmitPayload.MaxRuntimeSec. Store the requested limit on Job or pass it into RunAsync, create a linked cancellation source or watchdog using TimeProvider, and when the limit elapses emit job.error with FinalStatus = "timed_out", Code = ErrorCode.Timeout, and Retryable = true, then mark the job JobStatus.TimedOut. Ensure ordinary cancellation still reports CANCELLED and lease expiration still reports LEASE_EXPIRED. Add an integration test with a small maxRuntimeSec and an agent that waits indefinitely, then assert the client receives FinalStatus == "timed_out" and Error.Code == ErrorCode.Timeout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity:highHigh severity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions