forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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
- A spinner indicator is displayed next to the bash command title while it is running.
- The spinner disappears once the command completes or fails.
- The spinner color matches the agent color (the color of the symbol next to the agent name).
- The indicator works for both short-lived and long-running bash commands.
Implementation Details
- Extend
ToolProps: Update theToolPropsinterface inpackages/opencode/src/cli/cmd/tui/routes/session/index.tsxto include the tool call status. - Pass Status to Tools: In the
ToolPartcomponent, pass thestatusfromprops.part.state.statusto the dynamic tool component. - Update
ToolTitle: Modify theToolTitlecomponent to accept an optionalloadingprop. Whenloadingis 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
BashToolregistration to passloading={props.status !== 'completed' && props.status !== 'error'}to itsToolTitle.
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
- Propagate tool call status to tool components.
- Add
loadingsupport toToolTitle. - Implement spinner in
BashTool(and potentially other long-running tools likeWebFetchTool). - Verify visual consistency with the agent color and sidebar spinner.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request