Repository navigation
fix(auto-reply): key command-turn reply operations to the source session - #104144
Merged
Merged
Conversation
This was referenced Jul 12, 2026
obviyus
added a commit
that referenced
this pull request
Jul 12, 2026
…e into agent turns Native command turns keep #104144 source-keyed admission, but a turn that continues into a full agent turn (/steer fallback, /goal, /learn, unhandled body) now moves its reservation and lifecycle lease to the target session before running. Concurrent target inbounds see the owner and queue/steer instead of double-admitting and splitting the session into two conversation families; steering also targets the registered run owner instead of a stale source-keyed reservation. Fixes #104844
obviyus
added a commit
that referenced
this pull request
Jul 12, 2026
…e into agent turns Native command turns keep #104144 source-keyed admission, but a turn that continues into a full agent turn (/steer fallback, /goal, /learn, unhandled body) now moves its reservation and lifecycle lease to the target session before running. Concurrent target inbounds see the owner and queue/steer instead of double-admitting and splitting the session into two conversation families; steering also targets the registered run owner instead of a stale source-keyed reservation. Fixes #104844
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 12, 2026
…e into agent turns Native command turns keep openclaw#104144 source-keyed admission, but a turn that continues into a full agent turn (/steer fallback, /goal, /learn, unhandled body) now moves its reservation and lifecycle lease to the target session before running. Concurrent target inbounds see the owner and queue/steer instead of double-admitting and splitting the session into two conversation families; steering also targets the registered run owner instead of a stale source-keyed reservation. Fixes openclaw#104844
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Native slash-command turns key their reply operation to the command-target session. When the target has an active run,
admitReplyTurntreats the command turn as"visible"and dead-waits onreplyRunRegistry.waitForIdle(target)(reply-turn-admission.ts:294) —/stopwaits on the very run it is supposed to kill,/statuswaits on the run it should report on. Production incident on 2026-07-11 (Telegram group): a group member's/stop— channel-authorized viagroupAllowFrom: ["*"]but declined bycommands.ownerAllowFromat the pre-admission fast-abort — wedged its slash session (queued_work_without_active_run), held the per-chat Telegram control lane guarded for 5 minutes, blocked the owner's own/stopbehind it, and forced a watchdog ingress restart whose backlog drain collaterally aborted an unrelated codex harness startup. The run itself was never stopped. Fixes #104142.Why This Change Was Made
The deadlock is latent since #85100 introduced target-aware operation keying, and was masked on Telegram because — until #103664 — any group inbound aborted the active run at the transport fence, so command turns never met a busy target. #103664 correctly removed that transport kill authority; core must now handle command turns while runs are active.
#85100's own contract says "abort ownership stays source-keyed" and "/stop does not self-abort its own command". This PR aligns the reply-operation key with that contract:
dispatch-from-config.ts:dispatchOperationSessionKeyresolves source-first (ctx.SessionKey); the session-store entry used for operation identity follows the source when it diverges from the command target.initialSessionStoreEntrystays target-aware for command handlers (status/stop/model act on the target viaCommandTargetSessionKey).reply-turn-admission.ts: thecontrol_abortturn kind had zero producers (designed seam, never wired) and is now removed.Command turns admit instantly on their (idle-by-construction) source session; effects on the target keep flowing through the run registry / session store as before.
User Impact
/stopworks during active runs for everyone the config authorizes, and unauthorized senders get an immediate "not authorized" reply instead of a silent 5-minute wedge./status(and other native commands) answer immediately mid-run instead of never./stopfor the whole chat or triggers watchdog channel restarts.Evidence
dispatch-from-config.acp-abort.test.ts): unauthorized native/stopand authorized/statusagainst a session with an active run must settle in <200ms with the target run untouched; the Fix Discord session recovery abort ownership #85100 ownership test now asserts the source-keyed contract.run-vitestondispatch-from-config.acp-abort.test.ts,abort.test.ts,reply-turn-admission.test.ts— 83/83 passed;run-tsgocore + core-test lanes clean; oxlint clean on changed files.groupAllowFrom: ["*"]+commands.ownerAllowFrom, non-owner/stop): silent wedge, run unaffected → fast reply, no wedge, run unaffected/statusmid-run: no reply ever → immediate status reply, run survives/stopmid-run: abort ~1s (unchanged)