Skip to content

Add resume_session and suspend_session tools to session management, and a suspend action in the Sessions sidebar #5549

Backlog

Description

@ElliotChong-MS

Describe the feature or problem you'd like to solve

The session management tools can create, list, message, rename and close sessions, but an agent can't bring a persisted session back, and neither an agent nor the user can put a live session aside to free its resources and resume it later.

Proposed solution

Add two tools to the session management suite, governed by sessionManagementTools like the others:

resume_session reopens a persisted session that isn't live (closed, suspended, or ended when the CLI restarted) by ID or name, with an optional initial prompt.

  • It keeps the session's conversation, model, agent mode and allow-all state, as /resume and --resume do, and accepts the same overrides as create_session.
  • It returns the live session ID, so the caller can message, rename or close it.
  • It completes the existing tools: close_session keeps history, but no tool can reopen that history.

suspend_session takes a live session out of memory and keeps everything needed to resume it.

  • It stops the session at the next safe point (after its current tool call, or once it is idle) and saves its state.
  • It releases the session's resources, such as memory, background shells and its runtime slot.
  • list_sessions and the Sessions sidebar show the session as suspended. resume_session, /resume or --resume brings it back.
  • It follows the same ownership rule as close_session: sessions this session created and their descendants. A user action can suspend any session.

In the Sessions sidebar, add a suspend action to each session card, alongside the close button that sidebar.showCloseButton enables.

  • Show suspended sessions as dimmed cards with a resume action.
  • Users often keep sessions they want to come back to but no longer need running. Suspending them frees resources without losing their place or reaching for /resume and a session ID later.
  • sidebar.showResumableSessions already restores remembered sessions on relaunch; suspend gives the same benefit within a running CLI.

Example prompts or workflows

  1. A coordinator agent: "Suspend every worker whose pull request is only waiting on review, and resume each one when its PR gets a new comment."
  2. Under memory pressure, before a reboot: "Suspend all idle sessions." After the restart: "Resume the coordinators first, then their workers in batches of three."
  3. A user parks a long investigation from the sidebar at the end of the day, then resumes it from the same card the next morning.
  4. After the CLI restarts, a coordinator resumes the sessions it created without the user running copilot --resume <id> once per session.

Additional context

  • We run one coordinator session that drives about 30 peer sessions through create_session and send_session_message on one macOS machine (CLI 1.0.115).
  • The single CLI process hosting those sessions grew to about 23 GB, and the kernel reported sustained memory pressure. The only relief was a full reboot, because nothing could release idle sessions short of closing them for good.
  • After the reboot, the coordinator had no tool to reopen the sessions it had been managing. As a workaround, it ran AppleScript to open a Terminal window per session, running copilot --resume <id> -i "<prompt>". That works only on macOS, opens windows on the user's desktop without asking, and starts a separate CLI process for every session. resume_session would do this through the same permission and scope model as the other session tools.
  • Suspend is different from close: it states the intent to return, and the session stays visible as resumable instead of disappearing from the sidebar and list_sessions.

🤖 Agent-authored by GitHub Copilot CLI · Model: Claude Opus 5.5

Activity

  1. added
    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agents
    area:sessionsSession management, resume, history, session picker, and session state
    and removed on Nov 22, 2026
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:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:sessionsSession management, resume, history, session picker, and session state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions