Skip to content

fix(engine): no per-turn wall-clock limit by default - #6703

Merged
Hmbown merged 2 commits into
mainfrom
fix/turn-wall-clock-unlimited
Sep 28, 2026
Merged

Hmbown merged 2 commits into
mainfrom
fix/turn-wall-clock-unlimited

Conversation

@Hmbown

@Hmbown Hmbown commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

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/0 for [tui].turn_wall_clock_secs (and CODEWHALE_TURN_WALL_CLOCK_SECS) now mean no limit: DEFAULT_TURN_WALL_CLOCK = Duration::MAX, which TurnWallClock::exhausted can never reach.
  • Explicit values still clamp to 30..=86400 and stop the turn with the limit named, exactly as before.
  • Per-step stream budgets (stream_max_duration_secs, stream_max_content_mb) stay finite; they bound one stuck request, not the turn.
  • Headless exec builds its absolute deadline with checked_add, using a century in place of "never", so Instant cannot overflow. Code mode's ungated fallback keeps its own one-hour backstop.
  • Docs, config.example.toml and CHANGELOG updated.

Evidence (cargo test -p codewhale-tui --lib <filter>): turn_wall_clock 4 passed; wall_clock 15 passed; engine_config_defaults 1 passed; exec_agent:: 10 passed; codemode 16 passed; 0 failed in each. cargo fmt --check is clean and the dead-code budget passes. The new turn_wall_clock_defaults_to_no_limit rewinds 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


Devin Review

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
Copilot AI lite review requested due to automatic review settings September 28, 2026 12:59
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment thread crates/tui/src/core/engine/turn_budget.rs
Comment thread CHANGELOG.md
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Changelog entries belong at merge time

Repository guidance reserves changelog updates for the release manager on main. This PR edits both changelogs, increasing the chance of conflicts with other PRs.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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
@Hmbown Hmbown mentioned this pull request Sep 28, 2026
@Hmbown
Hmbown merged commit 485c113 into main Sep 28, 2026
33 of 34 checks passed
@Hmbown
Hmbown deleted the fix/turn-wall-clock-unlimited branch September 28, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants