fix: wire video_presentation fan-in as a barrier so generate_slide_scene_codes fires once#1563
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
…ene_codes fires once
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closed
11 tasks
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.
Re-opening #1538 against the
devbranch as requested by @MODSetter.The video-presentation agent graph now uses a LangGraph list-based fan-in edge so the slide-generation node runs once after all upstream nodes complete, instead of once per incoming edge.
Description
The presentation node was wired to multiple upstream nodes with separate edges, so LangGraph triggered it once per completed predecessor rather than as a single join, producing duplicate slide-generation passes. This switches those edges to a list-based fan-in edge, which creates a proper barrier so the node runs exactly once.
Motivation and Context
Fixes #1531
Screenshots
N/A — backend agent-graph change with no visual surface.
API Changes
Change Type
Testing Performed
Added unit tests under
surfsense_backend/tests/unit/agents/that drive the graph and assert the fan-in node is triggered exactly once.Checklist
Summary by CodeRabbit
Bug Fixes
Tests
High-level PR Summary
This PR fixes a bug in the video presentation agent graph where the slide scene generation node was being triggered multiple times instead of once. The fix changes the fan-in pattern from separate edges to a single list-based barrier edge, ensuring that
generate_slide_scene_codesruns exactly once after bothcreate_slide_audioandassign_slide_themescomplete. Unit tests are added to verify the single-trigger behavior and execution order, including a test case that validates the barrier works correctly even when branches complete at different times.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
surfsense_backend/app/agents/video_presentation/graph.pysurfsense_backend/tests/unit/agents/test_video_presentation_graph.py