Skip to content

fix: size FinalizeSession deadline to activation hook timeouts - #1220

Draft
gominimal-aw-bot[bot] wants to merge 1 commit into
mainfrom
inbox-patch/scale-finalize-hook-timeout-0a184bb81dbbf6a2
Draft

fix: size FinalizeSession deadline to activation hook timeouts#1220
gominimal-aw-bot[bot] wants to merge 1 commit into
mainfrom
inbox-patch/scale-finalize-hook-timeout-0a184bb81dbbf6a2

Conversation

@gominimal-aw-bot

Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABMzEugA

min session activate and min task run finalize a session with one FinalizeSession RPC, and the daemon runs the session's on_activate lifecycle 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 the FinalizeSession deadline to the summed declared on_activate timeouts (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 the minimal-client transport and the two CLI activate paths; the hook definitions already expose timeout(), so they need no change.

Verification

  • cargo fmt --all --check — clean, no drift
  • cargo clippy --workspace --locked -- -D warnings — exit 0, no warnings
  • cargo build --workspace --locked — exit 0
  • cargo test --workspace --locked — all test binaries ok, 0 failed; adds loadouts::tests::activate_hook_budget_reflects_declared_on_activate_timeout

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>
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2d32e67-92de-4e2f-96bf-f878f1f7361d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants