Skip to content

WSL session stays running after the agent's turn ends: Stop button and thinking timer don't clear #5311

Backlog

Description

@roboserg

Short summary

In WSL sessions the input box keeps showing Stop and the thinking timer keeps counting after the agent's reply has finished.

Affected version or release

1.1.34 (Windows desktop app)

Installation context

Windows desktop app, local chat session running in WSL (Ubuntu)

What happened?

After the agent's reply finishes, the session still looks like it is running:

  • the input box shows Stop instead of Send
  • the thinking timer keeps counting
  • the session list still shows the session as busy

When this happens, the session has no active shell commands, background agents or servers. Closing the browser didn't help.

It happens mostly in WSL sessions and rarely in Windows ones.

Steps to reproduce

  1. Start a chat session that runs in WSL.
  2. Ask for a multi-step task where the agent runs shell commands, including:
    • commands that move to the background partway through
    • Windows programs run from WSL (powershell.exe, uv.exe with headless Chrome)
    • a background command that the agent starts and later stops
  3. Let the agent finish its reply.
  4. The input box still shows Stop and the thinking timer keeps counting.

Expected behavior

When the turn ends, the Send button comes back, the timer stops and the session shows as idle.

Additional context

Activity

  1. added theissue type on Nov 2, 2026
  2. roboserg commented on Nov 4, 2026

    @roboserg
    Author

    @chuwik @Clancey
    real bug, reproduced constantly in new WSL sessions

  3. meozhang commented on Nov 9, 2026

    @meozhang

    Thanks for the feedback. We've logged this with the Azure DevOps canvas team.

  4. roboserg commented on Nov 9, 2026

    @roboserg
    Author

    Thanks!

  5. maxluk commented on Nov 14, 2026

    @maxluk

    Same bug on macOS, app 1.4.0 (runtime 1.0.106-8), with a Mission Control "user-local" remote host (copilotd on a Linux VM), so this isn't WSL-specific. It's the general remote-host idle path. It also suppresses the "done" desktop notification, which is the bigger problem for me. I went through the app logs, data.db, and the shipped frontend bundle; details below.

    Impact (my logs, Nov 5–14, 518 remote turn completions)

    • Only 46% produced a timely agent_idle activity (the "done" notification) within 60 s. 51% got it late (median 67 min, typically when the host reconnected and history was rebuilt), and 3% never.
    • About 47% of remote turn-ends left the UI showing "Thinking" (the session store stays loading) until I pressed Stop or restarted the app. The backend has sessions.is_running = 0 the whole time.

    What happens

    1. On a timely completion, chat/turnComplete is immediately followed by keep_awake: Session became idle, the idle hooks run, and agent_idle is created.

    2. On a failed completion, no idle is emitted. The backend falls back to remote root idle reconciliation, which never settled in 259 attempts (work_qualified=false):

      Reason Count
      work_state_unqualified 88
      delivery_changed 48
      host_not_idle 44
      tracked_work 40
      stale_snapshot 37
      send_in_flight 2

      After the first rejection, later probe_session_liveness requests (10k+) never re-run reconciliation.

    3. The frontend liveness watchdog (the Queued messages can get stuck while an inactive session remains in Running state after completion #3525 / macOS 1.1.22: sessions fail to report completion, queueing fails, and work appears stalled #4031 / Queued user messages are silently dropped and missing from durable session history #3590 fix) can't repair it. Its probe-result handler returns early for remote execution locations, before the isRunning === false → setSessionLoading(false) idle repair that local sessions get. One stuck session was probed about 4,500 times over 38 h with no effect.

    4. Once one idle is missed, more follow. The app treats the session as busy and queues the next message as chat/pendingMessageSet. That produces a host-originated copilot-turn-* turn, and those got a timely notification only 25% of the time, versus 68% for app-dispatched turns. Coordinated cross-session fan-out makes this common.

    Example: a host turn completes, reconciliation rejects it, and no idle or notification follows. agent_idle for that session was created only ~2 h later, at the next host reconnect.

    INFO remote event pump: translated action action_type="chat/turnComplete" action_detail=turn_id=copilot-turn-40729a85…
    INFO idle_reconciliation: remote root idle reconciliation input_source="root_summary_read" … work_qualified=false reason="tracked_work"
    

    Suggested fixes

    1. When the host reports the root idle, emit session.idle and create the agent_idle activity on a remote chat/turnComplete. Fix the reconciliation qualification; it never succeeds here.
    2. Let the frontend watchdog apply the existing idle repair to remote sessions when the probe or backend reports not running, and re-run reconciliation on probes.
    3. dispatch_backfill logs "skipping SessionHistoryBackfillComplete — delivered history will clear the FE spinner" on every reconnect even when no history was delivered. It should not skip in that case.
    4. Minor: chat/backgroundWorkSet and chat/backgroundWorkRemoved translate to 0 frontend events, and remote read_bash returns terminal content. The frontend can then keep phantom running shells, which stop session.task_complete from clearing the loading state.

    Workaround: pressing Stop clears it when the host is already idle; for remote sessions it only sends an abort to the host and clears local state. Restarting the app also clears it.

    This issue looks like it was routed to the Azure DevOps canvas team. The bug is in the remote-session idle and liveness path, so it may need re-routing.

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions