Skip to content

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

Merged
TheGreatAxios merged 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
Oct 17, 2026
Merged

TheGreatAxios merged 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

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

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 passes (9208 tests, 0 fail)
  • 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

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 Author

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:842 — 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.

@corbits-triage

Copy link
Copy Markdown
Contributor

Triage: Pass

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

@TheGreatAxios
TheGreatAxios merged commit e1aedf3 into cl-10765-never-inject-a-timeout-result-for-a-parked-call-that-already Oct 17, 2026
13 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-10777-open-a-message-run-when-an-approval-resumes-a-parked-call branch October 17, 2026 17:29
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