Skip to content

Add direction parameter to PipelineTask.queue_frame() and queue_frames()#3883

Merged
aconchillo merged 2 commits intomainfrom
aleix/queue-frame-direction
Mar 1, 2026
Merged

Add direction parameter to PipelineTask.queue_frame() and queue_frames()#3883
aconchillo merged 2 commits intomainfrom
aleix/queue-frame-direction

Conversation

@aconchillo
Copy link
Copy Markdown
Contributor

@aconchillo aconchillo commented Mar 1, 2026

Summary

  • Added optional direction parameter to PipelineTask.queue_frame() and PipelineTask.queue_frames(), defaulting to FrameDirection.DOWNSTREAM (existing behavior)
  • When set to FrameDirection.UPSTREAM, frames are pushed directly from the pipeline sink (end of the pipeline) instead of going through the downstream push queue
  • Stored the pipeline sink as self._sink on PipelineTask to support upstream frame injection

Testing

  • uv run pytest tests/test_pipeline.py::TestPipelineTask::test_task_queue_frame_upstream
  • uv run pytest tests/test_pipeline.py::TestPipelineTask::test_task_queue_frames_upstream

🤖 Generated with Claude Code

aconchillo added a commit that referenced this pull request Mar 1, 2026
aconchillo added a commit that referenced this pull request Mar 1, 2026
@aconchillo aconchillo force-pushed the aleix/queue-frame-direction branch from 300b2d5 to 1f7bf8e Compare March 1, 2026 01:14
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/pipeline/task.py 88.88% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/pipecat/processors/frame_processor.py 86.05% <100.00%> (ø)
src/pipecat/pipeline/task.py 81.67% <88.88%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…eue_frames()

Allow pushing frames upstream through the pipeline by passing
FrameDirection.UPSTREAM. Downstream frames use the existing push queue,
while upstream frames are pushed directly from the pipeline sink.
@aconchillo aconchillo force-pushed the aleix/queue-frame-direction branch from 1f7bf8e to 94a59de Compare March 1, 2026 01:28
Copy link
Copy Markdown
Contributor

@markbackman markbackman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aconchillo aconchillo merged commit 903dc6c into main Mar 1, 2026
6 checks passed
@aconchillo aconchillo deleted the aleix/queue-frame-direction branch March 1, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants