Skip to content

fix(reactor): keep rejected and timed-out approval results across a rebuild - #1575

Merged
bwachman merged 2 commits into
mainfrom
cl-11433-persist-rejected-timed-out-and-dropped-approvals-before-an
Oct 29, 2026
Merged

bwachman merged 2 commits into
mainfrom
cl-11433-persist-rejected-timed-out-and-dropped-approvals-before-an

Conversation

@bwachman

Copy link
Copy Markdown
Contributor

Summary

  • The reactor writes a rejected or timed-out call's synthetic result to the store's turn segments as soon as it records it, so a rebuild before the next cycle commit loads the answered call instead of re-arming its approval.
  • Shutdown flushes a rejection or timeout the reactor accepted but had not yet processed when the abort overtook it. An accepted approval that never ran stays parked on disk with no result.
  • The vendored patch ledger records that the result closes the parked approval only because the Corbits session store drops an answered call's pending operation on load, and what promoting the patch upstream would also need.

Verification

  • bun run check passes on each commit (9502 tests at the tip)
  • e2e: a rejection or timeout followed by a rebuild before the cycle commits, and a rejection accepted behind a busy loop followed by a close and reopen, each load exactly one result and no parked call, and the old deadline adds none
  • The new shutdown e2e test fails with the shutdown flush removed

Related to CL-11433

The tool-cycle coalescing patch defers the cycle commit to the next
terminal, and only executeTools wrote turns in between. A rebuild after
a rejection or timeout but before that terminal reloaded the call as
still parked with no result, and the next request sent an unanswered
tool call.
@linear-code

linear-code Bot commented Oct 28, 2026

Copy link
Copy Markdown

CL-11433

@corbits-triage

corbits-triage Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Approve

Persists rejection and timeout results before cycle commit and flushes accepted negative decisions during reactor shutdown.

No findings.

Reviewed 31a5741144b7b9d15d249d2c16830d08cfaa2754 against main. The scoped permission lens found no additional trust findings; that assessment was static, not a general race-safety guarantee.

Verification: bun test vendor/intx-inference/src/reactor.test.ts e2e/reactor-approval-reload.test.ts: 206 passed. Adjacent acceptance/parked-call settlement suites: 30 passed. A temporary timeout-behind-inference/shutdown reproduction passed and was removed. bun run check output completed through the guarded suite with 9,502 passed, 0 failed; the background wrapper's final numeric exit status was not surfaced. Validation covers graceful shutdown/rebuild, not power-loss durability or generic upstream-store compatibility.

@bwachman
bwachman merged commit efa0a36 into main Oct 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants