Skip to content

feat: add real streaming to agentic tool loop (phase 2) #56

@pavelanni

Description

@pavelanni

Summary

Add real token-by-token streaming to the agentic tool loop
(pkg/tools/loop.go) so phase 2 responses stream from the provider
instead of using simulated word-by-word chunking.

Context

Issue #44 adds StreamWithTools to the provider interface. The first
iteration (PR TBD) implements real streaming for phase 1 (no tools)
and keeps simulated streaming for phase 2 (tool loop). This issue
tracks the follow-up to make phase 2 streaming real.

What needs to change

  • RunToolLoop accepts a streaming callback parameter
  • On the final iteration (when StopReason == EndTurn), use
    StreamWithTools instead of CompleteWithTools and pipe text
    deltas through the callback
  • All consumers benefit: OpenAI API, Chat TUI, A2A server

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions