anomalyco / anomalyco/opencode
TUI: generic plugin tools don't show their live title while running
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Problem
A plugin tool can report progress with ctx.metadata({ title }) while it runs. The TUI only renders that state.title for task sub-tools. For any other tool coming from a plugin, GenericTool (packages/tui/src/routes/session/index.tsx) always shows the tool name plus its input, so the row stays frozen on something like ⚙ my_tool [arg=…] for the whole run even though the plugin keeps updating the title.
Expected
While a generic tool is running and has a state.title, show that title (as Task already does); fall back to the input when there is none. Completed tools are unaffected.
Repro
- Write a plugin tool that calls
ctx.metadata({ title: "step 1/3" }), then laterctx.metadata({ title: "step 2/3" }), during a multi-secondexecute. - Run it from the TUI.
- The row never changes until the tool completes.
Notes
Six-line change in GenericTool; I have it ready and will open a PR referencing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read GenericTool in packages/tui/src/routes/session/index.tsx and compare its running-state display with the Task sub-tool. Ensure a running generic tool shows state.title when available and otherwise retains its input display; completed tools should remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100