Problem/Context
Currently, when an agent executes a bash command in the TUI, there is no visual indicator to show whether the command is still running or has finished. Users might be left wondering if the process is stuck or if it's still generating output.
Acceptance Criteria
Implementation Details
- Extend
ToolProps: Update the ToolProps interface in packages/opencode/src/cli/cmd/tui/routes/session/index.tsx to include the tool call status.
- Pass Status to Tools: In the
ToolPart component, pass the status from props.part.state.status to the dynamic tool component.
- Update
ToolTitle: Modify the ToolTitle component to accept an optional loading prop. When loading is true, display a spinner.
- Theming: The spinner should use the agent's color, which can be retrieved via
local.agent.color(props.message.mode).
- Bash Tool Integration: Update the
BashTool registration to pass loading={props.status !== 'completed' && props.status !== 'error'} to its ToolTitle.
Code References
- Tool Rendering Logic:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (around line 1649)
- Bash Tool Definition:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (around line 1792)
- Agent Color Logic:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (around line 1528)
- Existing Spinner Frames:
packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx (line 30)
Tasks
Problem/Context
Currently, when an agent executes a bash command in the TUI, there is no visual indicator to show whether the command is still running or has finished. Users might be left wondering if the process is stuck or if it's still generating output.
Acceptance Criteria
Implementation Details
ToolProps: Update theToolPropsinterface inpackages/opencode/src/cli/cmd/tui/routes/session/index.tsxto include the tool call status.ToolPartcomponent, pass thestatusfromprops.part.state.statusto the dynamic tool component.ToolTitle: Modify theToolTitlecomponent to accept an optionalloadingprop. Whenloadingis true, display a spinner.local.agent.color(props.message.mode).BashToolregistration to passloading={props.status !== 'completed' && props.status !== 'error'}to itsToolTitle.Code References
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx(around line 1649)packages/opencode/src/cli/cmd/tui/routes/session/index.tsx(around line 1792)packages/opencode/src/cli/cmd/tui/routes/session/index.tsx(around line 1528)packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx(line 30)Tasks
loadingsupport toToolTitle.BashTool(and potentially other long-running tools likeWebFetchTool).