Skip to content

fix(gateway): preserve keyed commentary in refreshed history - #188180

Merged
fuller-stack-dev merged 7 commits into
mainfrom
openclaw/tidy-langoustine
Oct 30, 2026
Merged

fuller-stack-dev merged 7 commits into
mainfrom
openclaw/tidy-langoustine

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

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_REPLY or display: false. An explicit display: true still shows it. Truly empty completed attempts are still hidden when no recovery is pending, and live empty-message behavior is unchanged from main. 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:

  • Before dropping such an attempt, the history filter asks the commentary fallback owner whether it would keep a fallback (only when commentary fallbacks are requested). Commentary does not become a final answer or satisfy pending recovery.
  • The fallback owner first applies the existing source-visibility predicate, 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:

  • An earlier revision also preserved an empty live terminal message. That part was removed to keep this PR to the commentary repair.
  • The branch merges main at d67aa608643f6583a6c6102c522043794aafe064, which includes the test(gateway): give empty-leaf admission a visible reply #188156 admission fixture. This PR does not copy or change that fixture.
  • This revision addresses the P2 finding from the hosted review of 6b36dcf: commentary from a source whose final answer was exactly NO_REPLY leaked as a visible fallback.

Evidence

  • Red on main at d67aa608: keyed commentary from both stop and length attempts is lost from history, and the existing runtime-loss WebSocket case in server.chat-abort-dispatch-rejection.test.ts fails at its missing-commentary assertion.
  • Silence leak reproduced on the previous head 6b36dcf: keyed commentary followed by an exact final NO_REPLY produced a visible "Running it now." fallback for both stop and length attempts, while the explicit display controls passed.
  • New regression table: stop and length attempts with display omitted, false and true. Each of the 6 cases asserts the exact projected result with and without pending recovery.
  • Independent targeted QA of this revision:
    • The committed owner test file passed 62/62 (259 assertions).
    • As a negative control, the previous head's unchanged commentary module was loaded whole at its original import path. That run had 60 passes and 2 failures; both failures are the display-omitted cases leaking "Running it now.", and the 4 explicit-display cases passed.
    • Limit: each failing case stops at its first assertion (no pending recovery), so a red result with pending recovery was not observed separately.
    • No core, sanitizer or policy code was mocked.
  • Author's local runs on this revision:
    • The 10 focused projection/history/media/privacy consumer files: 147 passed, 2 existing separate-reasoning visibility cases failing identically on main.
    • The full WebSocket lifecycle suite: 9/9, including the original runtime-loss history case.
    • The 134/134 admission/terminal suite result in chat.directive-tags.test.ts is reused from source 8c5a71f and was not rerun for this revision.
  • Focused lint, format, 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 on main: TS2353 at packages/ai/src/transports/openai-responses-websocket.ts:245. These inherited failures are recorded here, not waived or changed.
  • Whole touched-test-file audit: no new mocks and no removed or relaxed assertions, timeouts or baselines. Net change versus main: 11 production lines and 54 test lines. This revision alone adds 1 production line and 36 test lines.
  • Independent local reviews, each scoped-clean with zero P0–P2 findings:
    • This revision's change (6b36dcf to f9d5eab), 1 pass. It was source-only and did not assess runtime, build or CI behavior.
    • The narrowing revision, 1 pass.
    • The original change, 5 passes.
    • These are separate scoped reviews, not one whole-head approval.
  • Local proof ran on macOS arm64 only. Hosted results on this head (975ba97):
    • The hosted ClawSweeper review is ready for maintainer review with no findings and nothing listed before merge.
    • CI run 41033654416 passed, including openclaw/ci-gate, security-fast and all Security High checks.
    • The Linux changed-tests job ran chat-display-projection.test.ts 62/62, including all 6 silence cases.
    • Not covered: no standalone shipped-Gateway refresh capture was run, and hosted runs of the WebSocket lifecycle and admission suites were not confirmed in the changed-tests jobs.

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.

@clawsweeper

clawsweeper Bot commented Oct 30, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserve 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.

  • Before: Refreshed history drops the commentary and shows only the failure notice.
  • After: History retains the commentary alongside the failure notice, unless its source is silent.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch resolves the prior finding and has meaningful reported harness coverage; direct current-head product evidence remains limited.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied evidence reports projection regressions and WebSocket lifecycle coverage, while the inspected historical attachment screenshots do not demonstrate this change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Progress visible during an attempt disappears from refreshed history after a runtime failure.
Reason: The maintainer-authored direction restores an existing commentary contract through a focused change without new settings or persistence.

Regression provenance

Regression provenance — verified: source commit 02b978b78caa by Dallin Romney; canonical PR #188111 (blame-to-merge-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
Reviewed head: 975ba9775ef10686b3af0460bb01808d54ba893d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No current-head shipped-Gateway refresh demonstration is supplied; the reported WebSocket lifecycle suite provides in-process supporting proof.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Completed-attempt filtering changes intended behavior with a stated reason (02b978b: Suppress invisible completed attempts while retaining pending-recovery semantics.)
  • Commentary fallback extraction keeps the original intent (1be9b80: Preserve eligible keyed progress and prepared attachments through history projection while hiding plain unkeyed commentary.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 1be9b80 adds src/gateway/chat-display-projection.commentary.ts:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1be9b8013411; files: src/gateway/chat-display-projection.commentary.ts)
  • Dallin Romney: Raw commit 02b978b adds src/gateway/chat-display-projection.core.ts:397 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 02b978b78caa; files: src/gateway/chat-display-projection.core.ts)

PR surface

Source +11, Tests +54. Total +65 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 13 2 +11
Tests 1 66 12 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 79 14 +65

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The repair restores omitted progress in refreshed history; canonical transcript loss or a broader runtime outage is not established.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-30T08:31:15.338Z sha 018b305 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-30T08:59:59.060Z sha 6b36dcf :: needs changes before merge. :: [P2] Preserve final silence before retaining commentary fallbacks

Reviewed October 30, 2026, 5:34 AM ET / 09:34 UTC (Revision 3).

@fuller-stack-dev fuller-stack-dev changed the title fix(gateway): retain commentary and empty live terminal messages fix(gateway): preserve keyed commentary in refreshed history Oct 30, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 68fbe4a into main Oct 30, 2026
148 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the openclaw/tidy-langoustine branch October 30, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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.

1 participant