Repository navigation
Conversation
This branch has not been deployed
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.
Please describe the changes in your PR. If it is addressing an issue, please reference that as well.
GatedLLMContextAggregatorforwardedStartFramedownstream twice. This PR makes it forward the frame exactly once. No linked issue — found while reading the processor, with a regression test.Why
In
process_frame()(src/pipecat/processors/aggregators/gated_llm_context.py:45), theStartFramebranch was a standaloneif:A
StartFrameis neither anEndFrame/CancelFramenor anLLMContextFrame, so after the first branch pushed the frame and started the gate task, control fell through to the catch-allelse(gated_llm_context.py:57), which pushed the same frame a second time.Every processor downstream of the aggregator then received two
StartFrames and re-ran its start handling — for exampleFrameProcessor.process_frame()creates its process task onStartFrame(src/pipecat/processors/frame_processor.py:836), andBaseOutputTransport.process_frame()callsstart()again (src/pipecat/transports/base_output.py:349).Changes
src/pipecat/processors/aggregators/gated_llm_context.py: theStartFramebranch now belongs to the sameif/elifchain as the other frame types (if→elif), so aStartFrameno longer falls through to the catch-allelse. One token changed.tests/test_aggregators.py: addedTestGatedLLMContextAggregator, which sends aTextFrameand a gatedLLMContextFramethrough the aggregator withignore_start=Falseand expects exactly oneStartFramedownstream.changelog/5910.fixed.md: changelog fragment.Testing
uv run pytest tests/test_aggregators.py::TestGatedLLMContextAggregator— fails onmain:passes with the fix:
Also run (
--no-syncbecause this environment has no network access; same project venv thatuv syncproduces):The full-suite run's 28 failures and 33 collection errors are byte-identical on unpatched
mainin this environment (missing optional service extras such asgoogle-genai,anthropic,httpx,fastapi), so this change introduces no regressions.