Skip to content

fix(auto-reply): queue instead of steering after a terminal source-reply receipt - #129001

Merged
obviyus merged 22 commits into
openclaw:mainfrom
Finn763:fix/issue-128971-steer-terminal-receipt
Sep 10, 2026
Merged

obviyus merged 22 commits into
openclaw:mainfrom
Finn763:fix/issue-128971-steer-terminal-receipt

Conversation

@Finn763

@Finn763 Finn763 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Related to #128971.

What Problem This Solves

A message sent near the end of an active turn could receive no reply because steering reused that turn's completed delivery claim.

Why This Change Was Made

Steering checks the current terminal receipt immediately before the runtime takes the input. An ineligible message stays in the ordered follow-up queue and receives its own turn. Source bindings belong to the exact active operation, and input already accepted by a runtime is never replayed.

The queued reply owner publishes completion once, after reply delivery settles. Progress continues while success, silence, failure, timeout, and cancellation retain a terminal outcome. Stream tails, partial abort replies, canvas output, and source-recovery callback custody are preserved.

User Impact

Late messages receive one follow-up reply. Normal steering and steering past an unrelated old receipt continue to work. Ambiguous or stale terminal delivery remains fail-closed.

Evidence

  • Baseline: authenticated loopback Gateway chat.send accepted a new message into an active channel turn with an owner-prepared retained terminal receipt. The actual terminal message-tool attempt returned already-delivered; the new message received no expected transport reply or content-bearing WebSocket final.
  • Repaired public flow: the message stayed queued until the source completed, then used a fresh follow-up turn with exactly one transport reply and one content-bearing WebSocket final. The original queued client's empty completion remained intact.
  • Positive controls: normal steering and a known unrelated historical receipt each accepted input into the original run and delivered one terminal channel reply.
  • Independent behavior validation repeated all three candidate scenarios and inspected every recorded event. Separate source review resolved operation ownership, fresh-read failure, parked-predecessor receipt changes, accepted-input replay, and queued completion findings.
  • Focused runner, receipt, registry, queue, delivery, recovery, and Gateway tests passed. Eight real Gateway completion cases covered text/progress, empty output, canvas, deliberate silence, policy suppression, failure, timeout, and abort. Changed-file formatting/lint and both source ratchets passed.
  • Proof used synthetic state, a controlled local model endpoint, and a registered synthetic channel transport. It does not claim live third-party channel delivery. Exact-head hosted CI and final review are required before landing.

This repair preserves Finn763's original contribution and all 19 commits.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 25, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 3:13 PM ET / 19:13 UTC (Revision 24).

ClawSweeper review

What this changes

Queues late input as a fresh turn when the active turn cannot deliver another reply, and makes queued delivery publish one terminal completion.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix: current main lacks the terminal-receipt steering guard. The prior findings are addressed, the latest commit changes only test handling, and no blocking correctness defect was found.

Priority: P1
Reviewed head: 9762ab0418d8c4ad138c998af20a74d2d4e6379b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful owner-level repair with sufficient production-path evidence and no remaining blocking findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured evidence reports authenticated loopback chat.send through the production queue and delivery owners, with a controlled model endpoint and synthetic channel transport: late input receives one fresh-turn reply and one content-bearing final, while both steering controls remain valid. The latest commit changes only tests, so that production proof remains applicable; live third-party delivery is not claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured evidence reports authenticated loopback chat.send through the production queue and delivery owners, with a controlled model endpoint and synthetic channel transport: late input receives one fresh-turn reply and one content-bearing final, while both steering controls remain valid. The latest commit changes only tests, so that production proof remains applicable; live third-party delivery is not claimed.
Evidence reviewed 10 items Pinned re-review comparison: GitHub’s comparison of the previous reviewed head with the pinned head contains only WebSocket decoding and per-run cleanup assertions in two tests. Production code is unchanged. The local comparison encountered an unavailable historical object; the GitHub comparison supplied the missing evidence.
Receipt checked immediately before injection: Parked steering rereads the session after admission waits, falls back to the ordered queue on read failure or terminal receipt, and preserves the existing exact-operation injection and tool-authority checks.
Source identity and retained-state safeguards: Source binding verifies that the exact operation still owns its slot and is neither settled nor aborted. Cleanup removes the binding only for its owner; retained singleton initialization and replacement-operation tests cover the lifecycle.
Findings None None.
Security None None.

How this fits together

OpenClaw’s reply pipeline either injects incoming messages into an active agent turn or queues them for later execution. Delivery receipts prevent duplicate sends, while Gateway completion events tell connected clients when replies finish.

flowchart TD
  A[Incoming message] --> B[Active turn and receipt check]
  B -->|Eligible| C[Steer active turn]
  B -->|Terminal or uncertain| D[Ordered follow-up queue]
  D --> E[Fresh agent turn]
  E --> F[Reply delivery owner]
  F --> G[Transport reply and terminal event]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +576, Tests +2302. Total +2878 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 24 681 105 +576
Tests 12 2736 434 +2302
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 36 3417 539 +2878

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +576 lines; tests net +2302 lines Production growth implements receipt-scoped admission and queued completion ownership; the larger test delta covers their lifecycle and delivery boundaries.

Technical review

Best possible solution:

Keep receipt deduplication intact while giving ineligible late input a fresh queued turn whose delivery owner records exactly one completion.

Do we have a high-confidence way to reproduce the issue?

Yes for the narrow late-steering mechanism: current source permits injection after terminal delivery, and the supplied baseline documents the resulting missing reply. This review did not execute a new current-main reproduction.

Is this the best way to solve the issue?

Yes. The patch reuses the receipt decision and ordered queue, preserves exact-operation admission, and assigns terminal publication to the delivery owner without adding configuration or changing stored formats.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5b097c8b41ae.

Labels

Label justifications:

  • P1: Late input can otherwise complete without the requested reply, breaking an active conversation workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured evidence reports authenticated loopback chat.send through the production queue and delivery owners, with a controlled model endpoint and synthetic channel transport: late input receives one fresh-turn reply and one content-bearing final, while both steering controls remain valid. The latest commit changes only tests, so that production proof remains applicable; live third-party delivery is not claimed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured evidence reports authenticated loopback chat.send through the production queue and delivery owners, with a controlled model endpoint and synthetic channel transport: late input receives one fresh-turn reply and one content-bearing final, while both steering controls remain valid. The latest commit changes only tests, so that production proof remains applicable; live third-party delivery is not claimed.

Evidence

What I checked:

  • Pinned re-review comparison: GitHub’s comparison of the previous reviewed head with the pinned head contains only WebSocket decoding and per-run cleanup assertions in two tests. Production code is unchanged. The local comparison encountered an unavailable historical object; the GitHub comparison supplied the missing evidence. (9762ab0418d8)
  • Receipt checked immediately before injection: Parked steering rereads the session after admission waits, falls back to the ordered queue on read failure or terminal receipt, and preserves the existing exact-operation injection and tool-authority checks. (src/auto-reply/reply/agent-runner-steer-adoption.ts:153, 9762ab0418d8)
  • Source identity and retained-state safeguards: Source binding verifies that the exact operation still owns its slot and is neither settled nor aborted. Cleanup removes the binding only for its owner; retained singleton initialization and replacement-operation tests cover the lifecycle. (src/auto-reply/reply/reply-run-registry.registry.ts:119, 9762ab0418d8)
  • One queued completion owner: Consumed execution publishes its typed completion through the queued source callback before releasing the operation. Delivery failures do not replay the executed prompt; Gateway finalization preserves progress tails, abort content, canvas filtering, and run cleanup. (src/auto-reply/reply/followup-runner.ts:262, 9762ab0418d8)
  • Current main still needs the repair: The fetched main’s admission path proceeds from loading restart-recovery state to duplicate-source handling without the new terminal-receipt steering guard. No verified merged replacement was established. (src/auto-reply/reply/agent-runner-run.ts:183, 5b097c8b41ae)
  • Latest release check: The v2026.9.3 receipt owner retains the earlier terminal-delivery implementation and does not contain the steering classifier added by this branch. (src/config/sessions/restart-recovery-receipt.ts:55, 1391f7cd2d40)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Glucksberg: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (23 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-28T05:57:03.781Z sha 85d023d :: needs real behavior proof before merge. :: [P2] Fence retained active runs with no recorded source identity
  • reviewed 2026-08-28T06:22:52.858Z sha 85d023d :: needs real behavior proof before merge. :: [P2] Fail closed when an active source identity is unavailable
  • reviewed 2026-09-02T14:31:35.702Z sha 85d023d :: needs changes before merge. :: [P2] Fail closed when the active source identity is unavailable
  • reviewed 2026-09-04T16:01:53.415Z sha 85d023d :: blocked before merge. :: [P2] Fence tombstones when the active source ID is unavailable
  • reviewed 2026-09-04T17:08:17.675Z sha 2afd0df :: blocked before merge. :: none
  • reviewed 2026-09-10T11:50:45.358Z sha 59c0067 :: needs changes before merge. :: [P2] [P2] Update the existing starter fixture for the new required fields
  • reviewed 2026-09-10T12:42:05.745Z sha 5823932 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T18:56:42.352Z sha e5b3e14 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 25, 2026
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label Aug 25, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: L and removed size: S labels Aug 25, 2026
@Finn763

Finn763 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed mantis: telegram-visible-proof Mantis should capture Telegram visible proof. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 25, 2026
@Finn763

Finn763 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@Finn763

Finn763 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

CI triage — shard failures trace to main's red window (now recovered), not this diff

Completed CI runs don't auto-refresh, so a re-run of the failed jobs against current main should turn these checks green. No product failure is attributable to this PR's changes.

@Finn763

Finn763 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Hi @steipete @vincentkoc — follow-up on my CI triage comment above: main's red window is now closed.

push-to-main CI has been fully green since 12:38Z today:

This PR's head (89671048f597) is unchanged since the failing run; every red check (check-lint-core-3, checks-node-compact-large-3/9/10/11/17/20/29, small-20/21/22/23/45, ci-gate) traces to that window, not this diff. "PR context and evidence" passes on this PR.

As an external contributor I have no write access to rerun failed jobs myself — could you please rerun the failed jobs on this PR? Thanks!

@Finn763
Finn763 force-pushed the fix/issue-128971-steer-terminal-receipt branch from 8967104 to 0d3ee55 Compare August 26, 2026 19:23
@Finn763

Finn763 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest origin/main (adb3fb2) and force-pushed.

  • New head: 0d3ee5553b0 — clean rebase.
  • Local: touched suites pass (9/17 of the session-receipt file; the 8 teardown failures are a pre-existing Windows-only SQLite temp-dir lock — mains own goals.test.ts fails identically here, Linux CI unaffected).

@steipete could you please re-run the failed CI jobs? Thanks!

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 26, 2026
@Finn763
Finn763 force-pushed the fix/issue-128971-steer-terminal-receipt branch from a603003 to 4691a82 Compare August 26, 2026 23:41
@Finn763

Finn763 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the round-5 ClawSweeper review (verdict on head 0d3ee5553b0). Summary of what changed and the evidence behind it:

1. [P1] Scope tombstone checks to the active source turn — fixed.

The fail-closed classifier now takes the active source-turn identity and scopes the terminal-tombstone condition to that exact source:

  • isRestartRecoveryTerminalDeliveryFailClosed(entry, sessionId, sourceTurnId) replaces the any-tombstone check (hasAnyRestartRecoveryTerminalRun) with the exact-source check (hasRestartRecoveryTerminalRun(entry, sourceTurnId)), so a retained tombstone only fail-closes the fence when it belongs to the target active source turn. The send path's already-delivered/not-applicable resolution is shared, so the fence and the send owner cannot drift.
  • Both admission paths now carry source identity: the owning runner records the active source-turn id on the reply-run registry when it admits its delivery claim (replyRunRegistry.bindSourceTurnId), and the gateway's injection target carries it (target.sourceTurnId) with the entry's claim source as fallback. The runner-side fence uses the same registry identity.
  • New regression coverage (red → green): unrelated-tombstone acceptance and same-source rejection at the receipt classifier, at the gateway injection fence, and in the runner e2e steer path (see the PR body ## Evidence section for the full transcripts).

2. Real behavior proof (ephemeral-gateway trace) — constraint statement instead of a fabricated trace.

A redacted ephemeral-gateway run cannot be produced on this host, and I'm stating the mechanism rather than faking one:

  • No gateway deployment exists here (~/.openclaw has no gateway config), no Telegram/WhatsApp bot credentials, no live LLM provider credentials; the in-repo qa-lab live lane (startQaLiveLaneGateway) requires real OPENCLAW_QA_TELEGRAM_* driver/SUT bot tokens plus live model credentials to drive a real channel inbound and an observed reply.
  • ClawSweeper's own live verification of this branch's gateway suite passed (8/8 on the reviewed head), and the deterministic admission decision is the same code path the unit suites lock: the front fence rejects before beginReplyMessageInjectionTarget (the synchronous queueMessage boundary) is ever called, so a fail-closed inbound is enqueued zero times as a steer and dispatched exactly once as a follow-up.

3. Merge-risk items 3–5 are the same P1 and proof items above. Item 6 (P2) is covered by the same regression set.

Test results on this host (branch head 4691a828fcf):

  • node scripts/run-vitest.mjs src/gateway/server-methods/chat-send-message-injection.test.ts — 10/10 passed (includes the two new source-scope cases).
  • node scripts/run-vitest.mjs src/config/sessions/restart-recovery-receipt.test.ts — 11 passed | 8 failed, where all 8 failures are the pre-existing Windows EPERM temp-dir teardown noise (zero assertion failures; identical on the untouched pre-fix head).
  • node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts — 17 passed | 148 failed, where all 148 failures are EPERM/EBUSY temp-dir teardown noise (0 AssertionErrors, same noise class as the prior revision's baseline). All 8 steering/receipt cases pass, including the new "steers while the retained terminal-source tombstone belongs to an unrelated prior source turn" and the existing same-source tombstone fail-closed case.
  • oxfmt --check and oxlint clean on all changed files; pnpm tsgo:core passes.

The PR body has been updated with the P1 fix description, the red → green evidence, and the trace constraint statement. Please re-review when convenient — @clawsweeper re-review.

…nclaw#128971)

- import forceClearReplyOperation from reply-run-registry.state.js, its
  owning module: the isolated-gateway proof called it from the operation
  module that does not export it, so the inter-test cleanup was a no-op and
  the next createReplyOperation threw ReplyRunAlreadyActiveError (TS2459)
- rename the nested steer fixture to makeSteerStarterParams so it no longer
  shadows the outer makeStarterParams (oxlint no-shadow at 410:12)
- give that fixture the session fields the steer path reads
  (sessionKey/storePath/clientRunId) plus a logGateway stub (TS2739)
@Finn763

Finn763 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 5823932ab63 — repairs the three failures this branch owned in run 34472091894.

1. check-lint-core-1 (job 102854708718) — src/gateway/server-methods/chat-send-message-injection.test.ts:410:12 error eslint(no-shadow): 'makeStarterParams' is already declared in the upper scope. The nested steer fixture shadowed the outer makeStarterParams (line 113). Renamed the nested one to makeSteerStarterParams and updated its 6 call sites; the outer helper and its call sites are untouched.

2. check-test-types (job 102854708754) — exactly two errors, both in that same file pair:

  • chat-send-message-injection.isolated-gateway.test.ts(61,3): TS2459 — forceClearReplyOperation was imported from reply-run-registry.operation.js, which only imports it; the owning export lives in reply-run-registry.state.js. Now imported from there.
  • chat-send-message-injection.test.ts(448,7): TS2739 — the steer fixture passed a session missing fields the steer path reads. Added sessionKey, storePath, clientRunId (matching the active-run backend it attaches) and a logGateway stub.

3. checks-node-compact-large-18 (job 102854712388) — same root cause as (2), not a production regression. The bad import resolved to undefined, so the suite's beforeEach cleanup forceClearReplyOperation(...) threw and was swallowed by its best-effort catch; the live operation stayed registered and the next createReplyOperation for agent:main:main threw ReplyRunAlreadyActiveError in 2 tests. The import repair fixes it; no runtime code changed.

Local verification (worktree at 5823932ab63, Windows):

  • node_modules/.bin/oxlint --config .oxlintrc.json <both files> → no findings. Control run on a copy of the pre-fix file reproduces the exact CI line: 410:12: error eslint(no-shadow).
  • node_modules/.bin/tsgo -p test/tsconfig/tsconfig.core.test.gateway-other.json --noEmit → 0 errors in the two changed files. (The 46 TS2883 diagnostics it prints locally live in untouched *-test-support.ts files and do not appear in the CI check-test-types log — local toolchain artifact.)
  • node scripts/run-vitest.mjs run src/gateway/server-methods/chat-send-message-injection.isolated-gateway.test.ts --maxWorkers=1 --no-file-parallelism → Test Files 1 passed (1), Tests 4 passed (4) (the two CI failures included).
  • node scripts/run-vitest.mjs run src/gateway/server-methods/chat-send-message-injection.test.ts --maxWorkers=1 --no-file-parallelism → Tests 18 passed (18).
  • oxfmt --check on both files → clean, no reformatting needed.

checks-node-compact-small-46 is not this branch: it fails on test/scripts/docs-sync-publish.test.ts > keeps generated locale navigation aligned with English routes, and the 14 files this PR changes are all under src/auto-reply/reply, src/gateway/server-methods and src/config/sessions — no docs/locale inputs.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 10, 2026
@Finn763

Finn763 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on 5823932ab63 (run 34477479839) — the three jobs this branch owned are now green:

  • check-lint-core-1 → success
  • check-test-types (incl. check-test-types-core-1/2) → success
  • checks-node-compact-large-18 → success

Still red on this run, both unrelated to this PR (generated-docs navigation drift, no docs/generated files in the diff):

@obviyus obviyus self-assigned this Sep 10, 2026
@obviyus

obviyus commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Finn763!

Proof: An authenticated loopback Gateway test reproduced accepted late input losing its terminal reply. The repaired flow produced one transport reply and one content-bearing WebSocket final under a fresh follow-up turn. Normal steering and unrelated-receipt controls passed, with independent behavior validation and exact-head source review.

  • Bug: Steering could reuse a turn whose terminal delivery claim was already closed.
  • Fix: Check the current receipt before accepting input, retain ineligible input in the ordered queue, and let queued delivery settle completion once.
Before After
A late message could be accepted without receiving its reply. It receives one ordered follow-up reply with its own delivery identity.

Focused owner, lifecycle, and cleanup checks passed. Hosted CI passed for the landed head. The proof used a controlled local model endpoint and synthetic channel transport. Issue #128971 remains open for delivery-ambiguity paths outside this repair.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants