Repository navigation
fix(gateway): preserve recorded replies when chat completion settles - #147656
Conversation
|
🦞👀 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 September 13, 2026, 10:10 PM ET / September 14, 2026, 02:10 UTC (Revision 3). ClawSweeper reviewWhat this changesPreserves recorded replies, receipts, and canonical failure outcomes when a chat-scoped completion wait finishes, with regression coverage for event ordering. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main and v2026.9.4. No introduced correctness defect was found; the patch preserves the delivery barrier while reusing existing outcome and reply precedence. Priority: P2 Review scores
Verification
How this fits togetherGateway completion tracking combines runtime lifecycle events with chat delivery completion. Clients use agent.wait to retrieve the completed run’s outcome and recorded reply. flowchart TD
A[Client waits for run] --> B[Gateway completion tracker]
C[Runtime outcome and reply] --> B
D[Chat delivery completion] --> E{Chat barrier complete?}
E -->|No| F[Continue waiting]
E -->|Yes| B
B --> G[Canonical outcome and recorded reply]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +6, Tests +104. Total +110 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep chat delivery as the readiness barrier and derive its final response from the existing canonical run outcome and reply owners. Do we have a high-confidence way to reproduce the issue? Yes, from source: record lifecycle reply evidence, then complete chat delivery while a chat-scoped wait is active; current main returns the chat snapshot without that evidence. No runtime reproduction was executed here. Is this the best way to solve the issue? Yes. The patch repairs the existing projection through its canonical merge owner without adding a second reply store, history inference, or configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1b2bf44220e6. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
…penclaw#147656) * test(gateway): reproduce missing chat completion replies * fix(gateway): retain canonical replies after chat completion
What Problem This Solves
Fixes: a chat-scoped
agent.waitloses the run's recorded reply and receipt, and can report success after an authoritative timeout or cancellation.User Impact
A completed chat wait returns the same recorded reply and canonical outcome as the run owner, while still waiting for chat delivery to finish. Silent or empty replies remain intentional outcomes; no transcript-history guessing is added.
Why This Change Was Made
Require the selected chat completion before merging its same-run lifecycle observation through the existing terminal outcome and reply owners. A separate agent request with the same identifier cannot satisfy or contaminate that chat wait.
This repairs the Gateway completion contract used by public Ask OpenClaw App Intents: #147668.
Evidence
23ba71221f6478d15603039e80c4120c1e560a0breproduced exactly eight intended failures in CI attempt 1, with 4,367 tests passing and five skipped in that shard.6664cc5passed all 16 settlement cases in Gateway core1, including the original eight failures, and all 19 dedupe siblings in Gateway core2.6e054798584e5e9d6b9014c12b18da147dbdd494composes main3cfc0ade66c68092051ec372632bf6d71611e8e2, including the canonical QA fixture repair from fix(ci): tooling shard fails on QA Profile Evidence routing after #143968 #147293. The two-file wait patch payload is unchanged; independent integration review and diff checks passed. Main adds one settlement test, so this head has 17 cases.6e054798584e5e9d6b9014c12b18da147dbdd494: 119 jobs succeeded, 17 were intentionally out of scope, and none failed. The tested merge commit was0627265442a6268aee112c3a19c0d51f6587b44e, with that exact head as a parent.Release-validation follow-up: the SDK API diff snapshot worker exhausted its 6 GiB heap in both test-only control and repaired-head manual CI. The report scripts are outside this repair; normal PR CI intentionally does not run that release-only report. This stack does not claim to fix the heap failure.