Skip to content

Background agent task-notification reports status: "completed" while the task is still running #81048

Closed as duplicate

Description

@czf-veradigm

During a Claude Code session, a background agent task (Agent tool, subagent_type: fork) triggered a <task-notification> with status: "completed", including a full result summary — the normal signal that a background task has finished and is no longer running.

The task was in fact still running. The CLI's own background-task UI showed it as an active agent/shell well after the completion notification had arrived (over 50 minutes, per the shell's reported runtime). This was confirmed from within the session: calling TaskStop on an unrelated task ID returned an error listing "Running background agents," which included the task ID that had already reported status: "completed". Calling TaskStop on that ID directly succeeded, confirming the task was genuinely still alive.

An orphaned polling shell tied to the same agent (a while ! grep -q "..." ...output; do sleep 5; done loop) was also still running well past the point its exit condition should have resolved.

Impact: A status: "completed" task-notification cannot be relied on as confirmation that a background task has actually terminated. This can leave orphaned processes/shells running indefinitely with no further signal — discoverable only by manually checking the task list UI or TaskStop's error output.

Environment: Claude Code CLI on Windows, session using git worktrees with multiple concurrent background Agent (fork) tasks over a long-running session.

Activity

  1. bcherny commented on Aug 20, 2026

    @bcherny
    Collaborator

    Closing as a duplicate of #77284 — please follow and 👍 that issue instead so we can track it in one place. If you think this was closed in error, comment here and we'll reopen.

    🤖 Generated with Claude Code

  2. github-actions commented on Oct 11, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  3. locked as resolved and limited conversation to collaborators on Oct 11, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions