fix(harness): raise idle watchdog default to 600s so long compaction survives - #4013
Conversation
…survives The per-turn idle watchdog fails a turn that emits no non-heartbeat events for the window. Context compaction's summarizing LLM call runs as a single long await that emits nothing until it returns, so on a near-full context it can exceed the 240s default and trip the watchdog. That wedges the session in a "Prompt is too long" -> compaction -> 240s-timeout loop, since every retry re-triggers the same slow compaction. Raise the default from 240s to 600s so a healthy long compaction has room to finish. The HARNESS_TURN_TIMEOUT_S env knob and the absolute ceiling are unchanged. Co-authored-by: Isaac
|
|
🏷️ Doc impact: Only changes an internal ops env-var default (HARNESS_TURN_TIMEOUT_S 240s→600s) for the turn idle watchdog, which is not a documented user-facing surface or default. Auto-classified on merge. Set the label manually before merging to override. · run |
Related issue
N/A
Summary
runtime/compaction.py→summarize_history) runs as a single longawaitthat emits nothing until it returns. On a near-full context that call can take longer than 240s, so the idle watchdog trips it.Prompt is too long→ auto-compaction →turn exceeded the 240s harness idle watchdog (run_turn emitted no events for 240s; likely a wedged LLM or tool call)→ retry re-triggers the same slow compaction → repeat.240sto600sinomnigent/runtime/harnesses/_scaffold.py, giving a healthy long compaction room to finish. TheHARNESS_TURN_TIMEOUT_Senv knob and the absolute per-turn ceiling (HARNESS_TURN_ABSOLUTE_TIMEOUT_S, 3600s) are unchanged.Test Plan
pytest tests/runtime/harnesses/test_scaffold.py -k "watchdog or idle or wedged or busy or absolute or heartbeat"— 6 passed. These drive the watchdog viaHARNESS_TURN_TIMEOUT_Soverrides, so they're independent of the default and confirm idle/absolute/heartbeat behavior still holds.240default; the only other240literals in the tree are unrelated (MCP startup settle, pi-native park timeout).Demo
N/A
Type of change
Test coverage
Coverage notes
Behavior is unchanged except for the default window length. Existing scaffold watchdog tests exercise idle-timeout, absolute-cap, and heartbeat-ignoring paths via explicit
HARNESS_TURN_TIMEOUT_Soverrides, so they cover the mechanism regardless of the default. I ran that subset locally (6 passed). No new test is added because the change is a single default constant with no new branch.Changelog
Long context compaction no longer fails with a 240s idle-watchdog timeout on near-full sessions
This pull request and its description were written by Isaac.