Skip to content

Copilot Chat: external-agent (Claude) delegated sessions missing from Copilot Chat's own history #336185

Open

Description

@mcorbettbma

Extension: GitHub Copilot Chat 0.65.0
VS Code server build: 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c

Repro

  1. In Copilot Chat, start a session targeting the Claude external agent.
  2. Let it run, close/finish.
  3. Open Copilot Chat's own sidebar chat list.

Expected: session appears in Copilot Chat's history.

Actual: session missing from Copilot Chat's history entirely.

Root cause (confirmed via transcript inspection)

Copilot spawns the Claude Agent SDK (TS) as an external agent with cwd set to a per-chat scratch folder ~/.copilot/chats/<chat-uuid>/. Confirmed from actual session transcript metadata:

"entrypoint":"sdk-ts"
"cwd":"/home/codespace/.copilot/chats/<uuid>"
"userType":"external"

The SDK/CLI writes its own transcript under ~/.claude/projects/<sanitized-cwd>/*.jsonl (Claude Code's normal per-cwd session store) — this succeeds and Claude Code's own session list shows it correctly.

Copilot Chat's own sidebar history appears to be keyed off ~/.copilot/chats/<uuid>/ (or a DB record pointing there) — that directory does not exist on disk afterward, so Copilot's own list has nothing to read, even though the delegated run completed successfully and its transcript survives elsewhere.

Two independent persistence stores for one execution; the Copilot-side one isn't surviving/persisting for Claude-targeted external-agent sessions.

Impact: users lose visibility into past Claude-delegated sessions from within Copilot Chat's UI; the only place they remain visible is Claude Code's own separate session list (if that extension happens to be installed).

Activity

  1. ghsama commented on Sep 15, 2026

    @ghsama

    This is a real issue , no historical chats are shown

    Fix found for local session history not showing:

    Check your settings.json for this setting:

    "chat.viewSessions.enabled": false

    If it's false, change it to true and reload the window (Cmd+Shift+P → Developer: Reload Window). The sessions panel comes back immediately.

    Not sure when/how it got set to false in my config (possibly a previous VS Code version or extension toggled it), but that was the root cause — not a bug in 1.137.0 itself.

  2. kasra0 commented on Sep 18, 2026

    @kasra0

    the following seams related
    #334170 : Claude sessions never appear in Agent Sessions view — chat discovery race condition swallows "SDK not ready" as success
    #335215 : Agents window: external agent sessions are only discovered at startup; add refresh/rediscovery

  3. interconnectedMe commented on Oct 8, 2026

    @interconnectedMe

    Possibly related to the missing-session-list issue I just reported: #340573

    I am also seeing most Claude sessions absent from VS Code's native Chat Sessions list, alongside Codex sessions. Both provider filters are enabled, and Reset, Refresh, and Reload Window do not restore them; VS Code's session-state store still has Claude and Codex resource URIs.

    The chat.viewSessions.enabled: true suggestion in this thread does not appear to explain my case: the Sessions view itself is present, that setting is not explicitly set in my active profile, and Codex sessions are also missing. This may be a different discovery/provider-list failure, but the Claude symptom could overlap.

  4. interconnectedMe commented on Oct 8, 2026

    @interconnectedMe

    Follow-up to my earlier “possibly related” comment: we have verified a resolution for the Codex portion of #340573.

    "chat.editor.codex.preferAgentHost": false

    Setting this explicitly in the active profile restored Codex history and pinned chats immediately, before a window reload. They opened correctly in editor tabs and survived Developer Reload Window. Rolling back to 1.140.0 alone had not helped; we are now back on 1.141.0 with the setting retained and the Codex workflow working.

    This fixes the Codex extension portion of our report; it is not a verified fix for Claude delegated-session persistence or discovery. Claude recovery has not been separately verified.

    Details and scope clarification: #340573

  5. interconnectedMe commented on Oct 8, 2026

    @interconnectedMe

    Follow-up: Claude history is now accessible again as well, through a separate recovery step from the Codex preference workaround.

    Before this step, the 1.141.0 agent-host log repeatedly reported:

    [Claude] SDK not downloaded yet; deferring chat discovery
    

    We invoked VS Code's built-in workbench.action.chat.agentHost.downloadAgentSdk command with argument "claude" using a temporary keybinding (removed after testing). The download completed successfully for Claude SDK 0.3.281, then the same running agent host logged:

    [AgentService] discovery for provider claude: 26 candidate(s) (26 external), 26 registered, 0 already registered, 0 suppressed as subagent/chat backing, 0 skipped as older than 30 days
    

    The user then opened a recovered Claude conversation in native Chat and compared it with the Claude Code extension sidebar; the same historical messages were visible in both. This verifies discovery and history access, not sending a new message or post-restart persistence. chat.agentSessions.showExternal was set to last30Days in the active profile during this test.

    This establishes an SDK-availability/discovery prerequisite in our case. It does not establish the specific readiness race in #334170: we did not observe the SDK becoming ready spontaneously after startup while discovery failed to retry. The explicit SDK download successfully triggered discovery without a full window reload. No session-store deletion or index rebuild was needed.

    Codex was restored separately using "chat.editor.codex.preferAgentHost": false. Both recoveries were confirmed on VS Code 1.141.0.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions