Skip to content

[Bug]: Switching back to an earlier Claude instance resumes its 5-day-old native session, and the agent answers from that history instead of the new message #38376

Open

Description

@NeilMazumdar

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Recorded from one affected thread. I have not reduced it to a minimal repro.

  1. Run a long thread on Claude instance A. Here it was an orchestrator thread that starts and messages other threads, with a recurring scheduled task bound to it.
  2. Switch the thread to Claude instance B and keep working. Here B ran app runs 158 to 264 over five days (12 to 17 Nov).
  3. A turn on B fails (Claude API unknown. after 27 minutes, run 264).
  4. The next user message, 24 hours later, runs on A (run 265).

I don't know whether I selected A in the composer or T3 changed the instance after the failed turn. The provider event log has no event between B's query.close after the failure and A's query.open with resume set to the old session, and the server traces from that time have rotated out. If T3 can switch instances without a user action, that is worth checking on its own.

Expected behavior

The agent answers the new message, with the work done on B treated as the most recent context.

Any of these would do it:

  • When the target instance's native session is older than the thread's latest run on another instance, start a fresh native session with a handoff, rather than resuming the old one.
  • Or keep resuming, but make the handoff state that its turns came after everything in the resumed native history and supersede it, and carry enough of them to stand on.

Actual behavior

T3 resumed A's native session from 12 Nov and added a handoff covering runs 158 to 264. The handoff kept 8 intact items and omitted 366. The local transcript confirms the resume: session bc94b268… in A's config home has 195 entries on 12 Nov, none from 13 to 16 Nov, then the 17 Nov handoff and turns.

The model then treated the 12 Nov history as the live conversation. Over the next six runs it:

  • answered a user question with the output format of the scheduled task's prompt, which was the last thing in its 12 Nov history ("No unhandled messages in ...");
  • read "start it as a new thread" as a request for a follow-up from 12 Nov and launched a thread for that work;
  • replaced the channel ID in a pasted Slack URL with an ID from its old context, decided the link was a Teams link when the lookup failed, and sent another thread a request about an event from 12 Nov;
  • mixed material from the old context into a summary of a delegate's result.

The user's messages were clear each time. Every wrong action traces to something in the 12 Nov part of the session.

#23086 describes the same resume from the cost side and was closed as not reproduced. This report is about correctness: the agent acts on the stale session. The transcript evidence above shows the resume happened.

Impact

Major degradation or frequent failure

Version or commit

0.1.11-nightly.20261117.4825

Environment

macOS desktop (Darwin 27.2). Two Claude Agent SDK provider instances (claudeAgent driver) with separate config homes. Model claude-fable-5-2 on both.

Logs or stack traces

Relevant fields only. IDs shortened, project content removed.

run 158 (12 Nov 23:20 UTC): handoff claudeAgent -> claude-codereview
run 264 (16 Nov 22:32 UTC): provider=claude-codereview  status=failed  error="Claude API unknown."
run 265 (17 Nov 22:44 UTC): provider=claudeAgent
  handoff: "Covered app runs: 158-264."
           "Selected 8 intact items; omitted 366 items."
  native session: bc94b268... (same session as runs before 158)

~/.claude/projects/<worktree>/bc94b268....jsonl
  entries by day: 2026-11-12: 195, 2026-11-17: 318

Workaround

Start a new thread for the same worktree and settle the old one.

Activity

  1. added a commit that references this issue on Nov 18, 2026
    225c6ae
  2. juliusmarminge commented on Nov 18, 2026

    @juliusmarminge
    Member

    A fix for this was proposed in #38388, but when the reported steps were run in the real app the problem did not appear.

    What was run on 856c84e4b1, the commit before this change:

    On each commit: launch on Claude A with deploy target eu-west-ALPHA; switch to B; request 'ok'; change the target to us-east-BRAVO and receive 'target BRAVO'; request five approximately 900-word essays about herons, cormorants, albatrosses, puffins, and kestrels; switch back to A; ask 'Which cluster do we deploy to? Answer with just the cluster name, from what you already know, without reading anything.' Base answered 'BRAVO'; head answered 'eu-west-ALPHA'. Base run 9 reused run 1's provider thread with five omitted delta items. Head recorded a full-summary handoff with seven omitted items in addition to the switch delta.

    How: Manual comparison using two isolated worktrees running T3CODE_DEV_SEED=0 vp run dev with fresh databases. Real Claude Haiku 5.5 through the configured proxy, two separate Claude config directories per side. Seeded through the server's MCP tools; submitted the final question in the real Chromium web client. Both captures use dark theme and a 1280x800 CSS viewport. Inspected screenshots and recording filmstrips; confirmed identical screenshot pairs more than 500 ms apart. Uploaded evidence, stopped servers, closed browser tab, and removed both worktrees and scratch data. Replay scenarios were unsuitable because this depends on Claude's native-session behavior.

    Could you share the exact steps, what you see, and the version and platform you are on? The pull request is closed for now; the fix is picked up again once the problem can be shown.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs more infoInitial triage showed no bug. Awaiting more info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions