-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
When tools execute long-running operations (shell commands, file processing), the agent and UI receive no feedback until the operation completes. This creates poor UX for:
- Build commands that take minutes
- Large file operations
- Network requests with slow responses
Concrete example from foreman: Running npm test during implementation can take 30+ seconds. Users see no progress until completion.
Proposal
Add streaming support for tool results:
// Tool interface extension
type StreamingTool interface {
Tool
ExecuteStream(ctx context.Context, inputs map[string]any) (<-chan ToolChunk, error)
}
type ToolChunk struct {
Data string
IsFinal bool
Metadata map[string]any
}
// SDK emits events as chunks arrive
s.OnEvent(sdk.EventToolOutput, func(e *sdk.Event) {
chunk := e.Data.(*sdk.ToolOutputEvent)
// Stream to UI
})General Utility
- CI/CD agents - Build and test output streaming
- Data processing - Progress indicators for large operations
- Interactive shells - Real-time command output
Acceptance Criteria
-
StreamingToolinterface for tools that support streaming -
EventToolOutputevent type for streaming chunks - Built-in shell tool supports streaming stdout/stderr
- Non-streaming tools continue working unchanged
- Integration test demonstrating streaming behavior
Priority
Medium - Improves UX but not blocking for MVP.
Labels
enhancement, sdk, priority:medium
Metadata
Metadata
Assignees
Labels
No labels