Skip to content

Claude background subagents still stay Running after their completion arrives in a wake continuation (0.1.2, follow-up to #17809) #24337

Open

Description

@theovelikov

Area

apps/server

Summary

#17809 was closed on Oct 22 as not reproducible on main. It still happens on the v0.1.2 release (macOS desktop app, Claude CLI 2.1.310, claude-opus-5-5, Claude Agent provider).

Timeline (one thread, event log + provider log)

Four background Agent calls (run_in_background: true, spawn_depth: 1) were all launched inside run 1 (07:56:52Z to 08:00:50Z). For one of them, native id a2eda89e0e1e87a18:

  • task_started at 07:59:22.379Z, in run 1. The first subagent.updated running was written at 07:59:22.415Z.
  • Run 1 ends with its result at 08:00:50Z.
  • Run 13 is a wake continuation, started at 08:54:25Z for another task's task_notification.
  • During run 13, at 09:05:24.220Z, the SDK sends task_notification {status: "completed"} for a2eda89e0e1e87a18, with its final summary. No task_started for this task appears after run 1.
  • The row never goes terminal. Another subagent.updated with status: running was written at 22:21:29Z, 13 hours after the completion. Server shutdown recovery at 01:21:55Z the next day finally cancelled it.

All four behaved the same way. Five more background subagents in three other threads on the same machine and day did too. They had all finished: each one's own transcript ends in a final end_turn answer or a user interrupt.

Background agents whose final notification was preceded by a fresh task_started (interim completions, SendMessage resumes) settled correctly.

Workarounds tried

  • subagent.stop on a stuck row is a no-op. The row stays running.
  • thread.stop on the idle parent thread ends the stuck rows (as cancelled) and leaves the thread usable. We run that from a watcher as a stopgap.

Related

Provider-log lifecycle frames for the thread are available on request.

Activity

  1. juliusmarminge commented on Oct 24, 2026

    @juliusmarminge
    Member

    Tested 3cc31ed27c in the Linux web dev app with Claude CLI 2.1.310 and claude-opus-5-5. Two native background agents launched during run 8. The first completion started wake run 9; the second completed while that wake was active, without another task_started, and its persisted row immediately became Completed. Lifecycle transcript.

    Please attach the redacted provider lifecycle frames you offered, from the original task_started through the completion during run 13, including intervening task_progress, task_updated, task_notification, and root result frames, plus the corresponding subagent.updated events. Those will let us compare the failing sequence with this successful overlap. Omit prompts, summaries, credentials, and unrelated transcript content.

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

    needs more infoInitial triage showed no bug. Awaiting more info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions