Skip to content

fix(gateway): preserve legacy reseed attachments#99839

Merged
vincentkoc merged 1 commit into
mainfrom
fix/99653-legacy-mixed-content
Jul 4, 2026
Merged

fix(gateway): preserve legacy reseed attachments#99839
vincentkoc merged 1 commit into
mainfrom
fix/99653-legacy-mixed-content

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Follow-up to #99653.

What Problem This Solves

Legacy Claude CLI reseed rows can contain an empty <next_user_message> text block alongside an image, document, or other native user content. The importer returned null for the whole row, hiding those sibling blocks from visible OpenClaw history.

Why This Change Was Made

The importer now applies one invariant to receipt-backed and legacy reseed rows: remove only the proven synthetic text block, and drop the row only when no content remains.

Scalar and single-text-block empty reseeds keep their existing suppression behavior. Mixed native content preserves sibling order and bytes.

User Impact

Image-only and attachment-bearing legacy Claude turns remain visible after reseed import instead of disappearing with the empty synthetic wrapper.

Evidence

@vincentkoc vincentkoc self-assigned this Jul 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Jul 4, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 4, 2026 06:09
@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 2:18 AM ET / 06:18 UTC.

Summary
The branch updates the Claude CLI history importer and tests so empty legacy reseed text blocks are removed without dropping sibling native content, while scalar and single-text empty reseeds stay suppressed.

PR surface: Source +13, Tests +54. Total +67 across 2 files.

Reproducibility: yes. at source level: current main returns null for an empty legacy reseed before preserving array siblings, and the PR head adds the mixed native-content fixture. I did not run tests because this review is read-only.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: src/gateway/cli-session-history.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] A routine CI shard was still pending at review time, so merge should wait for normal required-check completion; this is not a code finding.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused importer and regression-test fix after normal maintainer review and required checks, keeping broader Claude placeholder filtering separate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; this protected maintainer PR has no blocking findings and should proceed through normal maintainer review and merge gates.

Security
Cleared: The diff only changes local Claude CLI JSONL import logic and tests; it does not alter dependencies, workflows, secrets handling, install scripts, or package resolution.

Review details

Best possible solution:

Land the focused importer and regression-test fix after normal maintainer review and required checks, keeping broader Claude placeholder filtering separate.

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

Yes, at source level: current main returns null for an empty legacy reseed before preserving array siblings, and the PR head adds the mixed native-content fixture. I did not run tests because this review is read-only.

Is this the best way to solve the issue?

Yes. The branch keeps the repair inside the Claude CLI importer, shares the remove-block invariant with receipt-backed rows, and preserves existing suppression behavior for scalar and single-text empty reseeds.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d71a24f3a4b7.

Label changes

Label justifications:

  • P2: This is a normal-priority gateway history bug fix with limited blast radius and focused regression coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this same-repo maintainer-labeled PR; the body still reports focused tests, static checks, and Testbox changed-check proof.
Evidence reviewed

PR surface:

Source +13, Tests +54. Total +67 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 19 6 +13
Tests 1 54 0 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 73 6 +67

What I checked:

Likely related people:

  • ZOOWH: git blame and git log show the receipt-backed and legacy reseed importer branch came from the merged synthetic Claude reseed prompt fix. (role: introduced current reseed importer behavior; confidence: high; commits: 9aa4250c58ad; files: src/gateway/cli-session-history.claude.ts, src/gateway/cli-session-history.test.ts, src/config/sessions/cli-session-binding.ts)
  • vincentkoc: Live PR metadata for the parent fix shows Vincent provided land-ready proof and merged the broader reseed fix, and this follow-up is in the same gateway history area. (role: recent reviewer, merger, and follow-up owner; confidence: medium; commits: 9aa4250c58ad, a2a70206d0c9; files: src/gateway/cli-session-history.claude.ts, src/gateway/cli-session-history.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready proof for head a2a70206d0c9eb60f176ce5c738f0ce7a16fc445:

The repair removes only the empty synthetic legacy reseed text block, preserves sibling native content in order, and retains existing suppression for scalar or single-block empty rows. No known proof gaps remain for this two-file surface.

@vincentkoc
vincentkoc merged commit cafbd74 into main Jul 4, 2026
190 of 197 checks passed
@vincentkoc
vincentkoc deleted the fix/99653-legacy-mixed-content branch July 4, 2026 06:24
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

1 similar comment
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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