Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Foreground Bash calls promoted to local_bash tasks render with the Bot (subagent) icon while the Agents panel correctly excludes them #10375

ClosedLuzivog(GitHub profile, opens in a new tab) opened this issue 1 comment

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Summary

When a Claude Code foreground Bash call runs longer than ~2 s, Claude Code registers it as a local_bash task and emits task_started / task_completed system messages for it. T3 ingests those as task.started / task.completed activities, correctly stamps them agentKind: "background", and correctly keeps them out of the Agents panel. But the timeline renders the resulting work row with the Bot (robot) icon, because the icon picker keys on "has a taskId" rather than on the agentKind stamp. The user sees a robot row in the transcript, looks for the subagent in the Agents panel, and finds nothing.

So the two surfaces disagree: the Agents panel says "not an agent", the timeline row says "agent". The comment on the icon rule even says these rows are "subagent lifecycle rows", which is only true for agent-kind tasks.

Related but distinct: #9107 is about background-from-start shells being invisible. This report is about foreground shells that get task-promoted showing agent chrome they should not have.

Steps to reproduce

  1. Open a thread using the Claude Code provider.
  2. Have the agent run any foreground Bash command that takes more than ~2–3 s, e.g. sleep 5 && exit 2 (a non-zero exit makes the tint obvious, but the icon is wrong either way).
  3. Watch the timeline after the command finishes.

Expected behavior

The task lifecycle row for a local_bash task should render with the same terminal/command chrome as the Bash call it belongs to (or be folded into that Bash row). The Bot icon should be reserved for rows whose task is classified agentKind: "agent", matching what the Agents panel shows.

Actual behavior

A separate collapsed row appears with the Lucide Bot icon, titled with the Bash call's description, and with the same description repeated as the monospace detail line. On a failed exit the icon is tinted with the failed-tool colour, so it reads as an orange/red robot. The Agents panel shows no agent for it.

Activity sequence recorded for one such call (ids elided), all sharing one toolUseId:

tool.started    itemType=command_execution  title="Command run"            (Bash)
tool.updated    itemType=command_execution  status=inProgress
task.started    taskType=local_bash agentKind=background title=<Bash description>  detail=<Bash description>   (~3 s after tool.started)
task.completed  taskType=local_bash agentKind=background status=failed tone=error
tool.updated    itemType=command_execution  status=failed
tool.completed  itemType=command_execution  status=failed

The Bash row itself renders fine with the terminal icon. The extra robot row comes from the task.* pair.

Where the icon decision comes from (main @ 223ff44)

Claude Code side, for context: a foreground Bash that passes ~2 s of wall time is registered as a local_bash task (isBackgrounded: false) so it can offer backgrounding; the task_started payload's description is the Bash tool's description argument, which is why title and detail are the same string.

Suggested fix

In workEntryIconName and toolGroupSummaryKind, treat entry.taskId as agent chrome only when the entry is not isBackgroundTask (or when the payload's agentKind === "agent"). Background task rows could use "terminal" when taskType is in MONITOR_TASK_TYPES, or simply fall back to the tone icon. Alternatively, fold local_bash task rows into the parent Bash row keyed by toolUseId, since they carry no information the Bash row does not already have.

Impact

Cosmetic issue

Version or commit

Server: t3 0.0.39-nightly.20260905.1290. Source references above are against main @ 223ff44.

Environment

Linux host running t3 serve, accessed from the web UI in a desktop browser. Claude Code provider (CLI 2.1.263), model claude-fable-5-1.

Workaround

None needed; expanding the row shows it is just the Bash description, and the Agents panel is correct. The confusion is purely the icon.

  1. Triaged against main @ 223ff44. Confirmed, not a duplicate of #9107.

    What’s going on

    Claude Code registers a long-running foreground Bash call as a local_bash task (isBackgrounded: false) so it can offer backgrounding. Ingestion already stamps that agentKind: "background" and the Agents panel correctly excludes it (isBackgroundTaskActivity → agentKind !== "agent").

    The extra timeline row is the task.completed activity. deriveWorkLogEntries drops non-agent task.started but still emits unattributed task.completed. That entry gets a taskId and isBackgroundTask: true, then never folds into the Bash tool row (toolCallId is forced null on task activities). workEntryIconName / toolGroupSummaryKind then treat “has a taskId” as subagent chrome and render the Lucide Bot icon — the comment even calls these “subagent lifecycle rows,” which is only true for agentKind: "agent".

    So the two surfaces disagree: Agents says “not an agent,” the transcript says “agent.”

    Not #9107 / #10295

    #9107 is the opposite shape (background-from-start shells are invisible). Open PR #10295 folds task rows into the tool row only for run_in_background / isBackgrounded shells and explicitly leaves foreground shells alone. That PR will not fix this icon.

    Suggested fix

    1. Minimum: in workEntryIconName and toolGroupSummaryKind, use Bot / agent-tool only when the entry is not a background task. Lift isBackgroundTask (or agentKind) onto WorkLogEntry / WorkLogPresentationEntry so those paths can see the stamp that session-logic already sets. local_bash can use "terminal" (or the tone icon).
    2. Optional, coordinate with #10295: fold a local_bash task row into the parent Bash row by toolUseId when that tool row already exists. Do not hide all background task.* rows — waiting/cancelled/interrupted progress still needs them, and #9107 depends on them when there is no live tool row.

    Mobile does not use the taskId → Bot shortcut, so the robot/Agents mismatch is web-specific. Cosmetic / low severity; expanding the row shows it is just the Bash description.

    Labels: bug, via-triage (removing needs-triage)

  2. juliusmarminge added labelsvia-triage

  3. juliusmarminge added labelsbug

  4. juliusmarminge closed this

Sign in to join this conversation.