feat(streaming): propagate provider lifecycle events through agent and SSE#54
Draft
vadimcomanescu wants to merge 9 commits intodanshapiro:mainfrom
Draft
Conversation
(cherry picked from commit c0110c630859508ce3390cf976cd11e8a06fbb6b)
(cherry picked from commit 1a57a2ca640d65457fa663e9548d41c9be22ab53)
(cherry picked from commit 23f3ce1e2329597b204b530bc23b1f817b5266c2)
(cherry picked from commit a878921adc2555db9062b721489e2ba79df618c6)
Switch one_shot mode from Complete() to Stream() with StreamAccumulator, add throttled progress emitter (100ms batched text deltas, immediate tool call events), emit AssistantMessage CXDB turns from both agent_loop and one_shot paths, and tag all progress events with backend:"api" for CLI/API parity. (cherry picked from commit 9cb2b2014b37e7d3d6c3c96ae09c29671c959e40)
(cherry picked from commit 2670b7d7933d2b238cdc884d8490bf2a221682ba)
(cherry picked from commit 72bafbf015fd60441787e9493dfbc149c03a3396)
(cherry picked from commit 200fd7afb75b7576e7c3df9d80ff1dcdd253f61f)
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
This PR standardizes streaming lifecycle handling across provider events, agent session state, and SSE progress output.
Depends On
Problem
Why This Change
Streaming is part of the runtime contract. Event semantics must be consistent from provider adapters to agent session state and outward-facing SSE streams.
What Changed
User-Visible Behavior
Risk
Validation
gofmtandgo vet ./...go test ./internal/agent -run 'TestSession_ProviderToolLifecycleEvents_DoesNotDuplicateOutputDeltaWhenProviderStreamsAndAggregates|TestSession_StreamFinishWithoutResponse_PreservesToolCalls' -count=1go test ./internal/llm -run 'TestParseCodexAppServerToolLifecycle|TestParseCodexAppServerToolOutputDelta|TestStreamAccumulator_' -count=1go test ./internal/attractor/engine -run 'TestEmitStreamProgress_|TestCodergenRouter_RunAPI_OneShot_' -count=1Out of Scope