Skip to content

fix(gateway): stop Claude CLI image replies from repeating narration - #188333

Merged
obviyus merged 2 commits into
openclaw:mainfrom
holgergruenhagen:fix/cli-history-covered-aggregate-media
Oct 30, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
holgergruenhagen:fix/cli-history-covered-aggregate-media

Conversation

@holgergruenhagen

@holgergruenhagen holgergruenhagen commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Completed native Claude CLI replies with MEDIA images repeat earlier narration in reloaded webchat. The keyed final row contains only the final native message, but media enrichment adds the run's combined narration/final caption back to that row.

This focused new-turn display bug follows #184098. Related broader issue #123792 also tracks historical duplicates; this PR does not claim to repair or close those separate cases.

Solution

Consume the already-delivered aggregate caption when a native-identity row's own authored text is its line-delimited suffix. Preserve original message/model content and existing authored media placement. No prompt/model-facing text, SDK, config or feature additions. Credit @holgergruenhagen.

Evidence

Independent built Gateway + built Control UI, real native Claude Code and Chromium, inspected before/after screenshots.

Main twice shows narration twice in both actual chat.history and reloaded UI for image replies; candidate twice shows it once with one decoded image. Text-only narration/tool/final controls remain once on both. Eight successful actual native turns used real ToolSearch/read through a trusted-CA HTTPS CONNECT fixture and synthetic task-only managed profile; no real provider credentials or outside inference, and no fabricated Gateway/history messages.

Final SQLite owner regression17/17 passes; frozen main3 intended failures/14 passes. Formatting passes. Reused existing signed-caption/media/replay matrix: tests+3/-3 net0; production+15/-6. Original-content immutability assertions remain.

Merge risk

Two-way door: revert restores former display captions, no migration. Blast radius native-identity webchat media final-row display only; original model content, channels' delivered text and historical storage remain unchanged.

Since openclaw#184098 the keyed Claude CLI row holds only the final native message
and narration comes from the native rows. Webchat media enrichment still
rewrote that row's display with the delivered caption, which joins every
narration block of the run, so replies with MEDIA showed their narration
twice in chat history.

A row that mirrors one native message now consumes a delivered caption
that ends with its own text, and keeps only that text around its media.

Refs openclaw#123792
@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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Oct 30, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR prevents media enrichment from copying earlier Claude CLI narration into the final answer’s display row.

Example: A Claude CLI turn says “NARRATION_image_1: checking notes.” before returning “FINAL_image_1: here is the result.” with an image.

  • Before: Reloaded chat shows the narration twice, followed by the final answer and image.
  • After: Reloaded chat shows the narration once and retains the final answer and image.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong runtime proof and a focused, correct patch; overall C reflects partial coverage of the broader linked history-duplication issue.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected screenshots and the collaborator’s recorded built Gateway/UI scenario exercise actual chat.send, native Claude tool execution, chat.history and browser reload on baseline and candidate; narration changes from two copies to one with the image retained, and text-only controls remain unchanged.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Completed Claude CLI image replies repeat earlier narration after chat history is reloaded.
Reason: The scoped new-turn defect is fully addressed with a narrow repair, while the related broader issue also includes historical duplicates that this PR explicitly leaves open.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a verified native-Claude media display bug that remains on current main, with convincing runtime proof and no actionable findings.

Priority: P2
Reviewed head: 9d165078b8f45d882919952bab0e3ecf9b4c0e7e

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway combines prepared delivery captions and managed media with canonical assistant transcript rows, then exposes their display projection through chat history to clients.

flowchart LR
  A[Native Claude messages] --> B[Canonical final row]
  C[Prepared caption and media] --> D[Gateway display rewrite]
  B --> D
  D --> E[Transcript display projection]
  E --> F[Chat history and Control UI]
Loading

Technical review

Best possible solution:

Use the existing display-rewrite owner to consume the aggregate caption for native final rows while preserving authored text, media placement and original transcript content.

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

Supplied built-product evidence reproduces the image-only duplication on frozen main and removes it on the reviewed candidate; source inspection confirms current main retains the responsible comparison.

Is this the best way to solve the issue?

The patch is the smallest complete repair for the scoped new-turn bug: it extends existing caption consumption using the established native-row identity and preserves the original media-placement mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1054918a3a8c.

Provenance checked

  • Aggregate caption consumption and authored media placement keeps the original intent (8c3cd75: Keep each prepared image beside its authored heading, consume combined captions once and preserve original model content.)
  • Consolidated transcript enrichment regression matrix keeps the original intent (65e9aca: Consolidate owner-level persistence and lifecycle proof while retaining distinct observable contracts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 1be9b80 adds src/gateway/server-methods/chat-transcript-persistence.ts:145 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/server-methods/chat-transcript-persistence.ts)
  • RoboClaw: Raw commit 8c3cd75 adds src/gateway/server-methods/chat-transcript-persistence.ts:165 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8c3cd75842a8; files: src/gateway/server-methods/chat-transcript-persistence.ts)

PR surface

Source +9, Tests 0. Total +9 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 15 6 +9
Tests 1 3 3 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 18 9 +9

Review metrics

Metric Value Why it matters
Production versus test LOC Production +15/-6; tests +3/-3 The focused owner change reuses the existing persistence matrix without adding test scaffolding or another implementation path.

Root-cause cluster

Relationship: partial_overlap
Canonical: #123792
Summary: This PR repairs new native-Claude media enrichment within the broader duplicate-history report; historical aggregates remain separate work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Repeated narration impairs completed image-reply readability but does not prevent delivery or remove the image.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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-30T12:54:11.786Z sha 2b60bbf :: needs maintainer review before merge. :: none

Reviewed October 30, 2026, 9:45 AM ET / 13:45 UTC (Revision 2).

@obviyus

obviyus commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Independent shipped-entry-point reproduction and repair proof

Scoped bug: new completed native-Claude image replies repeat earlier narration during the existing webchat display rewrite. This is not a new narration feature or a historical-transcript cleanup. Production changes only display-caption consumption; original model-facing content, prompts, SDK, config and runtime execution contracts are untouched.

Frozen main 1891469e2bf5bf68f2de45c2683bfa59ad200448; candidate 9d165078b8f45d882919952bab0e3ecf9b4c0e7e (production identical to contributor 2b60bbfa1eb789dbd26a5170537a836e1cb5cd77; only test consolidation follows). Both Gateway and normal build-ID-aligned Control UI built in secretless node:24.22.1 Docker. Real installed Claude Code executes through the normal Gateway CLI backend. Its official HTTPS endpoint is routed by a task-local CONNECT proxy to a deterministic Messages fixture with a trusted test CA, as in #188069/#176154. Synthetic managed profile only; no real key, login, host credentials or external inference. Container bridge disconnected during proof. Native transcripts use the ordinary task HOME/.claude so the shipped history reader discovers the actual files.

Actual chat.send → real native ToolSearch → real mcp__openclaw__read of task-owned notes → final reply, with/without MEDIA image. Provider receipts confirm actual tool results. Real chat.history and Chromium reload of shipped sidebar session URLs expose every native row. No transcript seeding, injected chat events, mocked Gateway/WebSocket or private rewrite invocation as runtime proof.

Case, twice on each snapshot Main history/UI narration count Candidate history/UI narration count Images
Narration + tool + final + MEDIA 2 / 2 1 / 1 1 on both
Same narration/tool with text-only final 1 / 1 1 / 1 0 on both

All eight native turns completed successfully. Both snapshots retain four assistant rows per turn (including native tool/discovery rows), original narration, final answer and attachment ordering; candidate removes only the copied narration from the final row's display. The image fixture is a decoded1×1 white PNG, displayed as the ordinary attachment tile; no claim of complex image fidelity.

Inspected native Chromium before/after screenshots base-image-1.png and candidate-image-1.png show duplicated narration versus one narration with final/image retained. Repetition2 and text controls retained. Raw history, browser counts, authentic native transcript example, HTTPS request/connect receipts and harnesses retained locally.

Focused SQLite transcript owner suite: final regression17/17 pass; same consolidated cases on frozen main3 intended failures/14 pass, exposing retained duplicate caption. Formatting passes. Whole PR production+15/-6; tests+3/-3 net0. Reused signed-caption/media-order/replay matrix instead of67 new fixture lines; original-content immutability and lifecycle/authorization controls remain. No new test files or SDK exports.

Two-way door: revert restores former display rewriting without migration. Blast radius native-identity webchat media final-row display only. Historical already-written duplicates and unrelated live-stream issues remain outside this focused bug fix; this PR does not claim to close the broader #123792. Credit @holgergruenhagen. Earlier setup attempts lacked canonical native-history discovery or the approved CONNECT credential route and are not presented as product verdicts.

Main repeats native narration above final image reply

Candidate shows native narration once and retains image

@obviyus

obviyus commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

@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. 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
@obviyus
obviyus merged commit 41e20da into openclaw:main Oct 30, 2026
128 of 129 checks passed
@obviyus

obviyus commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Landed in 41e20da. Thanks @holgergruenhagen. CLI narration no longer repeats in image replies in chat history.

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

fix(cli): don't repeat CLI narration in the image reply of chat history

Related: openclaw#123792 (this fixes new turns; duplicates already stored in old history are not changed).

When a CLI-backend turn (for example Claude Code) narrated, used a tool and then replied with an image, media enrichment copied the aggregate caption into the final image message. The earlier narration therefore showed twice in chat history and the Control UI. The final image message now keeps only its own text. Display only: the original model content, prompts and config are unchanged.

Evidence: built Gateway and Control UI, real Claude Code through a trusted-CA HTTPS CONNECT fixture with a synthetic managed profile, real tool execution and a Chromium reload. In the narration, read and image-reply case, main showed the narration twice and this change showed it once, twice per ref, with one image on both. A text-only turn showed one narration on both refs. chat.history and the UI agreed. Details and screenshots: openclaw#188333 (comment).

Thanks @holgergruenhagen.

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit to Marvinthebored/openclaw that referenced this pull request Nov 25, 2026
Delivered caption blocks carry no MEDIA lines on the real path, so only the appended usage footer stops the openclaw#188333 suffix match. Keep the footer-aware match and footer retention in a small caption helper, drop the delivered-side MEDIA re-normalization, fold the regression into the openclaw#188333 enrichment test, and remove the test-lines allocation.
obviyus added a commit that referenced this pull request Nov 25, 2026
…d images (#195959)

Root cause: `src/gateway/server-methods/chat-transcript-persistence.ts:180` compares each delivered text block with the authored caption after only `sanitizeAssistantDisplayText`. When `messages.responseUsage` is on, delivery appends the usage footer to that block, so neither the exact match nor the #188333 native-mirror suffix match fires. The final image row keeps the narration-prefixed aggregate as its display text.

Closes #195857

## What Problem This Solves

In the Control UI, a claude-cli reply that narrates, runs tools and then sends images with `MEDIA:` lines repeated the narration at the top of the image reply. This happened when the usage footer (`messages.responseUsage`) was on. #188333 fixed the same duplication without the footer.

## What changes

- A claude-cli image reply with the usage footer on now shows the narration once, in its own native rows. The reply bubble shows the caption, the footer and the images.
- The caption match ignores this payload's exact `responseUsageLine` at the end of the delivered block. When it consumed the footer, it adds the footer back under the rebuilt caption.
- Replies without a footer, replies without images and non-claude-cli runtimes are unchanged (proof below).

## Adoption note

Thanks @Marvinthebored for the report and the fix. Your four commits are kept as they were. On top of them, one commit reduces the change to what the real case needs:

- Delivered blocks carry no `MEDIA:` lines on this path, so the extra `MEDIA:` normalization of delivered blocks is gone. Only the footer stopped the match.
- The fenced-`MEDIA:` and authored-footer cases are gone; they have no observed occurrence.
- The regression is now one usage row in the existing #188333 enrichment test. The 40-line table test and `config/test-lines-allocations/195857-native-media-captions.txt` are removed.
- The helper stays in `chat-assistant-caption.ts`, because `chat-transcript-persistence.ts` is at its 700-line cap.

Production +67 -11 against the merge base (the head before was +74 -13). Tests +17 -7.

## Evidence

The built Gateway and Control UI ran in a secretless Docker container, with real Chromium driving the chat composer. A stand-in `claude` emits Claude Code 2.1.330 stream-json: narration, Bash, narration, Bash, then a caption with 1 or 4 `MEDIA:` images. `messages.responseUsage=full`. Main ran twice and this PR ran twice. Each run covered three controls: no footer, no images, and the embedded runtime. Results are in the proof comment, which is linked below.

Regression: the new usage row fails with the base `chat-transcript-persistence.ts` (1 failed, 17 passed) and passes on this head.

Proof comment (table and screenshots): #195959 (comment)

Co-authored-by: phone-build <phone-build@localhost>
Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
…d images (openclaw#195959)

Root cause: `src/gateway/server-methods/chat-transcript-persistence.ts:180` compares each delivered text block with the authored caption after only `sanitizeAssistantDisplayText`. When `messages.responseUsage` is on, delivery appends the usage footer to that block, so neither the exact match nor the openclaw#188333 native-mirror suffix match fires. The final image row keeps the narration-prefixed aggregate as its display text.

Closes openclaw#195857

## What Problem This Solves

In the Control UI, a claude-cli reply that narrates, runs tools and then sends images with `MEDIA:` lines repeated the narration at the top of the image reply. This happened when the usage footer (`messages.responseUsage`) was on. openclaw#188333 fixed the same duplication without the footer.

## What changes

- A claude-cli image reply with the usage footer on now shows the narration once, in its own native rows. The reply bubble shows the caption, the footer and the images.
- The caption match ignores this payload's exact `responseUsageLine` at the end of the delivered block. When it consumed the footer, it adds the footer back under the rebuilt caption.
- Replies without a footer, replies without images and non-claude-cli runtimes are unchanged (proof below).

## Adoption note

Thanks @Marvinthebored for the report and the fix. Your four commits are kept as they were. On top of them, one commit reduces the change to what the real case needs:

- Delivered blocks carry no `MEDIA:` lines on this path, so the extra `MEDIA:` normalization of delivered blocks is gone. Only the footer stopped the match.
- The fenced-`MEDIA:` and authored-footer cases are gone; they have no observed occurrence.
- The regression is now one usage row in the existing openclaw#188333 enrichment test. The 40-line table test and `config/test-lines-allocations/195857-native-media-captions.txt` are removed.
- The helper stays in `chat-assistant-caption.ts`, because `chat-transcript-persistence.ts` is at its 700-line cap.

Production +67 -11 against the merge base (the head before was +74 -13). Tests +17 -7.

## Evidence

The built Gateway and Control UI ran in a secretless Docker container, with real Chromium driving the chat composer. A stand-in `claude` emits Claude Code 2.1.330 stream-json: narration, Bash, narration, Bash, then a caption with 1 or 4 `MEDIA:` images. `messages.responseUsage=full`. Main ran twice and this PR ran twice. Each run covered three controls: no footer, no images, and the embedded runtime. Results are in the proof comment, which is linked below.

Regression: the new usage row fails with the base `chat-transcript-persistence.ts` (1 failed, 17 passed) and passes on this head.

Proof comment (table and screenshots): openclaw#195959 (comment)

Co-authored-by: phone-build <phone-build@localhost>
Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…d images (#195959)

Root cause: `src/gateway/server-methods/chat-transcript-persistence.ts:180` compares each delivered text block with the authored caption after only `sanitizeAssistantDisplayText`. When `messages.responseUsage` is on, delivery appends the usage footer to that block, so neither the exact match nor the #188333 native-mirror suffix match fires. The final image row keeps the narration-prefixed aggregate as its display text.

Closes #195857

## What Problem This Solves

In the Control UI, a claude-cli reply that narrates, runs tools and then sends images with `MEDIA:` lines repeated the narration at the top of the image reply. This happened when the usage footer (`messages.responseUsage`) was on. #188333 fixed the same duplication without the footer.

## What changes

- A claude-cli image reply with the usage footer on now shows the narration once, in its own native rows. The reply bubble shows the caption, the footer and the images.
- The caption match ignores this payload's exact `responseUsageLine` at the end of the delivered block. When it consumed the footer, it adds the footer back under the rebuilt caption.
- Replies without a footer, replies without images and non-claude-cli runtimes are unchanged (proof below).

## Adoption note

Thanks @Marvinthebored for the report and the fix. Your four commits are kept as they were. On top of them, one commit reduces the change to what the real case needs:

- Delivered blocks carry no `MEDIA:` lines on this path, so the extra `MEDIA:` normalization of delivered blocks is gone. Only the footer stopped the match.
- The fenced-`MEDIA:` and authored-footer cases are gone; they have no observed occurrence.
- The regression is now one usage row in the existing #188333 enrichment test. The 40-line table test and `config/test-lines-allocations/195857-native-media-captions.txt` are removed.
- The helper stays in `chat-assistant-caption.ts`, because `chat-transcript-persistence.ts` is at its 700-line cap.

Production +67 -11 against the merge base (the head before was +74 -13). Tests +17 -7.

## Evidence

The built Gateway and Control UI ran in a secretless Docker container, with real Chromium driving the chat composer. A stand-in `claude` emits Claude Code 2.1.330 stream-json: narration, Bash, narration, Bash, then a caption with 1 or 4 `MEDIA:` images. `messages.responseUsage=full`. Main ran twice and this PR ran twice. Each run covered three controls: no footer, no images, and the embedded runtime. Results are in the proof comment, which is linked below.

Regression: the new usage row fails with the base `chat-transcript-persistence.ts` (1 failed, 17 passed) and passes on this head.

Proof comment (table and screenshots): #195959 (comment)

Co-authored-by: phone-build <phone-build@localhost>
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 935d07d)
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…d images (#195959)

Root cause: `src/gateway/server-methods/chat-transcript-persistence.ts:180` compares each delivered text block with the authored caption after only `sanitizeAssistantDisplayText`. When `messages.responseUsage` is on, delivery appends the usage footer to that block, so neither the exact match nor the #188333 native-mirror suffix match fires. The final image row keeps the narration-prefixed aggregate as its display text.

Closes #195857

## What Problem This Solves

In the Control UI, a claude-cli reply that narrates, runs tools and then sends images with `MEDIA:` lines repeated the narration at the top of the image reply. This happened when the usage footer (`messages.responseUsage`) was on. #188333 fixed the same duplication without the footer.

## What changes

- A claude-cli image reply with the usage footer on now shows the narration once, in its own native rows. The reply bubble shows the caption, the footer and the images.
- The caption match ignores this payload's exact `responseUsageLine` at the end of the delivered block. When it consumed the footer, it adds the footer back under the rebuilt caption.
- Replies without a footer, replies without images and non-claude-cli runtimes are unchanged (proof below).

## Adoption note

Thanks @Marvinthebored for the report and the fix. Your four commits are kept as they were. On top of them, one commit reduces the change to what the real case needs:

- Delivered blocks carry no `MEDIA:` lines on this path, so the extra `MEDIA:` normalization of delivered blocks is gone. Only the footer stopped the match.
- The fenced-`MEDIA:` and authored-footer cases are gone; they have no observed occurrence.
- The regression is now one usage row in the existing #188333 enrichment test. The 40-line table test and `config/test-lines-allocations/195857-native-media-captions.txt` are removed.
- The helper stays in `chat-assistant-caption.ts`, because `chat-transcript-persistence.ts` is at its 700-line cap.

Production +67 -11 against the merge base (the head before was +74 -13). Tests +17 -7.

## Evidence

The built Gateway and Control UI ran in a secretless Docker container, with real Chromium driving the chat composer. A stand-in `claude` emits Claude Code 2.1.330 stream-json: narration, Bash, narration, Bash, then a caption with 1 or 4 `MEDIA:` images. `messages.responseUsage=full`. Main ran twice and this PR ran twice. Each run covered three controls: no footer, no images, and the embedded runtime. Results are in the proof comment, which is linked below.

Regression: the new usage row fails with the base `chat-transcript-persistence.ts` (1 failed, 17 passed) and passes on this head.

Proof comment (table and screenshots): #195959 (comment)

Co-authored-by: phone-build <phone-build@localhost>
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 935d07d)

Companion audit: No later follow-up found. Match only against the unformatted caption while retaining stable dispatch/persistence ownership.

Release adaptation: Carry usage metadata through existing dispatch and enrichment; leave delivered text and replay IDs untouched.

Co-authored-by: RomneyDa <[email protected]>
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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.

2 participants