Repository navigation
fix: follow-up messages miss steering while a reply prepares - #162476
roboclaw-bot wants to merge 2 commits into
Conversation
Capture the existing reply owner before backend readiness and wait after the Gateway acknowledgment. Preserve first-backend identity, cancellation, input custody, and genuine-rejection fallback without steering a successor. Co-authored-by: vyctorbrzezowski <[email protected]>
Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: a7e88a6a-0bc5-40ed-b42a-b99ed2590f17
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 2:39 AM ET / 06:39 UTC. ClawSweeper reviewWhat this changesThe PR lets explicit Gateway follow-up messages wait for their captured reply’s backend after acknowledgment, with cancellation, permission checks, and normal follow-up fallback preserved. Merge readiness✅ Ready for maintainer review Keep open: current main still misses this Gateway admission case, and the related preflight PR addresses a different entry point. No concrete introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherGateway chat admission accepts messages from OpenClaw clients and directs them to an existing reply or a later turn. The reply registry tracks the current execution owner and exposes its backend readiness. flowchart TD
A[Client follow-up] --> B[Gateway admission]
B --> C[Capture existing reply owner]
C --> D[Acknowledge message]
D --> E[Wait for backend or retirement]
E --> F[Recheck owner and permissions]
F --> G[Steer existing reply]
F --> H[Normal follow-up fallback]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +81, Tests +729, Docs +6. Total +816 across 13 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep readiness with the existing reply owner and reuse the established injection, cancellation, and custody boundaries. Do we have a high-confidence way to reproduce the issue? Yes, from source: send an explicit steer while an existing reply operation has no running backend. Current main captures no target and later dispatch marks steering rejected; the PR reports a failing original-code handler regression. Is this the best way to solve the issue? Yes. Publishing readiness from the existing operation and delaying injection until after acknowledgment preserves ownership without adding another queue or policy owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5cf24affb0c1. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Related: #161045. Complements #161046's downstream preflight path; this fixes explicit Gateway
chat.sendadmission.What Problem This Solves
Fixes follow-up messages waiting for separate answers when Send arrives while an existing reply is preparing its backend.
User Impact
The follow-up is acknowledged promptly and can join the same reply once its backend is ready. Queue modes, cancellation, permissions, media checks, and genuine-rejection fallback remain intact. No configuration or schema migration is required.
Only an existing reply owner is eligible. Requests arriving before any reply owner exists retain their current behavior; the fix never discovers an arbitrary future owner or redirects steering to a replacement.
Why This Change Was Made
The Gateway previously recorded explicit steering as rejected even when preparation prevented any injection attempt. The existing reply-operation owner now publishes its first running backend (or retirement), and Gateway admission can retain that exact owner across readiness. Waiting happens after the ACK; injection reuses the existing authority, transcript-custody, and terminal-receipt checks. A changed owner, key, or ready backend cannot inherit the input. Legitimate same-owner compaction lineage remains supported.
Evidence
371 unique tests passed across 24 files, covering actual send-handler admission, three-message ordering, both phase/backend readiness orders, ACK-boundary readiness, cancellation, idempotency, profile/grant changes, compaction, replacement, hidden questions, media, transcript custody, and Codex exact-turn submission/batching/settlement.
handleChatSendregressionsnode scripts/check-changed.mjspassed in full: core production types, all 27 shared test/type graphs, changed-file lint/formatting, all three Knip scans, schema/ownership guards, and runtime import-cycle checks.git diff --checkalso passed.Measured changed-test cost
Each row used
pnpm test <file> --maxWorkers=1. Wall time includes runner setup/compiler overhead, not just test execution. Hosted CI seconds are not yet available.chat-send-preparing-steer.test.tsreply-run-registry.preparing-injection.test.tschat-send-steering-custody.test.tsVerification limits
Three additional
agent-runner.runreplyagent.e2e.test.tsno-replay/CLI-fallback cases could not start: runtime preparation's managed-Gateway artifact-separation check refused both the host and the supported network-isolated runner. The isolated runner's Node, pinned pnpm, and Chromium preflight passed; containers were removed, and no safeguard was bypassed. This is setup failure, not passing E2E evidence.The passing proof includes authenticated loopback Gateway transport and the real AgentSession queue with synthetic model output. Codex proof uses its adapter fixtures, not a live provider. No production Gateway was modified; no full-repository suite or live-provider run is claimed.
Worked on by
Work sessions
View the OpenClaw team session