Skip to content

fix(orchestrator): fail closed on cross-conversation run identity - #748

Merged
JSap0914 merged 6 commits into
devfrom
codex/slack-run-isolation
Sep 11, 2026
Merged

fix(orchestrator): fail closed on cross-conversation run identity#748
JSap0914 merged 6 commits into
devfrom
codex/slack-run-isolation

Conversation

@JSap0914

Copy link
Copy Markdown
Collaborator

Problem: a Slack reply waiter accepted completion/control events that named only a requestId. Missing origin/scope/session/remoteKey/target counted as agreement, so a terminal from another run could be adopted. A second conversation could also be steered into an active non-native run or collected with another remote key.

This layer makes run identity carried and fail-closed:

It also adds the exact #742 race regression (last-active moves while a pinned run finishes) and the #744 stream-loss metric assertion.

Validation: targeted strict-pin/producers 197/197 before audit and 284/284 after audit; final npm run gate:all 23/23. Full root+unit at the combined upper tip: 13,490 tests, 13,469 pass, 20 skip, one load-sensitive Pi discovery timeout; that Pi file passes 19/19 alone and in the 114-test runtime batch. Independent grok-4.6 review: PASS, no merge blocker.

Closes #742.
Closes #743.
Refs #744.

suji lee added 6 commits September 12, 2026 00:37
A Slack waiter used to require requestId but treat every absent scope, session,
origin, remoteKey, and target as agreement. The print terminal that triggered
the September 11 incident omitted those fields, so a new waiter could adopt an
older run's control or completion event.

Run-pin matching now requires requestId/origin/scope/session and, when the
waiter owns them, the exact remoteKey and target. Producers are filled first:
request settlement retains the admission pin, queue start/update and failure
events carry it, and Slack terminals expose scope/session/remoteKey even when
multi-session mode is off. The collector applies the same rule to Slack
orchestrate_done events.

A steer can mutate only the conversation that owns the active run. Another
remoteKey is queued as a separate follow-up before in-band or kill-steer input
is dispatched, and collect batches no longer join different remote keys that
happen to share a scope.

Preserves the existing boot-drain/orphan target-reply contract and synthetic
thread keying. Refs #743
Update queued Slack and collector fixtures to carry the production terminal pin,
and lock the new behavior: a foreign remoteKey waits as its own turn, collect
does not join another remote conversation, and request settlement preserves the
admission target even if its caller mutates the original object.
Independent review found that the new gateway follow-up guard ran before native
replaceTurn validation. A foreign remoteKey was queued with the native owner's
scope, session, and target, which could store another conversation's prompt in
the owner transcript.

Native replacements now retain their typed owner-mismatch failure. Non-native
in-band and kill-steer paths still queue another remote conversation, deriving
the owner key from its captured target when remoteKey is absent. Terminal
targets are snapshotted, incomplete targets are omitted from pins, and steer
supersession requires the exact origin/session/remoteKey.

Refs #743
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 881f7f34-db08-4790-b1c7-f754d7555877

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

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.

❤️ Share

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.

1 participant