You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
claude-cli session binding invalidated on nearly every reply turn (reuse=invalidated:system-prompt) #99372
P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingimpact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
On a production deployment tracking latest main (Telegram group, claude-cli backend), nearly every reply turn discards the stored CLI session binding and starts a fresh CLI session with history replay:
occasionally two user turns 15s apart do reuse (reuse=reusable), so the hash inputs are not purely per-turn volatile — different reply execution paths appear to write incompatible bindings.
Impact
CLI resume is effectively dead for interactive turns: every turn pays full history replay in fresh context (no provider-side prompt cache reuse), and transcript continuity inside the CLI harness is lost. This defeats the append-only/cache-hit design of the session transcript.
Where to look
resolveCliSessionReuse (src/agents/cli-session.ts) invalidates with reason system-prompt when any of extraSystemPromptHash, messageToolPolicyHash, or promptToolNamesHash differs from the stored binding. Those inputs are assembled in src/agents/cli-runner/prepare.ts (extraSystemPromptStatic fast-path at ~line 352, messageToolPolicyHash at ~line 358) and fed differently by the primary reply path (get-reply-run.ts), the followup/queue path (followup-runner.ts, queue/drain.ts), and heartbeats.
Expected
Binding-reuse hash inputs must be session-stable facts, resolved identically for every trigger and execution path of the same session. Per-message metadata must never reach them; policy facts (sourceReplyDeliveryMode, requireExplicitMessageTarget, prompt tool names) must not flap between primary/followup/heartbeat flavors. Fix at the parameter-assembly owner; do not loosen the reuse comparison itself (stale-system-prompt invalidation must keep working).
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
Close as duplicate: this latest-main report is another instance of the Claude CLI system-prompt false-invalidation class already tracked by the open canonical issue, including the prompt-policy and live-session variants discussed there.
Root-cause cluster
Relationship: duplicate
Canonical: #69118
Summary: This report is a latest-main instance of the Claude CLI system-prompt/session-fingerprint false-invalidation class already tracked by the canonical open issue.
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Canonical path: #69118 is open and its existing review/comment history identifies it as the canonical tracker for Claude CLI extraSystemPromptHash/session-fingerprint false-invalidation variants.
So I’m closing this here and keeping the remaining discussion on #69118 and #83250.
Review details
Best possible solution:
Keep the canonical issue as the active tracker, preserve this latest-main evidence there, and review or split the linked fix candidates from that cluster.
Do we have a high-confidence way to reproduce the issue?
Yes from source at medium confidence: current main still compares the exact prompt-policy hash fields named in the report, and the canonical issue already documents live/source reproductions for the same false-invalidation class.
Is this the best way to solve the issue?
Yes for triage: routing this latest-main report to the canonical issue is the best path because the remaining variants and open fix candidates are already tracked there.
Security review:
Security review: No patch is under review, and the issue is not a security report.
AGENTS.md: found and applied where relevant.
What I checked:
Current reuse comparator: Current main still returns invalidatedReason: "system-prompt" when stored and current extra system prompt, message-tool policy, or prompt-tool-name hashes differ. (src/agents/cli-session.ts:159, 8604dbdc93fb)
Current hash assembly: prepareCliRunContext still hashes extraSystemPromptStatic, derives messageToolPolicyHash, computes promptToolNamesHash, and passes all three into resolveCliSessionReuse. (src/agents/cli-runner/prepare.ts:349, 8604dbdc93fb)
Related issue search: Search for claude-cli/system-prompt session issues returned the canonical issue, the current issue, the live-fingerprint sibling, and prior duplicate/adjacent reports in the same cluster.
Likely related people:
zijunl: Prior canonical review and PR history identify the merged static extraSystemPrompt hashing split as central to this false-invalidation class. (role: introduced adjacent behavior; confidence: medium; commits: a0297fa0d674, 6db1b5165d5c; files: src/auto-reply/reply/get-reply-run.ts, src/agents/cli-runner/prepare.ts)
steipete: History ties this person to CLI session preservation and prompt forwarding around the same session-reuse surface. (role: merger and adjacent contributor; confidence: medium; commits: 3e2489869069, b81b855bb34d, c470885a0ba6; files: src/auto-reply/reply/get-reply-run.ts, src/agents/cli-runner/prepare.ts, src/agents/cli-session.ts)
obviyus: Live GitHub commit history shows recent changes in cli-runner preparation and auto-reply prompt/session paths that still carry the current hash inputs. (role: recent area contributor; confidence: medium; commits: 5e4d8eda1971, 568be74e159e, 3ad465d32b3b; files: src/agents/cli-runner/prepare.ts, src/auto-reply/reply/get-reply-run.ts)
sumitaich1998: Authored the open PR targeting the canonical issue's groupIntro static-hash drift. (role: open fix candidate author; confidence: medium; commits: 85acdd415334; files: src/auto-reply/reply/get-reply-run.ts, src/auto-reply/reply/get-reply-run.media-only.test.ts)
Codex review notes: model internal, reasoning high; reviewed against 8604dbdc93fb.
P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingimpact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
Activity
clawsweeper commentedon Jul 3, 2026
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
Close as duplicate: this latest-main report is another instance of the Claude CLI
system-promptfalse-invalidation class already tracked by the open canonical issue, including the prompt-policy and live-session variants discussed there.Root-cause cluster
Relationship:
duplicateCanonical: #69118
Summary: This report is a latest-main instance of the Claude CLI system-prompt/session-fingerprint false-invalidation class already tracked by the canonical open issue.
Members:
canonical: Claude CLI sessions reset on every turn in group channels due to groupIntro drift in extraSystemPromptHash #69118 - Open issue already tracks the Claude CLI extraSystemPromptHash/session-fingerprint false-invalidation class and explicitly includes adjacent variants beyond the title trigger.fixed_by_candidate: fix: stabilize claude-cli extraSystemPromptHash across group turns (#69118) #91157 - Open PR targets the canonical issue's groupIntro static-hash trigger and has not merged.partial_overlap: [Bug]:systemPromptHashinbuildClaudeLiveFingerprintcauses phantom claude-cli session restarts on every turn for chat channels #81041 - Open sibling tracks the claude-cli live-session fingerprint restart side of the same volatile prompt/fingerprint family.partial_overlap: fix(cli-runner): drop volatile systemPromptHash from claude-cli live fingerprint #81047 - Open PR targets the live-session fingerprint sibling rather than this binding-level report by itself.duplicate: Claude CLI false session reset: directChatContext provider label drifts extraSystemPromptHash when one session key serves multiple channels (dmScope=main) #83250 - Closed duplicate precedent for another extraSystemPromptHash false-invalidation trigger routed to the canonical issue.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Canonical path: #69118 is open and its existing review/comment history identifies it as the canonical tracker for Claude CLI extraSystemPromptHash/session-fingerprint false-invalidation variants.
So I’m closing this here and keeping the remaining discussion on #69118 and #83250.
Review details
Best possible solution:
Keep the canonical issue as the active tracker, preserve this latest-main evidence there, and review or split the linked fix candidates from that cluster.
Do we have a high-confidence way to reproduce the issue?
Yes from source at medium confidence: current main still compares the exact prompt-policy hash fields named in the report, and the canonical issue already documents live/source reproductions for the same false-invalidation class.
Is this the best way to solve the issue?
Yes for triage: routing this latest-main report to the canonical issue is the best path because the remaining variants and open fix candidates are already tracked there.
Security review:
Security review: No patch is under review, and the issue is not a security report.
AGENTS.md: found and applied where relevant.
What I checked:
invalidatedReason: "system-prompt"when stored and current extra system prompt, message-tool policy, or prompt-tool-name hashes differ. (src/agents/cli-session.ts:159, 8604dbdc93fb)extraSystemPromptStatic, derivesmessageToolPolicyHash, computespromptToolNamesHash, and passes all three intoresolveCliSessionReuse. (src/agents/cli-runner/prepare.ts:349, 8604dbdc93fb)Likely related people:
src/auto-reply/reply/get-reply-run.ts,src/agents/cli-runner/prepare.ts)src/auto-reply/reply/get-reply-run.ts,src/agents/cli-runner/prepare.ts,src/agents/cli-session.ts)src/agents/cli-runner/prepare.ts,src/auto-reply/reply/get-reply-run.ts)src/auto-reply/reply/get-reply-run.ts,src/auto-reply/reply/get-reply-run.media-only.test.ts)Codex review notes: model internal, reasoning high; reviewed against 8604dbdc93fb.
fix(agents): keep cli session binding facts session-stable
fix(agents): keep cli session binding facts session-stable