Skip to content

Context window rollover fails: "checkpoint.md is absent for this agent; write it before requesting rollover" #5205

Closed

Description

@jj05y

Context window rollover fails: "checkpoint.md is absent for this agent; write it before requesting rollover"

Describe the bug

Long-running agent sessions crash when the context window fills and the runtime attempts a rollover:

Execution failed: Failed to start a fresh context window: checkpoint.md is absent for this agent; write it before requesting rollover

The turn ends and the session (or sub-agent) is effectively dead; it recurs on subsequent turns in the same session.

What we observed

  • The agent had written a checkpoint.md to the session's files/ folder (via a normal file write / patch) ~7 minutes before the first failure, yet the runtime still reported it as absent "for this agent".
  • The native runtime contains related errors ("Replacing checkpoint.md requires expected_revision; read or stat it first, or use append", "Stale checkpoint writer…"), which suggests checkpoints must be written through a runtime-managed store/tool rather than a plain file write. In our sessions the model did not appear to have any tool exposed for that store, so it could never satisfy the precondition.
  • Seen repeatedly across multiple sessions/sub-agents (custom agents and the main agent), mostly in long tool-heavy sessions (builds, test runs, large tool outputs).

Expected behavior

Either the runtime writes/derives the checkpoint itself before rollover, or the agent is given (and prompted to use) the tool needed to create it. Failing that, it should fall back to normal compaction instead of terminating the turn.

Environment

  • GitHub Copilot CLI 1.0.100 (also seen on 1.0.98)
  • Windows 11 x64, PowerShell
  • Models: GPT-6.1 Sol and Claude Opus 5.5 sessions

Workaround

Manual /compact before the context fills avoids it.

Activity

  1. added
    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loading
    and removed on Oct 21, 2026
  2. dutchdevil-83 commented on Oct 24, 2026

    @dutchdevil-83

    Reproduced twice on 2026-10-24 in VS Code Agent Host with embedded Copilot SDK 1.0.100-1, Windows, model Auto -> GPT-6 Luna.

    A context_window_reminder explicitly required a session_artifacts write/append of checkpoint.md followed by new_context. The model searched for session_artifacts write or append checkpoint.md; new_context tool, but tool discovery returned only unrelated tools. Neither session_artifacts nor new_context appeared among 64 advertised tools. Query then failed with the exact error in this issue at 12:50:48.974Z and again at 13:40:19.853Z. Both later /compact calls were manual and succeeded; no automatic compaction preceded either error.

    A separate observation: although VS Code showed 1M context, all 181 normal usage records reported maxPromptTokens=272000, contextTier=null, so the apparent failure around 23% was actually around 87-88% of the operative prompt limit. The two manual compactions consumed ~2.80 and ~2.71 AI credits, respectively.

    Please investigate checkpoint tool availability/rollover fallback and the UI-to-SDK context tier mismatch. I can share a privately sanitized minimal event trace, but the complete bundle contains proprietary content.

  3. dewers99 commented on Oct 29, 2026

    @dewers99

    Adding a reproduction on Copilot CLI 1.0.105 (Windows 11), which extends the affected versions beyond 1.0.98/1.0.100.

    Setup: long-running, tool-heavy orchestrator sessions using custom agents, launched as copilot --allow-all --agent=<name>. Two separate sessions hit the exact error — "Failed to start a fresh context window: checkpoint.md is absent for this agent; write it before requesting rollover" — on 2026-10-28.

    Session A: the error fired three times in succession (initial rollover demand, then on two further turns). The agent had written files/checkpoint.md (7,722 bytes) during the session, but it never registered: checkpoints/index.md remained the empty table created at session start. events.jsonl was ~13 MB. The session could not be recovered and was closed.

    Session B: same signature — checkpoints/index.md still the empty table from session start, events.jsonl ~13.4 MB — and the refusal fired when the session resumed after a pause. This time a manual /compact was run in the wedged session: it registered "Checkpoint 1" in checkpoints/index.md, and the session then continued normally. This confirms the workaround above on 1.0.105.

    Common thread: in neither session did automatic compaction ever register a checkpoint, at any point, despite both sessions running for roughly an hour with heavy tool use. Whatever gates the rollover's checkpoint requirement, the checkpoint was never created by the automatic path — only the manual /compact produced one.

    Happy to provide session-state details if useful.

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

    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loading

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions