Repository navigation
fix(gateway): preserve keyed commentary in refreshed history - #188180
Conversation
OpenClaw-Publication: 89289683-fd8e-4765-b120-866a22270c1e
|
🦞👀 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. |
…/shared-projection-prereq-586f
|
Codex review: needs maintainer review before merge. What this changesPreserve eligible keyed progress commentary in refreshed history while honoring source silence and retaining empty-attempt filtering. Example: A completed attempt records keyed commentary “Running it now.” before the run fails.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review This maintainer-authored PR repairs a current-main commentary regression and resolves the prior silence finding; no new actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway projects stored transcript rows into client-visible history, separating progress commentary from final answers and failure-recovery matching. flowchart LR
A[Stored transcript] --> B[Recovery projection]
B --> C[Commentary fallback owner]
C --> D[History sanitization]
D --> E[History RPC]
E --> F[Control UI]
Technical reviewBest possible solution: Retain eligible commentary through its existing projection owner while preserving source silence, empty-attempt suppression, and independent recovery matching. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically removes completed commentary-only rows before fallback extraction; existing projection and WebSocket fixtures exercise this path, but this read-only review executed no tests. Is this the best way to solve the issue? This is a small repair using existing owners: eligibility comes from the commentary projector, source silence comes from the shared predicate, and commentary never becomes a final answer that settles recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 89734994c6c9. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +11, Tests +54. Total +65 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
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 HistoryReviewed October 30, 2026, 5:34 AM ET / 09:34 UTC (Revision 3). |
OpenClaw-Publication: 90873adc-5dee-4f70-bb14-104f90c68112
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
OpenClaw-Publication: 6811ae4c-1194-4be1-afce-d8d9c8a369fc
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Related: #187924
Follow-up to #188111
What Problem This Solves
Fixes: since #188111, progress commentary from a completed attempt disappears from refreshed chat history when the run then ends in a runtime failure.
User Impact
Refreshed history keeps eligible progress commentary alongside the canonical failure notice. Commentary stays hidden when its source message is silent: an exact final
NO_REPLYordisplay: false. An explicitdisplay: truestill shows it. Truly empty completed attempts are still hidden when no recovery is pending, and live empty-message behavior is unchanged frommain. No migration or configuration change is required.Why This Change Was Made
#188111 drops completed stop/length attempts with no visible content before the existing commentary fallback projector runs, so keyed commentary that projector would keep is removed first. The fix stays in the existing owners:
isSilentAssistantTranscriptMessage, and extracts nothing from a silent source. The history filter's eligibility check and the sanitizer's extraction both go through this owner, so the same decision applies on both paths, with or without pending recovery. No new silence or token rules are added.Main's empty-history, pending-recovery and live empty-message behavior is unchanged, as are recovery matching, error sanitization and the reasoning visibility predicate.
Revision notes:
mainatd67aa608643f6583a6c6102c522043794aafe064, which includes the test(gateway): give empty-leaf admission a visible reply #188156 admission fixture. This PR does not copy or change that fixture.6b36dcf: commentary from a source whose final answer was exactlyNO_REPLYleaked as a visible fallback.Evidence
mainatd67aa608: keyed commentary from both stop and length attempts is lost from history, and the existing runtime-loss WebSocket case inserver.chat-abort-dispatch-rejection.test.tsfails at its missing-commentary assertion.6b36dcf: keyed commentary followed by an exact finalNO_REPLYproduced a visible "Running it now." fallback for both stop and length attempts, while the explicitdisplaycontrols passed.displayomitted,falseandtrue. Each of the 6 cases asserts the exact projected result with and without pending recovery.display-omitted cases leaking "Running it now.", and the 4 explicit-displaycases passed.main.chat.directive-tags.test.tsis reused from source8c5a71fand was not rerun for this revision.git diff --check, normal pre-commit hooks, and the test-line, mock-export and timeout ratchets pass, with no budget changes. Focused prod/test typechecks report one diagnostic that is identical onmain: TS2353 atpackages/ai/src/transports/openai-responses-websocket.ts:245. These inherited failures are recorded here, not waived or changed.main: 11 production lines and 54 test lines. This revision alone adds 1 production line and 36 test lines.6b36dcftof9d5eab), 1 pass. It was source-only and did not assess runtime, build or CI behavior.975ba97):openclaw/ci-gate,security-fastand all Security High checks.chat-display-projection.test.ts62/62, including all 6 silence cases.Related Work
#188203 overlaps this PR at the commentary boundary. The broader reasoning-retention and cache/snapshot work tracked in #188181 is outside this PR; this change does not replace or complete that work.