Repository navigation
fix: make agent run timeout configurable - #101
Twil3akine wants to merge 7 commits into
Conversation
jerelvelarde
left a comment
There was a problem hiding this comment.
Useful configuration improvement with good scope, but hold merge for the two integration issues below. All 32 focused timeout/runner/store/headless/channel tests pass. Defaults, invalid values and timer bounds were checked; the findings were reproduced with two workers sharing SQLite and with rendered Docker Compose configuration.
| ), | ||
| ), | ||
| 90_000, | ||
| this.runTimeoutMs, |
There was a problem hiding this comment.
[P2] Keep the task lease valid for the configured run duration. With AGENT_RUN_TIMEOUT_MS=240000, another worker polling the same database interrupts the active run at 180 seconds, before the configured timeout. A two-Runner/two-Store fixture reproduces “Worker lease expired” at 180001ms and no result. The task is held interrupted, not automatically run twice. Update lease duration or renewal together with the timeout and cover this interaction.
| apiKey: process.env.OPENAI_API_KEY, | ||
| model: process.env.OPENAI_MODEL, | ||
| baseUrl: process.env.OPENAI_BASE_URL ?? 'https://api.openai.com/v1', | ||
| agentRunTimeoutMs: agentRunTimeoutMsFromEnv(process.env), |
There was a problem hiding this comment.
[P2] Forward AGENT_RUN_TIMEOUT_MS through the app service in compose.yml. Setting the documented option in .env currently leaves Docker deployments at the 90-second default because the variable never reaches the container. docker compose config confirms the app environment omits the variable even when set to 240000.
|
Thanks for the review. I'll address both issues: keeping the worker lease valid for the configured run timeout and forwarding |
|
I've pushed fixes for both review findings and updated the PR description with the validation results and remaining limitations. Sorry for the extra review work, and thank you for catching these issues. Could you take another look when you have time? |
Summary
Make the 90-second agent run limit configurable with
AGENT_RUN_TIMEOUT_MSfor interactive and scheduled/background runs. Preserve 90 seconds as the default.Changes
DotAgentand the backgroundRunner.compose.ymland document it in.env.example.max(180000, timeout × 2)milliseconds. This prevents a second worker sharing the database from interrupting a valid long-running task at the old 180-second deadline.The default remains a 90-second timeout and 180-second lease. At a 240-second timeout, the lease becomes 480 seconds; recovering a crashed worker can therefore take longer. Explicit cancellation and permission revocation remain effective.
Validation
625452epasses all 309 tests and the same static/build checks without merge conflicts.docker compose configrendering was not verified; YAML syntax and unset/empty/custom-value interpolation were checked.Prepared with AI assistance using gwitg, a GPT-6.1 Sol project lead and GPT-6 Luna workers.