Skip to content

1.0.6 breaks resume for pre-1.0.6 sessions: data.summary Required in session.task_complete #2089

@cwedgwood

Description

@cwedgwood

After upgrading to 1.0.6, resuming sessions created by earlier versions fails with:

✗ Failed to resume session: Error: Session file is corrupted (line NNN: data.summary: Required)

The file is not actually corrupted. The issue is that 1.0.6 added schema validation requiring data.summary in session.task_complete events, but sessions created by earlier versions (≤1.0.5) wrote these events with "data": {} (no summary field). This makes those sessions unresumable after upgrade.

Note: This bug was identified and investigated by a copilot-cli agent (Claude Opus 4.6 1M) during an interactive session with user @cwedgwood. The analysis and fix verification below were performed by the agent with the user confirming results.

Affected version

GitHub Copilot CLI 1.0.6

Steps to reproduce the behavior

  1. Have sessions created by copilot-cli ≤1.0.5 that contain sub-agent task completions
  2. Upgrade to 1.0.6
  3. Attempt to resume any such session
  4. Observe error: Session file is corrupted (line NNN: data.summary: Required)

Scale of impact

Analysis of one user's session store:

  • 15 of 84 sessions (18%) are affected
  • 80 individual session.task_complete events have "data": {} instead of "data": {"summary": "..."}
  • These sessions are permanently unresumable on 1.0.6 without manual patching

Root cause

In events.jsonl, pre-1.0.6 sessions contain events like:

{"type":"session.task_complete","data":{},"id":"...","timestamp":"...","parentId":"..."}

1.0.6 validates this on resume and requires data.summary to be present:

{"type":"session.task_complete","data":{"summary":"..."},"id":"...","timestamp":"...","parentId":"..."}

The validation rejects the old format as "corrupted" even though it was written by copilot-cli itself.

Expected behavior

Session resume should be backwards-compatible with sessions created by earlier versions. Either:

  1. Make data.summary optional in the validation schema (allow missing/empty), or
  2. Run a migration on resume that fills in a default value for missing fields, or
  3. Skip validation errors for non-critical fields and resume anyway

Workaround (verified)

Adding an empty summary string to the affected events fixes the problem. The following Python script patches all affected sessions. Tested on two sessions that previously failed to resume — both resumed successfully after patching.

import json, glob, os

for path in glob.glob(os.path.expanduser("~/.copilot/session-state/*/events.jsonl")):
    lines = []
    patched = 0
    with open(path) as f:
        for line in f:
            stripped = line.rstrip("\n")
            if not stripped:
                lines.append(line)
                continue
            try:
                evt = json.loads(stripped)
                if evt.get("type") == "session.task_complete" and "summary" not in evt.get("data", {}):
                    evt["data"]["summary"] = ""
                    lines.append(json.dumps(evt, separators=(",", ":")) + "\n")
                    patched += 1
                else:
                    lines.append(line)
            except json.JSONDecodeError:
                lines.append(line)
    if patched > 0:
        with open(path, "w") as f:
            f.writelines(lines)
        sess = os.path.basename(os.path.dirname(path))
        print(f"{sess}: patched {patched} events")

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions