Repository navigation
Conversation
Bind sends, aborts and exec approvals to the transport epoch captured by conversation state. Preserve submitted drafts across navigation and fence stale confirmation and acknowledgement commits. Co-authored-by: Copilot App <[email protected]>
Resolve independent review P1 by distinguishing pre-admission navigation fences from accepted send completion. Isolate provider test persistence paths, cover production bridge epoch forwarding and connection recovery, and fix the architecture guard reference. Co-authored-by: Copilot App <[email protected]>
Keep pre-handshake missing-session refusal explicit and prevent optimistic state from being created for an empty session. Exercise the actual provider guard instead of supplying its failure from a fake. Co-authored-by: Copilot App <[email protected]>
Guard default tray test processes before linked owners cache paths, preserve safe explicit roots and reject real profiles. Add a discovery-free subprocess regression and stop reading real settings contents in the settings isolation test. Co-authored-by: Copilot App <[email protected]> (cherry picked from commit 734aa41)
|
🦞👀 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. What this changesThe PR binds chat sends, Stop requests, and approval responses to their original connection and rejects reset confirmation after navigation. Example: A send for agent:test:session captures connection epoch 7, then the connection changes to epoch 8 before dispatch.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a source-confirmed connection race, and no definite introduced correctness bug was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe native chat controller submits user actions through conversation state and the Gateway bridge; the shared client converts admitted operations into generation-bound WebSocket requests. flowchart LR
A[Native chat actions] --> B[Composer controller]
B --> C[Conversation state]
C --> D[Gateway chat bridge]
D --> E[Gateway client]
E --> F[Generation bound socket]
F --> G[Gateway]
Technical reviewBest possible solution: Retain the existing conversation and transport owners, with admission epochs enforced at the final socket write. Do we have a high-confidence way to reproduce the issue? Main's delayed dispatch can acquire the replacement connection at invocation, and reset confirmation checks lifetime without checking navigation; source inspection establishes both paths, but no target code was executed. Is this the best way to solve the issue? Capturing the transport epoch in existing state transactions and checking it through the existing generation-bound socket writer directly addresses the race without adding a competing production owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 51f18c1222c9. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 5:14 AM ET / 09:14 UTC. |
What Problem This Solves
Fixes: a delayed chat send, Stop request or exec-approval response can act on a replacement connection, and reset confirmation can apply after the user has left the conversation.
User Impact
User impact: stale operations fail closed instead of moving to another connection. Accepted sends remain accepted after navigation, clear only their submitted draft revision and attachment identities, and preserve later edits. Reset confirmation no longer authorizes a conversation the user has since left.
This is a bounded transport-safety prerequisite, not complete web chat parity. Steer, uncertain-delivery reconciliation, plugin/system approvals and interactive questions are separate work. Rendered reset-confirmation/approval-banner behavior and real Gateway reconnect behavior remain not verified / blocked.
Why This Change Was Made
Conversation state captures the existing client's ready connection epoch at admission. The production bridge forwards it to the existing send, abort and exec-approval APIs; the transport compares it before a generation-bound socket write. Epoch-bound chat sends and aborts require an explicit session key rather than silently falling back to the Gateway's main session. Stop completion and approval dismissal are fenced against replacement runs and connection generations.
The owners stay unchanged:
ChatConversationStateowns atomic conversation mutations,OpenClawGatewayClientowns the socket write, andChatComposerControllerowns reset confirmation and revision-safe draft cleanup. The provider-test fixture now injects temporary tool, attachment, last-chat-state and aborted-message paths.Evidence
At clean head
5691fc16bb812d71966f776f936536c7512c9f60, the full build passed all five targets, Shared passed 4,666 cases with 25 ordinary skips, and Tray passed 4,508 with no failures or skips. Focused transport checks also passed Shared 22/22 and Tray 98/98: real loopback-client and production-bridge rejection of old-epoch mutations without a write to the current socket, explicit-session validation, missed-status recovery, stale Stop completion, and send/compact acceptance versus navigation.The candidate includes the separately reviewed test-isolation guard from
734aa41aa11f61c1dcca6f314196bdbc518a7e97; its seven files are byte-identical to that dependency.The dedicated independent reviewer cleared material P0-P3 source findings after the acceptance/navigation P1 correction. A separate
rubber-ducktool review found no blocking implementation/proof-plan issue. Neither review is runtime or visual proof. The shared autoreview installation was unavailable; no helper-isolation claim is made.The final required run used fresh task-owned profile roots, disabled .NET first-use certificate generation, and disabled process-local MSBuild node/server/compiler reuse. Compiled path preflight verified the owned roots. Real-profile metadata manifests before and after the complete serial build/Shared/Tray run were byte-identical (SHA256
DEDDB5E7BFD7012FD32D1DD9457AA45DC9FAF5E8B3800126B259388860E09472).Earlier unsafe default-profile test execution and separate unattributed 365-byte real-log appends were reported and excluded from safe closeout evidence. The current unchanged interval does not retroactively attribute or erase those incidents. No personal file contents or credentials are included.
Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: rendered reset-confirmation, draft and approval-banner recovery workflow. Not run; no native app launch is included in this proof.windows-wsl-gateway-e2e: connection-generation safety affects Gateway reconnect/recovery. Not run; synthetic loopback transport proof is not product Gateway recovery proof.windows-wsl-mxc: exec-approval response transport changed. Not run; no live command, MXC host or containment claim.Validation
Current required validation uses fresh isolated processes. Combined source is
5691fc16bb812d71966f776f936536c7512c9f60, clean. Missing session targets now take precedence over missing message text: the provider raisesInvalidOperationExceptionbefore optimistic admission, rather than invoking a bridge or silently selecting main..\build.ps1dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restoredotnet restore .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --verbosity quietdotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~ChatMutation|FullyQualifiedName~EpochBoundChatMutation|FullyQualifiedName~ConfirmedMutation|FullyQualifiedName~ArchitectureLedgerConsistencyTests" --verbosity quietdotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --filter "FullyQualifiedName~ChatComposerControllerTests|FullyQualifiedName~ChatConversationStateTests|FullyQualifiedName~EpochChangesWithoutStatusDelivery|FullyQualifiedName~RespondToPermission|FullyQualifiedName~StopResponse|FullyQualifiedName~ProductionBridge_RejectsOldEpoch|FullyQualifiedName~PreHandshake_RefusesMissingSession" --verbosity quiet.\scripts\validate-docs.ps1git diff --checkThe pre-fix reset-confirmation regression failed before repair. Original failures remain in local evidence, including a corrected ledger guard reference, a GitVersion pre-execution failure, the provider's corrected missing-session exception contract, a runner stage-selection defect, and the missing-assets first run before restoring the new probe dependency. None is relabeled as a passed or safely isolated attempt.
Real Behavior Proof
OpenClawGatewayClientandGatewayClientChatBridgeagainst a session-owned synthetic loopback Gateway. No shared Gateway, private provider or native app was launched.5691fc16bb812d71966f776f936536c7512c9f60, clean, full required run. Earlier focused transport source hashes match298da7fc.ProductionBridge_RejectsOldEpochBeforeWritingMutationpassed forchat.send,chat.abortandexec.approval.resolve; the server observed none of the rejected mutation methods and remained able to answer a history request.ChatMutation_RefusesCapturedEpochWithoutWritingOnCurrentSocketalso verifies pending-request cleanup and a correlated health-response barrier.Yes/No/N/A) N/A. Local logs/TRX/metadata manifests are retained; no private local path is represented as a publicly accessible proof link.Security Impact
Yes/No) No.Yes/No) No.Yes/No) Yes, existing mutation APIs now accept the caller's expected connection epoch; wire methods and payloads are unchanged.Yes/No) No new execution surface; exec-approval resolution is now bound to its original connection.Yes/No) No.Yes, explain the risk and mitigation: stale actions cannot be redirected to a replacement socket. Existing call signatures retain optional compatibility; the production chat provider always uses the epoch-bound bridge methods and explicit chat session keys. Rejected approval responses preserve their banner and request an error notification.Compatibility and Migration
Yes/No) Yes; no new Gateway method, wire field or minimum-version assumption.Yes/No) No product configuration changes.Yes/No) No.This is a maintainer-authorized branch in the upstream repository, at the user's explicit request rather than a personal fork. The fork-only maintainer-edit toggle is not applicable; repository write permissions govern edits.
Review Conversations