anomalyco / anomalyco/opencode
[FEATURE]: Custom tools: Support incremental output streaming during execution
@jlongster is already working on this.
Since Jul 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
Custom tools can only return a complete result from execute() — there's no mechanism to stream incremental output to the TUI while the tool is running. Built-in tools like bash stream stdout/stderr progressively, but custom tools show nothing until they finish.
Current behavior
tool-callevent → tool entersrunningstate- (silence)
tool-resultevent → full output appears at once
Expected behavior
Custom tools should be able to emit incremental output during execution, rendered progressively in the TUI.
Use case
Any custom tool that dispatches long-running commands (test suites, builds, deployments, remote execution) produces output over minutes. The user needs to see progress to know the tool is working and to catch issues early.
Possible approaches
- Streaming HTTP response — the tool reads a chunked/SSE response and the framework renders chunks as they arrive
- Plugin API extension — add a
streamcallback toToolContextthat the tool can call incrementally (similar to howctx.metadata()works for metadata) - Polling — the tool periodically updates output via a new
ctx.output()method
Context
The bash tool achieves streaming through special processor handling that captures child process stdout/stderr incrementally. Custom tools have no equivalent path — execute() returns Promise<ToolResult>, a single value. The ctx.metadata() method (added in #7590) streams metadata but not the actual output content.
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.
Assessment
This issue has not been assessed yet.