Skip to content

Background command card stays "Running" forever after a message edit replaced the Claude session #5481

Closed

Description

@anilgryphon

Summary

In a claude-code thread, a background shell command (Bash run_in_background) was running when a sent message in the thread was edited. BB started a new Claude Code session for the thread; the old process and its background command ended, but the background task was never completed in BB, so the thread still shows "Running background command: …" with its timer counting (over 24 h now). Expected: the task settles (interrupted or stopped) when the session that owned it is replaced, or the card can be dismissed.

Image Image

Versions and environment

  • bb 0.46.0 (desktop app, self-updating) now; the version at the time of the edit (2026-10-13 09:18 CEST) was not recorded
  • macOS 26.6.2, Apple silicon
  • claude-code provider, claude 2.1.296
  • project checkout environment on the local (server) machine; a second machine is enrolled but not involved

Steps to reproduce

Observed once; not reproduced on 0.46.0.

  1. In a claude-code thread, the agent starts a long background command (a ~25 GB download) with Bash run_in_background.
  2. While it runs, the user presses Escape on a turn and edits a sent message (edit_message, cutoff sequence 140146).
  3. BB records thread/identity with a new providerThreadId; the old Claude process ends, and the background command with it.

On 0.46.0, bb thread edit-message with an open background task returns HTTP 409: Wait for background work to finish before editing the message, so step 2 could not be recreated through the CLI.

Did not reproduce with (0.46.0, scratch thread): bb thread stop mid-turn (the task settles as interrupted); ending the thread's claude process and sending a new message (the same session is resumed and the task settles as interrupted). Not tested: Escape plus an edit through the desktop UI on 0.46.0.

Expected vs actual

Actual, from `bb thread log thr_su4uzy5jq8 --json`:

seq 140033  10-13 08:58  item/started            backgroundTask status=pending "Pull the vanilla macOS Tahoe VM image"  providerThreadId 672dd832…
seq 140171  10-13 09:18  system/operation        edit_message completed (cutoffSequence 140146)
seq 140173  10-13 09:18  thread/identity         providerThreadId 27cbdd8d…
(no item/backgroundTask/completed for that task afterwards)

UI on 2026-10-14: "Running background command: Pull the vanilla macOS Tahoe VM image 24h 45m 20s". No such process exists on the machine.

Expected: an item/backgroundTask/completed (interrupted or stopped) when the session that owned the task is replaced, as already happens for `bb thread stop`.

Evidence

  • Thread ids: thr_su4uzy5jq8 (affected thread); thr_5rqcvr6ty8 (scratch repro attempts on 0.46.0: background task started at seq 26, 81 and 117; settled as interrupted at seq 68 and 91).
  • After the switch, the new Claude Code session reported the task (its own id blwnt876v) as having not finished before the previous session ended, so the provider knew; BB never recorded a completion.
  • Related: Fix orphaned background command activity #1736 settles open background tasks when a successful thread stop unloads the runtime. A session replaced by a message edit seems not to be covered, at least before the 409 guard.

What you ruled out

  • Not Fix orphaned background command activity #1736: that covers thread stop; here the task outlived an edit that replaced the session.
  • Not a live process: none exists on the machine, and the new Claude session's own task stop reports no such task.
  • New cases may already be prevented by 0.46.0's edit guard (409); the existing orphaned card still cannot be cleared.
  • Suggested priority: Low. A stale card with a misleading timer; no data or work lost. A cleanup on thread/identity change, or a way to dismiss orphaned cards, would fix it.

AGENT GENERATED: by lab-chief (Claude Opus 5.5, claude-code) in the reporter's bb thread thr_su4uzy5jq8 (private).

Suggested priority and effort (optional)

No response

Checks

  • I reproduced this on the latest release or on main, or I say above that I could not.
  • I searched open and closed issues for the same problem.
  • If an agent wrote this, the body ends with > AGENT GENERATED and links the thread or report.

Activity

  1. added theissue type on Oct 14, 2026
  2. added
    threads
    provider-claude-code
    partial-repro
    on Oct 14, 2026
  3. bb-slop-cop commented on Oct 14, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority Low · Effort Medium. Added threads and provider-claude-code; no existing classifications were replaced.
    • Report: https://get-bb.github.io/reports/issues/5481.html
    • Verdict: PARTIALLY REPRODUCED · root-cause confidence medium · reproduction label partial-repro.
    • Finding: In two clean checkouts of trusted main, a replacement provider identity leaves the earlier command counted as active without a terminal task event. Identity ingestion does not reconcile those task records; current message edits reject active background work with HTTP 409.
    • Evidence: Both focused runs show zero completions and one active command after identity replacement; 65 existing reconciliation/edit tests pass. The historical desktop edit and actual old-process termination remain unverified.
    • No PR: The original edit trigger was not reproduced on main; changing identity-only cleanup without confirmed runtime teardown does not meet the safe simple-fix gate.
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

    partial-reproprovider-claude-codethreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions