Skip to content

feat: add streaming support for LLM responses #423

@njbrake

Description

@njbrake

Summary

Add streaming support to clawbolt's LLM calls so users see responses as they're generated rather than waiting for the full completion. This would improve perceived latency in the Telegram UX.

Context

All 5 current acompletion call sites use non-streaming (stream=None). As part of #422 we're migrating to the Messages API (amessages), which supports streaming natively. Streaming should be implemented as a separate effort after that migration lands.

Scope

  • Stream agent loop responses to Telegram as they arrive (primary value)
  • Evaluate whether compaction, heartbeat, and vision calls benefit from streaming (likely not, since they're short internal calls)
  • Handle partial tool call chunks correctly in the agent loop
  • Consider Telegram API rate limits for message editing (progressive updates)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions