feat: add configurable activity-aware ACP request timeout#1429
Open
brittianwarner wants to merge 1 commit intomainfrom
Open
feat: add configurable activity-aware ACP request timeout#1429brittianwarner wants to merge 1 commit intomainfrom
brittianwarner wants to merge 1 commit intomainfrom
Conversation
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.
Summary
acpTimeoutMsoption on bothAgentOsOptions(VM-wide default) andCreateSessionOptions(per-session override)acpTimeoutMs <= 0with a clear error messageProblem
Agents actively streaming
session/updatenotifications during long prompts would hit the fixed 120s timeout and get killed despite being healthy and making progress. Server logs confirmed: Pi process alive (exitCode=null), actively streaming (session/updatex20), times out at exactly 120s.Solution
_resetPendingTimers()clears and recreates all pending request timers whenever any valid JSON-RPC message (response, notification, or inbound request) arrives in_startReading(). This makes the timeout measure silence, not total elapsed time:Changes
packages/core/src/acp-client.tsDEFAULT_TIMEOUT_MS: 120,000 → 900,000 (15 min)PendingRequestinterface: addedmethodfield for timeout error messages_pendingmap key narrowed fromnumber | string | nulltonumber(only auto-increment IDs)_resetPendingTimers():_closedguard, clears + recreates timers, JSDocmsg.idtimeoutMs > 0packages/core/src/agent-os.tsAgentOsOptions.acpTimeoutMs?: number— VM-wide defaultCreateSessionOptions.acpTimeoutMs?: number— per-session override_acpTimeoutMsprivate field, set increate(), threaded toAcpClientincreateSession()packages/core/tests/acp-protocol.test.tselapsed >= 750msproves the timer was actually resetpackages/core/README.mdAgentOsOptionsandCreateSessionOptionsfield listsVerified
_rejectAll()onclose()clears timers created by_resetPendingTimersFollow-ups
acpTimeoutMsin Rivet actor layer (actor parity requirement)