Repository navigation
fix(web): show the running icon on threads with a live background command - #18811
Closed
StanMan007 wants to merge 2 commits into
Closed
StanMan007 wants to merge 2 commits into
StanMan007 wants to merge 2 commits into
Conversation
…mand Background Bash commands an agent leaves running (kind "command") do not hold a thread's status, so the sidebar row reads as finished while the composer still shows "Running: …" with a Stop button. Reuse the existing pulsing terminal icon for these commands, with a tooltip naming the command. Clicking opens the integrated terminal when there is one, otherwise the thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, focused web UI fix that reuses existing background-task state and terminal controls to expose work the product already tracks. It introduces no schema, configuration, infrastructure, or static-analysis changes, and includes targeted coverage for the new display and interaction paths. You can add or adjust custom eligibility rules. Learn more. |
Contributor
Author
|
Closing in favor of #15413, which moves threads with a live background command into the Working section. That covers the case this PR was addressing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a Claude agent leaves a background Bash command running (SDK
local_bash, pending task kind"command") and ends its turn, the thread row in the sidebar looks finished. Meanwhile the open thread's composer showsRunning: <command> · Stop. Command tasks deliberately don't hold completion (backgroundWorkHoldsCompletion, per #13965), so the row loses its last sign of live work. Users read the thread as dead while it still owns a running process.Fix
Reuse the existing pulsing teal "terminal process running" row icon for live command tasks. Thread status, completion alerts and auto-settle are unchanged.
resolveThreadRunningProcessLabel(Sidebar.logic.ts) builds the tooltip:N terminal processes running and N background command(s) running. Open terminalRunning: <description>. Open threadN background commands running. Open threadThreadTerminalStatusButtonrenders when either source is live. Clicking it reveals the terminal when one exists; otherwise it opens the thread, where the composer's Stop control lives.background_taskwork already holds the thread's Waiting status, so it doesn't add the icon.SidebarandLegacySidebarpass the thread'spendingBackgroundTasks, the same roster that drives the composer banner.Why this qualifies as a small, focused fix
The roster already knows the command is alive, and the composer shows it, but the sidebar row drops it. This PR only surfaces that state through an indicator that already exists. It adds no new status, setting, server change or contract change. It also stays out of the contested status/alert/auto-settle question in #15099, #17625, #18062 and #15413. Those PRs and issues are about whether a command should hold completion. This one only stops the row from hiding work that is already tracked.
Verification
Reproduced in a local dev build with an isolated home directory with Claude Opus 5.5. The prompt asked Claude to run
sleep 900via Bash withrun_in_background: trueand the description "Serve preview on port 4173", then end its turn.Running: Serve preview on port 4173 · Stop.Running: Serve preview on port 4173. Open thread.The screenshots are cropped to hide the machine hostname. They are hosted on the fork, not committed here.
Focused checks:
vp test run apps/web/src/components/Sidebar.logic.test.ts: 150/150. New cases cover the label for command-only, several commands, terminals plus commands, and other task kinds.vp test run apps/web/src/components/ThreadStatusIndicators.terminal.test.tsx(new, jsdom): 5/5.background_taskrows render no button.terminalId === undefinedrender guard fails the first test.vp linton the changed files: no new findings.vp fmt --check: clean.vp run --filter @t3tools/web typecheck: passes.Not checked: mobile thread rows, which this PR doesn't touch; a packaged desktop build; Codex or other providers' background work, since only Claude emits kind
"command"today.Known pre-existing gap, now more visible
After Restart agent session, or archive then unarchive, the process is killed, but nothing clears the thread's pending roster. Session release doesn't touch it (
ProviderSessionManager.ts,writeReleaseRecords). I reproduced this live: after the restart,sleep 900was gone, but the composer'sRunning: … · Stopbanner stayed, on main and on this branch. With this PR the row icon stays too, because it reads the same roster. The fix belongs in server session cleanup, so I've kept it out of this PR (see Follow-ups).Follow-ups
Model and harness: Claude Opus 5.5 via Claude Code, running in T3 Code.
🤖 Generated with Claude Code