Skip to content

feat: stream provider output to compatible channels#2412

Open
alanbulan wants to merge 1 commit intosipeed:mainfrom
alanbulan:feat/streaming-provider-ui-fallback
Open

feat: stream provider output to compatible channels#2412
alanbulan wants to merge 1 commit intosipeed:mainfrom
alanbulan:feat/streaming-provider-ui-fallback

Conversation

@alanbulan
Copy link
Copy Markdown

Summary

  • prefer StreamingProvider.ChatStream in the agent loop when the active channel supports incremental updates
  • add Pico channel streaming primitives plus message.delete handling so the web UI can render partial output safely
  • add focused regression tests for OpenAI-compatible stream deltas, Pico channel streaming, and agent-loop streaming dispatch

Why

Some OpenAI-compatible upstreams return choices[0].message.content = null for non-streaming chat completions while producing valid SSE text when stream=true. This change lets PicoClaw use the existing streaming-capable provider path and channel abstractions to surface partial output in the UI and avoid empty final responses on compatible channels.

Test plan

  • go test ./pkg/channels/pico -run 'Test(DeleteMessage_SendsDeleteEvent|BeginStream_SendsCreateAndUpdatesMessage)' -v
  • go test ./pkg/providers/openai_compat -run TestProviderChatStream_ParsesTextDeltas -v
  • go test ./pkg/agent -run TestProcessMessage_StreamsToChannelWhenProviderSupportsStreaming -v
  • make check (not run locally in this environment)
  • frontend typecheck / lint for web/frontend (dependencies not installed in this environment)

AI usage disclosure

This PR was prepared with AI assistance for code analysis, implementation drafting, and test scaffolding; all changes were reviewed and validated with targeted local tests before submission.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 7, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@alanbulan
Copy link
Copy Markdown
Author

alanbulan commented Apr 7, 2026 via email

@alanbulan alanbulan force-pushed the feat/streaming-provider-ui-fallback branch from b73febf to 1588896 Compare April 7, 2026 14:40
Prefer StreamingProvider responses in the agent loop when the active channel can consume incremental updates. Add Pico channel streaming primitives and message.delete handling so streamed turns can render progressively in the web UI while still preserving final LLM responses for normal turn completion.
@sipeed-bot
Copy link
Copy Markdown

sipeed-bot bot commented Apr 17, 2026

@alanbulan Hi! This PR has been inactive for over a week. If there's no update in the next 7 days, it will be closed automatically. If you're still working on it, just leave a comment to keep it open!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: agent domain: channel domain: provider go Pull requests that update go code type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants