Skip to content

fix: keep recovery prompts out of Claude chat history - #207128

Merged
obviyus merged 2 commits into
openclaw:mainfrom
Tosko4:fix/cli-stranded-reply-provenance
Nov 28, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
Tosko4:fix/cli-stranded-reply-provenance

Conversation

@Tosko4

@Tosko4 Tosko4 commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Root cause: src/agents/cli-runner/execute-plugin.ts:481 marks CLI input as host-generated only from the run's input provenance, but the stranded-reply retry (src/auto-reply/reply/stranded-reply-recovery.ts:56-89) correctly keeps the human turn's provenance, so Claude Code saves the retry prompt as a plain user row and chat.history shows it as the operator's own message.

Fixes #206304

Thanks @fray-ai for the report and the precise code trace, and @Tosko4 for the first fix in this PR.

What Problem This Solves

With a claude-cli agent and messages.visibleReplies: "message_tool", a turn that ends with plain text queues the stranded-reply retry ([System] Your previous reply was not delivered ...). That retry reached Claude Code as ordinary user input, Claude stored it as a normal user row, and the Control UI drew it as a right-aligned operator bubble.

User Impact

The retry no longer appears as a message the operator wrote. The delivered reply still arrives. An operator who types the same [System] ... text still sees it as their own message, and existing history is not rewritten. Nothing changes for the embedded runtime or for permissions.

Why This Change Was Made

  • The CLI candidate sets promptOrigin: "host" from the existing FollowupRun.strandedReplyRetry flag (agent-runner-cli-candidate.ts). RunCliAgentParams carries that one optional field, with the same value type CliBackendExecuteContext.promptOrigin already uses.
  • The plugin CLI runner marks host input when that field is set or when the provenance is host-generated, as before (execute-plugin.ts). The Claude backend then sends isSynthetic: true, Claude saves an isMeta row, and the existing history import skips it.
  • The retry's inputProvenance is unchanged (external_user). The first version of this PR switched it to internal_system; that value feeds requester-profile, continuation, collaborative-steering and personal-MCP requester checks (reply-tool-authority.ts:353, reply-tool-authority-inbound.ts:83/116/214, agent-bundle-mcp-webchat-requester.ts:42), reply threading and model urgency. Those changes are reverted, together with the missingReplyNoticeAllowed change it needed.
  • No text classification: an operator who types the same [System] ... text still sees their own bubble. Existing history is not rewritten.

Production: +9/-1 lines in 3 files. Tests: one regression at the CLI dispatch boundary (+18); the PR's other tests are dropped.

Evidence

Built Gateway + Control UI from 450c4b640ed6 (main) and this head in a secretless node:24.22.1 container. Agent main runs on claude-cli with a stand-in claude that writes a real Claude Code project JSONL (synthetic input -> isMeta) and calls the real OpenClaw MCP message tool; agent embedded runs on the OpenClaw runtime with a scripted model. Real Chromium (Playwright 1.64.1) drives WebChat sessions. Screenshots and the full table: #207128 (comment)

case main this PR
claude-cli stranded once: operator bubble with retry text (live / reload) 1 / 1 0 / 0
same: delivered reply "Delivered answer P206304." shown shown
same: chat.history retry row role: user, no provenance, importedFrom claude-cli absent (meta row skipped)
Claude stdin for retry isSynthetic absent isSynthetic: true
control: operator types the identical [System] ... text own bubble, external_user own bubble, external_user
control: retry also ends with plain text (second miss) retry shown as operator bubble; retry final shown; no "No answer" notice no operator bubble; retry final shown; no "No answer" notice (same as main)
control: embedded (non-CLI) agent, stranded once no retry bubble, delivered identical

Regression test agent-runner-execution-cli-sessions.test.ts "sends a stranded-reply retry as host input without changing its provenance (#206304)": fails with the candidate line removed (- "promptOrigin": "host"), passes at head.

Merge danger

Two-way door: no stored state, schema, config or protocol change; a revert fully restores the old behavior. Blast radius: only stranded-reply retries on plugin CLI backends (Claude CLI) change their native input marker.

@clawsweeper

clawsweeper Bot commented Nov 28, 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 agents Agent runtime and tooling size: S labels Nov 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

The PR marks stranded-reply recovery prompts as host input while preserving reply obligations and second-miss diagnostics.

Example: A Claude CLI turn produces “The answer is ready.” without calling the required message tool.

  • Before: The generated recovery instructions inherit external_user provenance and can appear as the user's own message.
  • After: The recovery uses internal_system provenance and Claude's existing synthetic-input path; identical human-authored text remains visible.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch appears correct and has reported regression coverage, but required real-behavior proof is absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Claude chat history can attribute generated recovery instructions and a quoted private reply to the user.
Reason: The change restores the established hidden-host-input contract without adding settings, changing recovery policy or rewriting old history.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR addresses a source-confirmed attribution bug still present on current main, using a focused producer-owned fix with no identified correctness findings.

Reviewed head: 9b24de6140955cca9e3c73cb3ea5d46ab8a0eb3b

Before merge

  • Add real behavior proof - Applicable evidence exercises production recovery and CLI owners with synthetic fixtures, not authenticated Claude execution through native history and Gateway projection; the inspected images concern a different PR's reply-retention flow, so the contributor must supply the recovery capture with IPs, API keys, phone numbers and non-public endpoints redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Missing end-to-end proof: Show an isolated real Claude CLI stranded retry becoming a native meta row and staying out of chat.history and the user bubble, while delivery, second-miss diagnostics and identical human text remain correct.
Agent review details

How this fits together

The reply-recovery producer creates a queued model turn, the CLI adapter translates its provenance into synthetic input, and Gateway history omits Claude's native meta rows.

flowchart LR
  A[Undelivered final] --> B[Recovery producer]
  B --> C[Queued host turn]
  C --> D[CLI execution adapter]
  D --> E[Claude synthetic input]
  E --> F[Native meta row]
  F --> G[Gateway history projection]
Loading

Technical review

Best possible solution:

Keep attribution at the recovery producer and reuse the existing synthetic-input contract while retaining delivery obligations and diagnostics.

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

Current-main source establishes inherited human provenance reaching ordinary Claude input and an importer that accepts the resulting unmarked user row; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete repair: correct provenance at its producer, preserve the resolved reply expectation, and retain the recovery-specific diagnostic without adding text filters or another history owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 595c201f9f79.

Provenance checked

  • Stranded-reply recovery keeps the original intent (ae63a48: Recover an undelivered private final once, then provide a sanitized diagnostic instead of silent success.)
  • Generic missing-reply notice suppression changes intended behavior with a stated reason (bd5f760: Separate deliberate silence, background work and owed replies; the PR explains why a recovery retry must retain its source turn's diagnostic despite its corrected host provenance.)
  • Claude host-input attribution keeps the original intent (acc6ea2: Use native synthetic input to hide host turns without brittle prompt-text matching.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +6, Tests +73. Total +79 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 7 1 +6
Tests 4 73 0 +73
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 80 1 +79

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: same_root_cause
Canonical: #206304
Summary: This PR implements the reported retry-attribution repair; the other linked PRs address distinct downstream or policy concerns.

Members:

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

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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.

Reviewed November 27, 2026, 9:23 PM ET / November 28, 2026, 02:23 UTC.

…provenance

- Revert the retry's internal_system provenance and the missing-reply-notice guard change: the retry keeps the human turn's inputProvenance, so requester identity, continuation and MCP requester checks see the same input as before.
- The CLI candidate sets promptOrigin "host" from the existing FollowupRun.strandedReplyRetry flag; the plugin runner marks host input from it or from host-generated provenance, so Claude Code saves the retry as a meta row and chat.history no longer shows it as the operator's message.
- One regression test at the CLI dispatch boundary; drop the PR's other tests.
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed gateway Gateway runtime size: S labels Nov 28, 2026
@obviyus

obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Evidence for head fdb0d4c (main = 450c4b6). Gateway + Control UI built in a secretless node:24.22.1 container; agent main on claude-cli with a stand-in claude that writes a real Claude Code project JSONL (synthetic input -> isMeta) and calls the real OpenClaw MCP message tool; messages.visibleReplies: "message_tool"; real Chromium (Playwright 1.64.1) on WebChat sessions; screenshots after reload.

case                          side  operator bubbles with retry text (live/reload)  delivered  chat.history retry row                     claude stdin isSynthetic
claude-cli stranded once      main  1/1                                             yes        role user, no provenance, importedFrom cli  absent
claude-cli stranded once      fix   0/0                                             yes        none (meta row skipped)                     true
control: typed [System] text  main  1/1 (own bubble)                                ack yes    role user, external_user                    absent
control: typed [System] text  fix   1/1 (own bubble)                                ack yes    role user, external_user                    absent
control: second miss          main  1/1; retry final shown, no "No answer" notice   -          role user, no provenance                    absent
control: second miss          fix   0/0; retry final shown, no "No answer" notice   -          none                                        true
control: embedded agent once  main  0/0                                             yes        none                                        n/a
control: embedded agent once  fix   0/0                                             yes        none                                        n/a

Regression test agent-runner-execution-cli-sessions.test.ts (#206304): fails with the candidate line removed (- "promptOrigin": "host"), passes at head. Pre-push: 10 touched/importer test files, 272 tests passed.

main: stranded-reply retry shown as operator bubble

fix: no operator bubble, delivered reply arrives

main: operator-typed [System] text

fix: operator-typed [System] text still own bubble

main: second miss

fix: second miss

main: embedded control

fix: embedded control

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Nov 28, 2026
@obviyus
obviyus merged commit 0edb7c5 into openclaw:main Nov 28, 2026
146 of 150 checks passed
@obviyus

obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Landed in 0edb7c5. With a claude-cli agent, the stranded-reply retry ("[System] Your previous reply was not delivered…") is now sent to Claude Code as host input, so Control UI no longer shows it as a message you typed. Who the turn belongs to is unchanged, and text you type yourself still shows as your own message. Thanks @fray-ai for the report in #206304 and @Tosko4 for the PR; we moved the fix to the CLI prompt origin so it changes only how the prompt is stored, in a commit on top of yours.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
Root cause: src/agents/cli-runner/execute-plugin.ts:481 marks CLI input as host-generated only from the run's input provenance, but the stranded-reply retry (src/auto-reply/reply/stranded-reply-recovery.ts:56-89) correctly keeps the human turn's provenance, so Claude Code saves the retry prompt as a plain user row and chat.history shows it as the operator's own message.

Fixes openclaw#206304

Thanks @fray-ai for the report and the precise code trace, and @Tosko4 for the first fix in this PR.

## What Problem This Solves

With a `claude-cli` agent and `messages.visibleReplies: "message_tool"`, a turn that ends with plain text queues the stranded-reply retry (`[System] Your previous reply was not delivered ...`). That retry reached Claude Code as ordinary user input, Claude stored it as a normal user row, and the Control UI drew it as a right-aligned operator bubble.

## User Impact

The retry no longer appears as a message the operator wrote. The delivered reply still arrives. An operator who types the same `[System] ...` text still sees it as their own message, and existing history is not rewritten. Nothing changes for the embedded runtime or for permissions.

## Why This Change Was Made

- The CLI candidate sets `promptOrigin: "host"` from the existing `FollowupRun.strandedReplyRetry` flag (`agent-runner-cli-candidate.ts`). `RunCliAgentParams` carries that one optional field, with the same value type `CliBackendExecuteContext.promptOrigin` already uses.
- The plugin CLI runner marks host input when that field is set or when the provenance is host-generated, as before (`execute-plugin.ts`). The Claude backend then sends `isSynthetic: true`, Claude saves an `isMeta` row, and the existing history import skips it.
- The retry's `inputProvenance` is unchanged (`external_user`). The first version of this PR switched it to `internal_system`; that value feeds requester-profile, continuation, collaborative-steering and personal-MCP requester checks (`reply-tool-authority.ts:353`, `reply-tool-authority-inbound.ts:83/116/214`, `agent-bundle-mcp-webchat-requester.ts:42`), reply threading and model urgency. Those changes are reverted, together with the `missingReplyNoticeAllowed` change it needed.
- No text classification: an operator who types the same `[System] ...` text still sees their own bubble. Existing history is not rewritten.

Production: +9/-1 lines in 3 files. Tests: one regression at the CLI dispatch boundary (+18); the PR's other tests are dropped.

## Evidence

Built Gateway + Control UI from `4e9cab516ac9` (main) and this head in a secretless node:24.22.1 container. Agent `main` runs on `claude-cli` with a stand-in `claude` that writes a real Claude Code project JSONL (synthetic input -> `isMeta`) and calls the real OpenClaw MCP `message` tool; agent `embedded` runs on the OpenClaw runtime with a scripted model. Real Chromium (Playwright 1.64.1) drives WebChat sessions. Screenshots and the full table: openclaw#207128 (comment)

| case | main | this PR |
|---|---|---|
| claude-cli stranded once: operator bubble with retry text (live / reload) | 1 / 1 | 0 / 0 |
| same: delivered reply "Delivered answer P206304." | shown | shown |
| same: chat.history retry row | `role: user`, no provenance, importedFrom claude-cli | absent (meta row skipped) |
| Claude stdin for retry | `isSynthetic` absent | `isSynthetic: true` |
| control: operator types the identical `[System] ...` text | own bubble, `external_user` | own bubble, `external_user` |
| control: retry also ends with plain text (second miss) | retry shown as operator bubble; retry final shown; no "No answer" notice | no operator bubble; retry final shown; no "No answer" notice (same as main) |
| control: embedded (non-CLI) agent, stranded once | no retry bubble, delivered | identical |

Regression test `agent-runner-execution-cli-sessions.test.ts` "sends a stranded-reply retry as host input without changing its provenance (openclaw#206304)": fails with the candidate line removed (`- "promptOrigin": "host"`), passes at head.

## Merge danger

Two-way door: no stored state, schema, config or protocol change; a revert fully restores the old behavior. Blast radius: only stranded-reply retries on plugin CLI backends (Claude CLI) change their native input marker.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
Root cause: src/agents/cli-runner/execute-plugin.ts:481 marks CLI input as host-generated only from the run's input provenance, but the stranded-reply retry (src/auto-reply/reply/stranded-reply-recovery.ts:56-89) correctly keeps the human turn's provenance, so Claude Code saves the retry prompt as a plain user row and chat.history shows it as the operator's own message.

Fixes #206304

Thanks @fray-ai for the report and the precise code trace, and @Tosko4 for the first fix in this PR.

## What Problem This Solves

With a `claude-cli` agent and `messages.visibleReplies: "message_tool"`, a turn that ends with plain text queues the stranded-reply retry (`[System] Your previous reply was not delivered ...`). That retry reached Claude Code as ordinary user input, Claude stored it as a normal user row, and the Control UI drew it as a right-aligned operator bubble.

## User Impact

The retry no longer appears as a message the operator wrote. The delivered reply still arrives. An operator who types the same `[System] ...` text still sees it as their own message, and existing history is not rewritten. Nothing changes for the embedded runtime or for permissions.

## Why This Change Was Made

- The CLI candidate sets `promptOrigin: "host"` from the existing `FollowupRun.strandedReplyRetry` flag (`agent-runner-cli-candidate.ts`). `RunCliAgentParams` carries that one optional field, with the same value type `CliBackendExecuteContext.promptOrigin` already uses.
- The plugin CLI runner marks host input when that field is set or when the provenance is host-generated, as before (`execute-plugin.ts`). The Claude backend then sends `isSynthetic: true`, Claude saves an `isMeta` row, and the existing history import skips it.
- The retry's `inputProvenance` is unchanged (`external_user`). The first version of this PR switched it to `internal_system`; that value feeds requester-profile, continuation, collaborative-steering and personal-MCP requester checks (`reply-tool-authority.ts:353`, `reply-tool-authority-inbound.ts:83/116/214`, `agent-bundle-mcp-webchat-requester.ts:42`), reply threading and model urgency. Those changes are reverted, together with the `missingReplyNoticeAllowed` change it needed.
- No text classification: an operator who types the same `[System] ...` text still sees their own bubble. Existing history is not rewritten.

Production: +9/-1 lines in 3 files. Tests: one regression at the CLI dispatch boundary (+18); the PR's other tests are dropped.

## Evidence

Built Gateway + Control UI from `450c4b640ed6` (main) and this head in a secretless node:24.22.1 container. Agent `main` runs on `claude-cli` with a stand-in `claude` that writes a real Claude Code project JSONL (synthetic input -> `isMeta`) and calls the real OpenClaw MCP `message` tool; agent `embedded` runs on the OpenClaw runtime with a scripted model. Real Chromium (Playwright 1.64.1) drives WebChat sessions. Screenshots and the full table: #207128 (comment)

| case | main | this PR |
|---|---|---|
| claude-cli stranded once: operator bubble with retry text (live / reload) | 1 / 1 | 0 / 0 |
| same: delivered reply "Delivered answer P206304." | shown | shown |
| same: chat.history retry row | `role: user`, no provenance, importedFrom claude-cli | absent (meta row skipped) |
| Claude stdin for retry | `isSynthetic` absent | `isSynthetic: true` |
| control: operator types the identical `[System] ...` text | own bubble, `external_user` | own bubble, `external_user` |
| control: retry also ends with plain text (second miss) | retry shown as operator bubble; retry final shown; no "No answer" notice | no operator bubble; retry final shown; no "No answer" notice (same as main) |
| control: embedded (non-CLI) agent, stranded once | no retry bubble, delivered | identical |

Regression test `agent-runner-execution-cli-sessions.test.ts` "sends a stranded-reply retry as host input without changing its provenance (#206304)": fails with the candidate line removed (`- "promptOrigin": "host"`), passes at head.

## Merge danger

Two-way door: no stored state, schema, config or protocol change; a revert fully restores the old behavior. Blast radius: only stranded-reply retries on plugin CLI backends (Claude CLI) change their native input marker.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 0edb7c5)

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
Root cause: src/agents/cli-runner/execute-plugin.ts:481 marks CLI input as host-generated only from the run's input provenance, but the stranded-reply retry (src/auto-reply/reply/stranded-reply-recovery.ts:56-89) correctly keeps the human turn's provenance, so Claude Code saves the retry prompt as a plain user row and chat.history shows it as the operator's own message.

Fixes #206304

Thanks @fray-ai for the report and the precise code trace, and @Tosko4 for the first fix in this PR.

With a `claude-cli` agent and `messages.visibleReplies: "message_tool"`, a turn that ends with plain text queues the stranded-reply retry (`[System] Your previous reply was not delivered ...`). That retry reached Claude Code as ordinary user input, Claude stored it as a normal user row, and the Control UI drew it as a right-aligned operator bubble.

The retry no longer appears as a message the operator wrote. The delivered reply still arrives. An operator who types the same `[System] ...` text still sees it as their own message, and existing history is not rewritten. Nothing changes for the embedded runtime or for permissions.

- The CLI candidate sets `promptOrigin: "host"` from the existing `FollowupRun.strandedReplyRetry` flag (`agent-runner-cli-candidate.ts`). `RunCliAgentParams` carries that one optional field, with the same value type `CliBackendExecuteContext.promptOrigin` already uses.
- The plugin CLI runner marks host input when that field is set or when the provenance is host-generated, as before (`execute-plugin.ts`). The Claude backend then sends `isSynthetic: true`, Claude saves an `isMeta` row, and the existing history import skips it.
- The retry's `inputProvenance` is unchanged (`external_user`). The first version of this PR switched it to `internal_system`; that value feeds requester-profile, continuation, collaborative-steering and personal-MCP requester checks (`reply-tool-authority.ts:353`, `reply-tool-authority-inbound.ts:83/116/214`, `agent-bundle-mcp-webchat-requester.ts:42`), reply threading and model urgency. Those changes are reverted, together with the `missingReplyNoticeAllowed` change it needed.
- No text classification: an operator who types the same `[System] ...` text still sees their own bubble. Existing history is not rewritten.

Production: +9/-1 lines in 3 files. Tests: one regression at the CLI dispatch boundary (+18); the PR's other tests are dropped.

Built Gateway + Control UI from `450c4b640ed6` (main) and this head in a secretless node:24.22.1 container. Agent `main` runs on `claude-cli` with a stand-in `claude` that writes a real Claude Code project JSONL (synthetic input -> `isMeta`) and calls the real OpenClaw MCP `message` tool; agent `embedded` runs on the OpenClaw runtime with a scripted model. Real Chromium (Playwright 1.64.1) drives WebChat sessions. Screenshots and the full table: #207128 (comment)

| case | main | this PR |
|---|---|---|
| claude-cli stranded once: operator bubble with retry text (live / reload) | 1 / 1 | 0 / 0 |
| same: delivered reply "Delivered answer P206304." | shown | shown |
| same: chat.history retry row | `role: user`, no provenance, importedFrom claude-cli | absent (meta row skipped) |
| Claude stdin for retry | `isSynthetic` absent | `isSynthetic: true` |
| control: operator types the identical `[System] ...` text | own bubble, `external_user` | own bubble, `external_user` |
| control: retry also ends with plain text (second miss) | retry shown as operator bubble; retry final shown; no "No answer" notice | no operator bubble; retry final shown; no "No answer" notice (same as main) |
| control: embedded (non-CLI) agent, stranded once | no retry bubble, delivered | identical |

Regression test `agent-runner-execution-cli-sessions.test.ts` "sends a stranded-reply retry as host input without changing its provenance (#206304)": fails with the candidate line removed (`- "promptOrigin": "host"`), passes at head.

Two-way door: no stored state, schema, config or protocol change; a revert fully restores the old behavior. Blast radius: only stranded-reply retries on plugin CLI backends (Claude CLI) change their native input marker.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 0edb7c5)

Follow-ups: 7cb8975 fix: keep forked Claude chats separate after a Gateway crash (#208048) [separately ordered lane row]; a736683 fix: show context usage during Claude CLI turns (#207036) [not selected for this narrow backport]; 75ad0b7 fix(voice): answer phone, meeting and FaceTime consults on Claude CLI agents (#202209) [not selected for this narrow backport]; b9ddb61 fix: keep saved system-event automations running after an upgrade (#207275) [not selected for this narrow backport]

Release adaptation: Propagate host prompt origin at the stable CLI backend input owner while preserving original human provenance.

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

agents Agent runtime and tooling impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

2 participants