Skip to content

Autopilot: option to wake the session when a detached shell completes after task_complete #5430

Description

@gobbedy

Describe the feature or problem you'd like to solve

In Autopilot, when a detached shell finishes after the agent has called task_complete, its shell_detached_completed notification is held until the user's next message, so the agent can't launch a long job, end its turn, and wake itself when the job is done, as it can in interactive mode or VS Code's Local harness.

Proposed solution

Add an option (session setting, CLI flag, and a VS Code setting for the Copilot harness) to deliver background completions actively after task_complete: a shell_detached_completed notification for work started in the session starts a new Autopilot turn instead of waiting for the next user message.

Benefit: unattended Autopilot sessions can supervise long-running jobs without polling and without keeping the session "Working" for hours. The user can keep chatting meanwhile, and results are reported as soon as the job ends. This also matches what interactive mode and VS Code's Local harness already do.

Example prompts or workflows

  1. "Run the full simulation regression detached, then call task_complete. When it finishes, summarise pass/fail counts and the first error of each failing test." (Runs take 10 min to several hours.)
  2. "Start the FPGA build in the background. When it completes, check timing and utilisation and flag any failures."
  3. "Launch these 5 parameter-sweep jobs detached, one call each. Record each result as it completes, then compare them."
  4. "Kick off the long integration test suite, then help me with something else. Report back when it finishes."

Additional context

Behaviour today

Harness Mode Detached shell completes after the turn ends Agent wakes?
Copilot (SDK) Interactive Notification starts a new turn Yes
VS Code Local Autopilot / Allow all isSystemInitiated steering request Yes
Copilot (SDK) Autopilot, no task_complete Session never goes idle (hidden isAutopilotContinuation messages) n/a
Copilot (SDK) Autopilot, after task_complete Held until next user message No

Repro

  1. Start a session in Autopilot.
  2. Ask: "Use bash with mode async and detach true to run sleep 60; echo DONE. Then call task_complete."
  3. Don't send a message. Nothing happens until you type.

Observed (events.jsonl, UTC)

  • 22:32:44 bash detach: true launched → 22:33:21 session.task_complete → ~22:35:46 process exits → 22:36:50 shell_detached_completed delivered only with the next user message.
  • The same flow in interactive mode: launched 22:13:47, notification at 22:14:48 started a new turn on its own.

Environment: runtime 1.0.108-0, @github/copilot-sdk 1.0.30-preview.0, VS Code 1.146.0 Copilot harness (Agent Host), Copilot Chat 0.73.0, Remote-SSH to Linux.

Related: 1.0.106-5 ("background task completions that arrive after a run stops are delivered with your next message instead of being dropped") fixed dropped notifications. This request asks for them to wake the session. It may relate to setStayInAutopilot defaulting to true (seen in an SDK schema snapshot, not confirmed).

Workarounds today: interactive mode (loses Autopilot's keep-going behaviour), VS Code's Local harness, or attached async shells (keeps the session "Working" for the whole job).

Activity

  1. added theissue type on Nov 12, 2026
  2. added
    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agents
    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior
    and removed on Nov 12, 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:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions