Skip to content

Copilot CLI session file cannot be opened in VS Code Copilot Chat: Invalid 'ephemeral' value literal #2000

@nickhoo555

Description

@nickhoo555

Describe the bug

Bug Summary

When opening a chat session exported/generated by GitHub Copilot CLI in VS Code Copilot Chat extension, the following error occurs and the session cannot be loaded:

Failed to initialize chat session copilotcli:/<session-id>: Session file is corrupted (line 6: ephemeral: Invalid literal value, expected true)

VS Code Copilot Chat cannot open the CLI session. The session file is stored at:

~/.copilot/session-state/<session-id>/events.jsonl

Minimal Repro Session File (events.jsonl excerpt)

{"type":"session.start","data":{"sessionId":"<session-id>","version":1,"producer":"copilot-agent","copilotVersion":"1.0.4","startTime":"2026-03-12T12:36:24.489Z","context":{"cwd":"/path/to/project","gitRoot":"/path/to/project","branch":"main","headCommit":"<commit-sha>","repository":"<repo-name>","hostType":"github","baseCommit":"<commit-sha>"},"alreadyInUse":false},"id":"<uuid-1>","timestamp":"2026-03-12T12:36:24.540Z","parentId":null}
{"type":"user.message","data":{"content":"hi","transformedContent":"<current_datetime>2026-03-12T12:36:30.132Z</current_datetime>\n\nhi\n\n<reminder>\n<sql_tables>No tables currently exist. Default tables (todos, todo_deps) will be created automatically when you first use the SQL tool.</sql_tables>\n</reminder>","source":"user","attachments":[],"interactionId":"<uuid-2>"},"id":"<uuid-3>","timestamp":"2026-03-12T12:36:30.132Z","parentId":"<uuid-4>"}
{"type":"assistant.turn_start","data":{"turnId":"0","interactionId":"<uuid-2>"},"id":"<uuid-5>","timestamp":"2026-03-12T12:36:30.142Z","parentId":"<uuid-3>"}
{"type":"assistant.message","data":{"messageId":"<uuid-6>","content":"Hi! How can I help you today?","toolRequests":[],"interactionId":"<uuid-2>","outputTokens":12},"id":"<uuid-7>","timestamp":"2026-03-12T12:36:33.201Z","parentId":"<uuid-8>"}
{"type":"assistant.turn_end","data":{"turnId":"0"},"id":"<uuid-9>","timestamp":"2026-03-12T12:36:33.201Z","parentId":"<uuid-7>"}
{"type":"session.shutdown","data":{"shutdownType":"routine","totalPremiumRequests":1,"totalApiDurationMs":2753,"sessionStartTime":1773318984489,"codeChanges":{"linesAdded":0,"linesRemoved":0,"filesModified":[]},"modelMetrics":{"claude-sonnet-4.6":{"requests":{"count":1,"cost":1},"usage":{"inputTokens":22344,"outputTokens":12,"cacheReadTokens":0,"cacheWriteTokens":0}}},"currentModel":"claude-sonnet-4.6"},"id":"<uuid-10>","timestamp":"2026-03-12T12:36:36.964Z","parentId":"<uuid-11>"}

VS Code Copilot Chat extension reports:

Failed to open chat session: Session file is corrupted (line 6: ephemeral: Invalid literal value, expected true)

Additional Info

  • Copilot CLI Version: 1.0.4
  • VS Code Copilot Chat Extension Version: 0.39.0
  • System: macOS

Technical Analysis

  • VS Code expects the field 'ephemeral' in the session file to be a literal true, but Copilot CLI outputs a boolean or other type.
  • Session schema validation fails ('Invalid literal value, expected true').
  • See contributors: copilotcliSessionService.ts, claudeSessionSchema.ts

Expected

  • Copilot CLI and Copilot Chat extension should be compatible in session file formats.
  • Copilot Chat should be able to parse all valid Copilot CLI session files.

Actual

  • Session files generated by Copilot CLI sometimes cannot be opened in Copilot Chat due to schema validation (literal value mismatch).

Steps to Reproduce

  1. Generate a session file using GitHub Copilot CLI (version 1.0.4)
  2. Attempt to open the session file in VS Code Copilot Chat extension (version 0.39.0)
  3. Observe the error: Session file is corrupted (line 6: ephemeral: Invalid literal value, expected true)

Workaround

Manually edit the session file ('events.jsonl') to correct the 'ephemeral' value format.

Suggestion

  • Make Copilot CLI and Copilot Chat session file schema compatible for 'ephemeral' value types.
  • Add schema flexibility or migration logic so session files from CLI are always usable.

Related technical references:

To reproduce, use the mock session file excerpt and refer to IDE/CLI version info provided.

Affected version

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions