fix(engine): no per-turn wall-clock limit by default - #6703
Merged
Merged
Conversation
A long autonomous turn stopped at exactly one hour ("Per-turn wall-clock
budget exhausted after 3776s (limit: 3600s)") even while making progress.
Elapsed time is no better a measure of useful progress than the step
counter, which 194ff73 already made uncapped by default.
The wall clock now follows the same shape: `None`/`0` resolve to
`DEFAULT_TURN_WALL_CLOCK = Duration::MAX`, which `TurnWallClock::exhausted`
never reaches; explicit `[tui].turn_wall_clock_secs` values still clamp to
30..=86400 and stop the turn with the limit named. Per-step stream budgets
stay finite. Headless exec turns the budget into an absolute deadline with
`checked_add` (a century stands in for "never"); code mode's ungated
fallback keeps its own one-hour backstop.
Evidence (cargo test -p codewhale-tui --lib <filter>):
turn_wall_clock test result: ok. 4 passed; 0 failed
wall_clock test result: ok. 15 passed; 0 failed
engine_config_defaults test result: ok. 1 passed; 0 failed
exec_agent:: test result: ok. 10 passed; 0 failed
codemode test result: ok. 16 passed; 0 failed
cargo fmt --check clean; dead-code budget PASS (260, at budget).
turn_wall_clock_defaults_to_no_limit rewinds a default clock ten days and
asserts it is not exhausted; the previous 3600s default fails it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ZwqatxgVFxHvovngywnks
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Comment on lines
+41
to
+43
| - A turn no longer stops after an hour of work. The cumulative per-turn wall | ||
| clock is unlimited by default, like model steps; set | ||
| `[tui].turn_wall_clock_secs` to cap it. |
Contributor
There was a problem hiding this comment.
Review on #6703 suggested code mode's watchdog would panic sleeping toward a near-Duration::MAX deadline. tokio 1.53's sleep falls back to far_future when Instant::checked_add overflows; this pins that. test result: ok. 9 passed; 0 failed (turn_budget::). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ZwqatxgVFxHvovngywnks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No-Issue: operator-reported one-hour turn stop during 0.10.1 release checks
A long autonomous turn stopped at exactly one hour (
Per-turn wall-clock budget exhausted after 3776s (limit: 3600s)) while it was still making progress. Elapsed time is no better a measure of useful progress than the step counter, which 194ff73 already made uncapped by default.Change
None/0for[tui].turn_wall_clock_secs(andCODEWHALE_TURN_WALL_CLOCK_SECS) now mean no limit:DEFAULT_TURN_WALL_CLOCK = Duration::MAX, whichTurnWallClock::exhaustedcan never reach.30..=86400and stop the turn with the limit named, exactly as before.stream_max_duration_secs,stream_max_content_mb) stay finite; they bound one stuck request, not the turn.checked_add, using a century in place of "never", soInstantcannot overflow. Code mode's ungated fallback keeps its own one-hour backstop.config.example.tomland CHANGELOG updated.Evidence (
cargo test -p codewhale-tui --lib <filter>):turn_wall_clock4 passed;wall_clock15 passed;engine_config_defaults1 passed;exec_agent::10 passed;codemode16 passed; 0 failed in each.cargo fmt --checkis clean and the dead-code budget passes. The newturn_wall_clock_defaults_to_no_limitrewinds a default clock ten days and asserts it is not exhausted, which fails under the old 3600s default.🤖 Generated with Claude Code
https://claude.ai/code/session_014ZwqatxgVFxHvovngywnks