Skip to content

fix(reactor): open a message run when an approval resumes a parked call - #1493

Closed
bwachman wants to merge 1 commit into
cl-10765-never-inject-a-timeout-result-for-a-parked-call-that-alreadyfrom
cl-10777-open-a-message-run-when-an-approval-resumes-a-parked-call
Closed

bwachman wants to merge 1 commit into
cl-10765-never-inject-a-timeout-result-for-a-parked-call-that-alreadyfrom
cl-10777-open-a-message-run-when-an-approval-resumes-a-parked-call

Conversation

@bwachman

@bwachman bwachman commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • When an approval (approved or rejected) resumes a parked call and no message run is open, the reactor opens one keyed on the approval message, so the re-dispatched call and its continuation emit the normal message.run.started and message.run.ended events.
  • A reactor rebuilt after a restart or corbits resume previously ran an approved call with no open run. The TUI's reload deferral from fix(tui): defer agent reload until the reactor's message run ends #1486 keys on those events, so it could rebuild the agent mid-call on that path.
  • When a run is already open (the live case), nothing changes.

Stacked on #1492 (which is stacked on #1485); review those first. The diff against its branch is this change only.

Verification

  • bun run check and bun run test pass (9203 tests)
  • The new reactor tests for a rehydrated approval and a rehydrated rejection fail on the base branch (no run opened) and pass on this branch; the live-run test passes on both
  • All six fixes from this series applied together on current main pass bun run test (9202 tests) and the reload regression test passes 3 of 3 runs

Fixes CL-10777
Part of CL-10763

A run opens only when the loop dequeues message.received, and a
correlated approval never becomes one. A parked call rehydrated by a
new reactor has no run from the process that parked it, so its
approval re-dispatched the call and re-inferred with no run open, and
consumers that treat no open run as idle could rebuild the agent under
the running continuation.

The approval now opens a run keyed on its own message id when none is
open. A resume inside the still-open parking run is unchanged.
@linear-code

linear-code Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

CL-10763

CL-10777

@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

Opens a message run keyed on the approval's message id when a rehydrated parked call resumes with no run open, so idle-detectors can't rebuild the agent mid-continuation.

Findings

  • vendor/intx-inference/src/reactor.ts:853 — follow-up to consider: the gate-cleared exclusion is correct for re-dispatched or answered parked calls, but a rehydrated async marker (no suspended call) resumed after restart still re-infers via the gate-cleared path with no run open. Pre-existing shape, not a regression; suggest either extending the open to that rail when no run is open or recording why the async rail is safe, with a mirroring test.

@bwachman

Copy link
Copy Markdown
Contributor Author

Superseded by #1494 (CL-10782). When an approval rehydrated from disk resumes with no message run open, #1494 holds the agent rebuild on the Corbits side until the resumed work replies or ends, so the reactor does not need to open a run and nothing changes under vendor/. We don't intend to merge or keep working on this PR. It stays open, as a draft, until #1494 lands, then it gets closed.

@bwachman
bwachman marked this pull request as draft October 17, 2026 05:18
@TheGreatAxios

Copy link
Copy Markdown
Collaborator

#1494 has landed, which is the close condition on this draft. Superseded: when an approval resumes with no message run open, the agent rebuild stays held on the Corbits side until that work replies or ends, so the reactor does not need to open a run and nothing under vendor/ changes. Closing the draft and CL-10777.

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