Repository navigation
Bound plugin lifecycle hooks with cancellable deadlines - #85
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Final review and verificationReviewed immutable diff StandardsPASS — 0 blockers. Typed registration validation, reuse of the shared abort helper, no added dependencies or plugin coupling, timer/signal cleanup, redacted late errors, and updated public docs were reviewed. SpecPASS — 0 blockers. Reviewed fail-closed deadlines, interruption without handler cooperation, late results/errors, preservation of post-tool cleanup semantics, and file-side-effect warnings. Synchronous event-loop blocking and uncooperative plugin side effects remain explicitly outside the waiting guarantee. Both reviews covered 6/6 files, 11/11 hunks, all 343 added and 6 removed lines, with no unchecked hunks or binaries. The independent reviewer additionally ran the registry tests (18 passed) and six in-memory cooperative-cancellation race probes; all retained named timeout failures and exactly one terminal event. Verification:
TL;DR
Recommendation: PROCEED. User explicitly authorized merging once verification and blocking reviews pass. |
Summary
Bound plugin lifecycle hooks so an uncooperative asynchronous handler cannot keep a coding turn pending forever.
Hook.timeoutMs(integer 1–600,000 ms).Why this improvement
Static inspection of the locally installed Claude Code 2.1.319 found timeout selection, an abortable callback wait, and cleanup in its packaged function-hook dispatcher. Claude was not launched or prompted. Xal already bounds provider stalls and completion-gate continuations, but its shared hook dispatcher directly awaited arbitrary promises, including after interruption.
REA 6.8.0 native identity Evidence:
ev_e4ff052dbdf922a9536c239d8019be93afec1dd1bb04e7d2b6384c81dbe8cc4e; installed artifact SHA-256:1f53587e92dee8e089fa349188a4cda64fa34ace6e7b0ca2ee278ddaa3cc2ebd. Focused static function Evidence:ev_3287a78de67e12b0d93011aa97eb7d1ad8fd9c3e2b22af0087c2540357cae1fe, derived from exact binary bytes[273132358, 273133308). Broad bundle analysis was partial; focused syntax parsed completely, with dynamic callees unresolved. These are static observations, not runtime claims or a complete Claude Code audit. No proprietary source is included in this PR. Xal's budgets and fail-closed policy are independent design decisions.Deferred follow-ups: foreground session single-writer ownership and fail-closed transcript-write barriers before subsequent side effects. Neither is mixed into this change.
Verification
bun test --isolate apps/cli/src/hooks/registry.test.ts apps/cli/src/agent/session/hook-deadlines.test.ts apps/cli/src/agent/session/completion-hooks.test.ts— 31 passed.bun checks:fix— passed (format/lint, Rust checks/tests/clippy, native benchmark, typecheck, all tests, website build, compiled release smoke checks).CLI suite: 930 tests passed; no failures.
GitHub
checksand all eight macOS/Linux/Windows release-build targets passed fore4d9acab23f79f99c09cf64a4932dd98a526572c.Parent review and independent sub-agent
$code-review: Standards PASS, Spec PASS, zero blockers; 6/6 files and 11/11 hunks reviewed (+343/-6).CodeRabbit reported its free OSS review limit and skipped reviewing. No actionable bot findings were posted; its neutral check is not an approval.
Scope: six source/test/documentation files; no dependencies, unrelated changes, or instruction-file changes.