fix(anthropic): enable Claude CLI session-expired history reseed#80934
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. from source: current main's Anthropic backend lacks the opt-in while Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the narrow Anthropic backend opt-in after redacted live Claude CLI session-expired proof or maintainer proof override, while keeping the shared reseed safety boundaries unchanged. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main's Anthropic backend lacks the opt-in while Is this the best way to solve the issue? Yes, the proposed path is the narrow maintainable fix: the owner plugin opts into an existing generic contract and adds a regression for that backend. A broader core default change would weaken the explicit opt-in boundary added by the earlier reseed work. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7121791735fa. Re-review progress:
|
|
@clawsweeper re-test |
|
hi. @clawsweeper bitloi sometimes forked other's pr. |
|
@clawsweeper i think it would be better to close this PR as soon as quickly. @bitloi has bad habit. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
bd464dc to
86e729b
Compare
|
Maintainer proof before landing:
GitHub CI note: pushed head Thanks @bitloi. |
|
Landed via rebase onto
Thanks @bitloi. |
Summary
session_expiredrecovery could retry fresh without OpenClaw transcript history.Change Type
Scope
Linked Issue/PR
Real behavior proof
session_expiredfresh-session recovery can now use bounded OpenClaw transcript reseed because the bundled Claude backend opts into the existing reseed contract.fix/issue-80905-claude-cli-reseed, built fromupstream/mainabb4f96b81df4f91ab2b593d0aea2ebc9698e445.node scripts/run-node.mjs --helpCI=true corepack pnpm test:extension anthropicCI=true corepack pnpm test extensions/anthropic/cli-shared.test.tsCI=true corepack pnpm test src/agents/cli-runner/session-history.test.ts src/agents/cli-runner/prepare.test.ts src/agents/cli-runner.reliability.test.ts extensions/anthropic/cli-shared.test.tsCI=true corepack pnpm test extensions/anthropicCI=true corepack pnpm check:changedreseedFromRawTranscriptWhenUncompacted: truewhile preserving native resume args. The regression test failed before the fix withexpected undefined to be true, then passed after the backend opt-in was added.claudebinary installed (command -v claudereturned exit code 1), so live provider rotation proof needs a Claude-authenticated environment or maintainerproof: override.Root Cause
session_expiredfresh retries could be prepared without OpenClaw history.Regression Test Plan
extensions/anthropic/cli-shared.test.tssrc/agents/cli-runner/session-history.test.ts,src/agents/cli-runner/prepare.test.ts, andsrc/agents/cli-runner.reliability.test.tscover the safe reseed,session_expired, and preserved auth-boundary behavior.User-visible / Behavior Changes
Claude CLI fresh-session recovery after safe invalidations can include bounded OpenClaw transcript history instead of retrying with only the current prompt.
Diagram
Security Impact
No)No)No)No)No)Yes, explain risk + mitigation: N/A.Repro + Verification
Environment
claude-clibackend config; no live Claude binary available in this environmentSteps
buildAnthropicCliBackend().config.reseedFromRawTranscriptWhenUncompactedis true and native resume args remain present.expected undefined to be true.reseedFromRawTranscriptWhenUncompacted: truein the bundled Claude backend config.Expected
sessionMode: "always"and--resume {sessionId}.Actual
Evidence
Human Verification
What you personally verified (not just CI), and how:
session_expiredevent in a Claude-authenticated runtime.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes)No)No)Risks and Mitigations
claudebinary.proof: overrideor rerun the same branch in a Claude-authenticated environment for live proof.