feat: stream provider output to compatible channels#2412
Open
alanbulan wants to merge 1 commit intosipeed:mainfrom
Open
feat: stream provider output to compatible channels#2412alanbulan wants to merge 1 commit intosipeed:mainfrom
alanbulan wants to merge 1 commit intosipeed:mainfrom
Conversation
|
|
Author
|
请提前发送5个同学或者是5群聊 关注公众号:高中文案会 截图,否则拒收,毕竟我一分钱也不收,最起码要一点回报。
|
b73febf to
1588896
Compare
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.
|
@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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StreamingProvider.ChatStreamin the agent loop when the active channel supports incremental updatesmessage.deletehandling so the web UI can render partial output safelyWhy
Some OpenAI-compatible upstreams return
choices[0].message.content = nullfor non-streaming chat completions while producing valid SSE text whenstream=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)' -vgo test ./pkg/providers/openai_compat -run TestProviderChatStream_ParsesTextDeltas -vgo test ./pkg/agent -run TestProcessMessage_StreamsToChannelWhenProviderSupportsStreaming -vmake check(not run locally in this environment)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.