fix: size FinalizeSession deadline to activation hook timeouts - #1220
Draft
gominimal-aw-bot[bot] wants to merge 1 commit into
Draft
fix: size FinalizeSession deadline to activation hook timeouts#1220gominimal-aw-bot[bot] wants to merge 1 commit into
gominimal-aw-bot[bot] wants to merge 1 commit into
Conversation
The client bounds every oneshot RPC at a fixed 60s. FinalizeSession runs a session's on_activate hooks inside that single call, and those hooks run sequentially and unbudgeted on the daemon, each allowed up to the 300s hook-timeout cap. So any activation whose hooks sum past ~60s is cut off with an RPC timeout, and a 300s declaration is unreachable. Add oneshot_rpc_with_hook_budget, which extends the deadline by a caller-supplied hook budget on top of the base timeout, and compute that budget on the client from the summed declared on_activate timeouts of the active loadouts and the project — all known before the call. The activate and task-run paths pass it into FinalizeSession; every other RPC is unchanged, and a hooks-free session keeps the original 60s deadline. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABMzEugA
min session activateandmin task runfinalize a session with oneFinalizeSessionRPC, and the daemon runs the session'son_activatelifecycle hooks inside that single call. The client bounds every oneshot RPC at a fixed 60s, yet activation hooks run sequentially and unbudgeted on the daemon — each allowed up to the 300s hook-timeout cap — so any configuration whose hooks exceed ~60s is cut off with a raw RPC timeout, and a declared 300s hook is unreachable by construction. This sizes theFinalizeSessiondeadline to the summed declaredon_activatetimeouts (loadout plus project hooks, all known client-side before the call) added on top of the base timeout, so a hooks-free finalize and every other RPC keep the original 60s. The budget lives in theminimal-clienttransport and the two CLI activate paths; the hook definitions already exposetimeout(), so they need no change.Verification
cargo fmt --all --check— clean, no driftcargo clippy --workspace --locked -- -D warnings— exit 0, no warningscargo build --workspace --locked— exit 0cargo test --workspace --locked— all test binaries ok, 0 failed; addsloadouts::tests::activate_hook_budget_reflects_declared_on_activate_timeout