Skip to content

fix(chat): retain replies when transcript publication fails - #174087

Merged
roboclaw-bot merged 3 commits into
mainfrom
openclaw/aged-chat-publication-residual
Oct 16, 2026
Merged

roboclaw-bot merged 3 commits into
mainfrom
openclaw/aged-chat-publication-residual

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: a collaborator’s visible reply disappears when its saved transcript row cannot be read or published to chat.

User Impact

The reply stays visible through streaming and completion, including later updates to the same saved occurrence. Rows already published successfully do not reappear as duplicates. No configuration, schema, permission, or migration changes.

Why This Change Was Made

Current main already fixes the primary delayed-publication scrollback problem in 1f9022d2af0336ede45b249f259e820e25f0d91b. This repairs the distinct failure path in that owner rather than applying the older parallel buffering implementation.

The existing occurrence map now records whether history publication succeeded. Failed handoffs remain displayable without undoing durable commitment. A finishing reply is projected after accepted publications settle, using the same occurrence state; normal cleanup still runs immediately and cannot clear a replacement run. Terminal message formatting moves to the existing wire-projection helper. Handled rebuilding/overload failures carry the same failure outcome, and a repeated receipt that later succeeds retracts the live fallback without waiting for another model event.

Evidence

  • Clean-base reproduction failed for both streaming and terminal display loss; the raw terminal content alone incorrectly appeared complete.
  • Initial implementation: 227 compiled Gateway tests passed across subscriptions, source projection, commentary history, wire delivery, agent-event lifecycles, error kinds, and control replies. Coverage includes publication failure, a late callback carrying the durable receipt, mixed successful/failed rows, delayed publication, replacement, queued successors, shutdown, and claimed error terminals when persistence finishes before transcript publication.
  • Follow-up boundary proof: 106 compiled tests pass across the full subscription, session-broadcast, and session-recovery suites. Rebuilding/overload failures and a successful repeated receipt each failed before their owning repair. Core and affected Gateway test-graph typechecks pass; targeted lint/format and line-cap checks pass. The final simplified paths pass another 12 targeted cases.
  • Local check:max-lines-ratchet reports three pre-existing, unchanged UI suppressions missing from its baseline (chat-message.test.tsx, config-page-state.ts, sessions-page-state.ts); no suppressions or baseline exceptions were added. Both earlier CI attempts (38884768050 and 38888095087) hit session-reset teardown with competing work. Main subsequently fixed the deferred recovery fixture leak in 0fa38d641df; that concrete fix is now integrated, and the complete 74-test chat file passes. The second attempt also exposed a missed native Talk publication collector type; it now derives the handler result, as does the newly extracted marker-queue test collector. The affected Gateway type graphs and the native Talk consumer test pass. No CI rerun, weakened assertion, or baseline change was used. Final-head CI 38973325173 passed on 032b9079f2b4856d4ebc560471668938f9775a6c.
  • Integrated-main verification: 110 subscription/session-event/recovery cases passed before removing three exact duplicate cases still covered by the recovery table; 74 chat-fixture tests and the native Talk consumer test pass. Both affected Gateway test type graphs, five-file type-aware lint, formatting, and the 15-file line-cap check pass. A fresh integrated-candidate P0–P2 review is clean.
  • Independent P0–P2 reviews found claimed-error ordering, handled-reader outcomes, and successful repeated-receipt cleanup; each was addressed with owning-boundary proof, and the complete candidate received a fresh clean P0–P2 independent review. That regression uses an already-admitted, resolved persistence stand-in, not an end-to-end claimed persistence run.
  • No live production fault was injected. These are actual Control UI captures with synthetic Gateway events matching the verified before/after server wire frames (dark, 1280×860).

Before

Before: failed publication removes the visible reply

After

After: failed publication preserves the visible reply

Original report and intended behavior: @steipete in #167402. Reimplemented on current main, not the original patch.

Work sessions

@clawsweeper

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 16, 2026 10:04
@roboclaw-bot roboclaw-bot self-assigned this Oct 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: L labels Oct 16, 2026
@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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR keeps saved assistant replies visible when transcript publication fails and recalculates terminal display after pending publications settle.

Example: The saved row for “Keep this reply visible.” encounters a transcript-reader overload.

  • Before: The live reply is retired even though its saved row was not published.
  • After: The reply remains visible, while successfully published occurrences stay deduplicated.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A worthwhile, focused repair with no actionable findings; behavioral confidence rests on in-process coverage and synthetic browser captures.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored bot PR is outside the ordinary contributor proof gate; inspected screenshots demonstrate rendering with synthetic Gateway events, while failure-path coverage uses the real publication owners with injected reader failures.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A collaborator’s visible reply disappears when its committed transcript row cannot be published.
Reason: Preserving an available reply restores the existing conversation-display contract, and the collaborator-authored direction requires no additional product decision.

Merge readiness

✅ Ready for maintainer review

This PR repairs a publication-failure path still present on current main, and the previous finding is addressed; no actionable introduced defect was found.

Priority: P2
Reviewed head: 032b9079f2b4856d4ebc560471668938f9775a6c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied browser captures replay synthetic wire events rather than a shipped Gateway encountering a canonical transcript-read failure.
Agent review details

How this fits together

The Gateway combines agent text and committed transcript updates into streaming chat frames and saved-history notifications for connected clients.

flowchart TD
  A[Agent text] --> B[Chat run buffer]
  C[Committed transcript row] --> D[History publication]
  D --> E[Occurrence publication outcome]
  E --> B
  B --> F[Streaming and terminal projection]
  F --> G[Chat clients]
  D --> G
Loading

Technical review

Best possible solution:

Keep publication success in the existing occurrence owner so failed handoffs retain visible text without duplicating saved rows.

Do we have a high-confidence way to reproduce the issue?

Current-main source shows failed publication retiring visible text; the supplied regressions exercise that path, but this read-only review ran no target code.

Is this the best way to solve the issue?

The repair fits the existing publication barrier and occurrence map, preserves successful-row deduplication, and avoids a parallel buffering owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5e5ad805485b.

Provenance checked

  • Occurrence retirement and commentary deduplication keeps the original intent (af210e1: Retire exact saved assistant occurrences to prevent duplicate commentary while keeping complete terminal content.)
  • Deferred transcript publication keeps the original intent (1f9022d: Retain wire display until canonical publication settles without delaying backend cleanup.)
  • Terminal reply suppression keeps the original intent (fix(agents): honor exact NO_REPLY and drop fabricated turn-ending replies #170534: Consume the prepared terminal disposition and honor deliberate silence without fabricated assistant replies.)
  • Worker-backed transcript publication keeps the original intent (e0d8000: Publish transcript projections off the Gateway thread while retaining ordered delivery.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +60, Tests +292. Total +352 across 15 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 184 124 +60
Tests 8 342 50 +292
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 526 174 +352

Review metrics

Metric Value Why it matters
Production versus test growth Production +60 net lines; tests +292 net lines Growth adds publication outcomes and deferred terminal projection, with focused coverage for failed reads, mixed outcomes, repeated receipts, and terminal ordering.

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.

Label justifications:

  • P2: Temporary transcript-publication failures can hide an otherwise available reply, with impact limited to the affected chat handoff.
  • 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.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • For stronger confidence, capture an actual Gateway transcript-read failure through chat completion and verify that the reply remains visible.

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 (1 earlier review cycle)
  • reviewed 2026-10-16T10:21:25.671Z sha 2d8eb62 :: needs changes before merge. :: [P2] Propagate handled read failures into the publication outcome

Reviewed October 16, 2026, 6:08 PM ET / 22:08 UTC (Revision 2).

Carry temporary reader failures through the existing publication owner, and flush a recovered repeated receipt without duplicating its live fallback. Preserve intentional non-publication and bounded cleanup.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 16, 2026 10:36
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 16, 2026
@roboclaw-bot
roboclaw-bot disabled auto-merge October 16, 2026 21:55
Integrate main to resolve the extracted marker-queue test conflict and include the independently proven deferred-recovery fixture isolation repair. Preserve the publication-failure fix and one owning copy of reconciliation coverage; derive pending-publication collector types from their handler.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 16, 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 16, 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 16, 2026
@roboclaw-bot
roboclaw-bot merged commit 3d52679 into main Oct 16, 2026
150 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/aged-chat-publication-residual branch October 16, 2026 22:32
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…#174087)

* fix(chat): retain replies when transcript publication fails

Co-authored-by: steipete <[email protected]>

* fix(chat): retain handled publication failures and retries

Carry temporary reader failures through the existing publication owner, and flush a recovered repeated receipt without duplicating its live fallback. Preserve intentional non-publication and bounded cleanup.

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
steipete added a commit that referenced this pull request Oct 20, 2026
Replay real chat and session.message frames through the existing Control UI
consumers. Require a cleared live run, stream and segments, and require the
displayed assistant messages to match persisted history exactly. Preserve the
saved partial, publication, terminal failure receipt, fallback, request-count
and settled-write assertions.

The transcript publication barrier can release a terminal in place of a held
clearing delta. The previous delta-only fold missed that canonical handoff;
in-process local claim release in #178098 exposes this ordering more readily.
The publication contract itself predates the window in #174087.

Both affected real-Gateway files pass on Node and pinned Bun. Targeted test-graph
typecheck, lint and formatting pass, and independent P0-P2 review is clean.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
Replay real chat and session.message frames through the existing Control UI
consumers. Require a cleared live run, stream and segments, and require the
displayed assistant messages to match persisted history exactly. Preserve the
saved partial, publication, terminal failure receipt, fallback, request-count
and settled-write assertions.

The transcript publication barrier can release a terminal in place of a held
clearing delta. The previous delta-only fold missed that canonical handoff;
in-process local claim release in openclaw#178098 exposes this ordering more readily.
The publication contract itself predates the window in openclaw#174087.

Both affected real-Gateway files pass on Node and pinned Bun. Targeted test-graph
typecheck, lint and formatting pass, and independent P0-P2 review is clean.
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: L 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