Repository navigation
fix(runtime): bound background-held turns and stop failing busy reused processes as starting - #43
Merged
Merged
Conversation
…d processes as starting A retained turn that had answered and was held open by background work that never reported its completion stayed open until the inactivity limit (unbounded in practice). Add ProviderProcessRetention::held_task_quiet_timeout: the turn completes with a warning and the process is parked with its work. A reused retained process was held to initialization_timeout on every turn, so a process busy with earlier work was failed as 'turn timed out' after the startup deadline. Track that a process has answered once, and report a real failed start as RuntimeError::StartupTimeout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
[High impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issue was found. SummaryBounds how long retained turns wait for silent background work and keeps reused processes off the startup deadline.
|
… late quiet-limit delivery A startup timeout does not prove the prompt was undelivered (OpenCode sends it before the acknowledgement arrives), so the variant's docs no longer claim a retry is safe. The quiet-limit test now releases the silent subagent after the turn stopped waiting and checks its answer is announced and delivered exactly once by a continuation, on the same process. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Problem
Two ways a retained Claude turn ends up "in progress" or fails misleadingly:
active_inactivity_timeout, which applications that wait on background work leave unset (falling back to the turn cap, often 24 h).initialization_timeoutwas applied on every turn of a retained process, because the semantic-activity flag starts false each turn. A process that was merely busy (finishing work an earlier turn left, or running a long tool for a queued message) was failed asturn timed out after 30 secondseven though it had long since started.Changes
ProviderProcessRetention::held_task_quiet_timeout: Option<Duration>(breaking: new field). When a turn has answered and only background work holds it, and nothing is reported for this long, the turn completes successfully with aTurnEvent::Warningnaming the work. The process is parked with that work exactly as after a hand-off, so a task that finishes later is still delivered as a background follow-up. Task progress resets the timer.Nonekeeps the previous behavior.RetainedHandoff::initialized); later turns are judged by the active limits, notinitialization_timeout.RuntimeError::StartupTimeout("did not respond within N seconds of starting") for a process that never answered. Maps toRuntimeFailureKind::TimeoutlikeTimeout, so callers can tell a failed start from a turn that ran too long.Tests
New in
tests/retained_providers.rs(silent-subagent fixture added):StartupTimeout;initialization_timeoutis not a startup failure.cargo test --test retained_providers --test retained_live_messages --test opencode_serve,cargo test --lib,cargo clippy --all-targets --all-features -D warningsandcargo fmt --checkpass locally.Docs:
docs/reference/retained-runtimes.mdandCHANGELOG.mdupdated.🤖 Generated with Claude Code