Skip to content

Agent Host can delete durable sessions after transient resume failures #328590

Closed

Description

@roblourens

Problem

An existing Agent Host session can disappear permanently after a transient Copilot SDK resume failure.

The SDK reports both genuinely empty sessions and unrelated failures with JSON-RPC code -32603. Agent Host treated nearly every -32603 as an empty session and replaced the existing SDK session with a new empty session using the same ID.

When that zero-turn state later lost its final subscriber, empty-session GC treated it as an abandoned provisional draft and invoked destructive disposal. That deleted the SDK event history, Agent Host session database, and worktree.

Expected

  • Network, authentication, corruption, and unknown resume failures preserve all durable session data and surface the error.
  • Empty-session recreation is limited to explicit SDK no events and Session not found responses.
  • Destructive empty-session GC only applies to pristine provisional sessions that have never materialized or persisted data.
  • Chat, changeset, and annotations subscriptions keep their owning session alive.

Additional context

The issue was reproduced with session f72992a0-b278-45e0-b094-4e78dd0b1370. Its exported debug bundle retained 2,552 SDK events, including 10 user messages, immediately before Agent Host GC deleted the live session.

Fix: #328540

(Written by Copilot)

Activity

  1. self-assigned this
    on Aug 2, 2026
  2. added
    bug
    agent-host
    on Aug 2, 2026
  3. roblourens commented on Aug 5, 2026

    @roblourens
    MemberAuthor

    Fixed in #328641

  4. added
    verified
    on Aug 5, 2026
  5. added this to the 1.132.0 milestone on Aug 5, 2026
  6. locked and limited conversation to collaborators on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-hostbugverified

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions