Skip to content

fix(gateway): hide CLI reseed wrappers in history#99651

Closed
lin-hongkuan wants to merge 1 commit into
openclaw:mainfrom
lin-hongkuan:lhk/fix-cli-reseed-history-display-99646
Closed

fix(gateway): hide CLI reseed wrappers in history#99651
lin-hongkuan wants to merge 1 commit into
openclaw:mainfrom
lin-hongkuan:lhk/fix-cli-reseed-history-display-99646

Conversation

@lin-hongkuan

Copy link
Copy Markdown
Contributor

Closes #99646

What Problem This Solves

Fixes an issue where Claude CLI users who resume from OpenClaw's raw transcript reseed prompt could later see the entire internal reseed wrapper rendered as a user chat bubble in chat history. The visible bubble could include the <conversation_history> replay and the <next_user_message> wrapper instead of only the message the user actually typed.

Why This Change Was Made

The Claude CLI transcript importer now recognizes OpenClaw's reseed envelope when it appears as an imported Claude user row and projects only the wrapped <next_user_message> text into OpenClaw chat history. This keeps the model-facing reseed prompt unchanged while preventing history-API clients from displaying internal prompt scaffolding or replayed prior turns.

User Impact

Users reloading chat history after a Claude CLI session invalidation/resume now see their actual message, not a fake long user bubble containing OpenClaw reseed instructions and prior transcript context. Existing normal Claude CLI user messages, assistant messages, and tool-call coalescing behavior are preserved.

Evidence

  • node scripts/run-vitest.mjs src/gateway/cli-session-history.test.ts — PASS, 4 files / 80 tests.
  • node scripts/run-vitest.mjs src/gateway/cli-session-history.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts — PASS, 6 files / 168 tests.
  • corepack pnpm exec oxfmt --check src/gateway/cli-session-history.claude.ts src/gateway/cli-session-history.test.ts — PASS.
  • corepack pnpm exec oxlint --config .oxlintrc.json --tsconfig config/tsconfig/oxlint.core.json src/gateway/cli-session-history.claude.ts src/gateway/cli-session-history.test.ts — PASS, 0 warnings/errors.
  • git diff --check — PASS.
  • Diff secret scan — PASS (SECRET_SCAN_MATCHES 0).

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S r: too-many-prs Auto-close: author has more than twenty active PRs. labels Jul 3, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

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

Labels

gateway Gateway runtime r: too-many-prs Auto-close: author has more than twenty active PRs. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CLI-runner session-resume wrapper ("Continue this conversation using the OpenClaw transcript…") rendered as a user chat bubble

1 participant