Repository navigation
Stall guard: ten minutes by default, set in [daemon]; background commands may run a day - #621
Merged
Merged
Conversation
…ands may run a day A Claude stream at high effort on long context can send nothing but pings for most of a nine-minute call, so the two-minute content bound failed nine of ten such runs. The bound is now ten minutes, about where Claude Code ends a stream of pings alone; a connection that sends no bytes at all still fails after two. [daemon] stall_timeout in config.toml sets it, so a daemon a client starts can change it. A background command holds no turn while it runs, so its timeout_ms may now go to a day, as long as a wait on it may last; a foreground one stays at 600 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGCrC1SkXk5B5C9xa4M
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGCrC1SkXk5B5C9xa4M
lydakis
pushed a commit
that referenced
this pull request
Nov 1, 2026
The shell description keeps #621's day-long background cap and adds the note's sentence after "collect its result later with wait.". Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSmyxToLa26Je2pfo
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.
Why
Claude at high effort on long context (170K to 230K tokens) can stream nothing but keepalive pings for most of a call. Calls ran up to 538 s. The 2-minute content-only stall bound failed 9 of 10 such runs as
provider_stream_stalled, and each retry hit the same silence. With--stall-timeout 10mthe same setup passed 22 of 22. A daemon that a client starts could not be given that flag, because[daemon]had no key for it.What each provider says (read 2026-11-01)
pingevents, with no stated interval or gap bound. Thinking arrives in a "chunky" pattern. The docs advise TCP keepalive for networks that drop idle connections. The SDKs time out after 10 minutes.stream_idle_timeout_msdefaults to 300000 (5 min) per provider, withstream_max_retriesdefaulting to 5. Whether pings reset the timer is not documented.sequence_numbercursor for resuming. The openai-python SDK times out after 10 minutes.Two points follow. First, none of these sources is as strict as 2 minutes on content. Second, the closest precedent (Claude Code, which handles both Anthropic and Bedrock) does what this PR does: no bytes at all fails fast, and pings keep a stream alive for a bounded time of about 10 minutes.
What changes
STALL_TIMEOUT(src/provider.rs): 2 minutes → 10 minutes. Keepalives still don't renew it.IDLE_READ. It still fails a connection that sends no bytes at all, pings included, so a dead connection is still found in 2 minutes.[daemon] stall_timeout = "15m"in config.toml now reaches--stall-timeout. It's a newDAEMON_DURATIONStable inclient/src/config.rs, checked when the file is read: whole seconds, from 1 s to 24 h.shell: a background command'stimeout_msmay now go up to a day, the same as thewaitcap. A background command holds no turn while it runs. Foreground commands stay capped at 600 s. Claude Code caps foreground commands at 10 minutes and background ones not at all, and Codex's exec sessions run until they exit. The daemon still bounds running processes with--max-processesand kills them at stop.[daemon]key, the shelltimeout_ms), CLI.md, and the--stall-timeouthelp.Left alone: Responses streams count every non-delta event as progress, as before. No OpenAI stall has been reported, and changing that could end long reasoning that only keepalives cover.
Daemon fast and light
Nothing new runs on the runtime thread, and nothing new is kept per bot. The stream loop is unchanged apart from a constant. Validating the shell arguments picks a bound by
background. There's no new store work.Tests
cargo test --lib(200 passed),cargo test --bin agent(105 passed), agent-client lib (89 passed),daemon_knows_no_client.[daemon] stall_timeoutreaches its flag, and malformed values are refused by name. A backgroundtimeout_msof 1 h is accepted, and one over a day is refused with the right message.