fix: validate graph sink nodes before stream start (#947)#948
Open
livepeer-tessa wants to merge 2 commits intomainfrom
Open
fix: validate graph sink nodes before stream start (#947)#948livepeer-tessa wants to merge 2 commits intomainfrom
livepeer-tessa wants to merge 2 commits intomainfrom
Conversation
added 2 commits
April 15, 2026 06:16
Attempting to uninstall a bundled plugin is an expected, handled condition — not a server-side failure. This was generating ERROR-level log noise on every prod fal.ai job that triggered the cleanup path (issue #837). Changes: - Add PluginBundledError(PluginInstallError) subclass in manager.py so callers can distinguish bundled-rejection from true install failures - Raise PluginBundledError instead of PluginInstallError in _uninstall_plugin_sync when a bundled plugin is targeted - In app.py uninstall endpoint, catch PluginBundledError before the generic PluginInstallError handler: log at WARNING, return HTTP 400 (client error) instead of 500 (server error) Fixes: #837 Signed-off-by: Tessa (livepeer-tessa) <tessa@livepeer.org>
…sages Closes #947 Root cause: when a graph contains only Output nodes (Spout/NDI/Syphon) and all of them have outputSinkEnabled=false, the serialization step in flowToGraphConfig() skips them — leaving the backend graph with no sink nodes, which triggers 'Invalid graph: Graph must have at least one sink node' from frame_processor. Changes: - frontend/graphUtils.ts: add validateGraphForStream() utility that detects missing/disabled sink nodes and returns a human-readable error before the graph is submitted to the backend - GraphEditor.tsx: expose validateForStream() on GraphEditorHandle so StreamPage can call it before starting the stream - StreamPage.tsx: call validateForStream() in handleStartStream() for graph mode; show toast.error with actionable message instead of failing server-side - OutputNode.tsx: show amber warning banner when output node is disabled, prompting user to enable it or add a Sink node - graph_schema.py: improve the server-side error message to include remediation hint ('Add a Preview (Sink) node or enable an Output node') as a last line of defense - tests/test_graph_schema.py: add 10 unit tests for validate_structure() including the user-friendly error message requirement Signed-off-by: Tessa (livepeer-tessa) <tessa@livepeer.org>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI 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 |
Contributor
🚀 fal.ai Preview Deployment
Livepeer Runner
Testing Livepeer Mode |
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.
Problem
Closes #947
When a user's graph contains only Output nodes (Spout/NDI/Syphon) and all of them have the Enabled toggle off, the frontend's
flowToGraphConfig()skips them during serialization. The backend receives a graph with no sink nodes and throws:This was a cryptic server-side error with no UX guidance on how to fix it. Happened 1x on fal.ai prod at 15:58 UTC 2026-04-15 (job
0dddbac2).Root Cause
In
graphUtils.ts, Output nodes are inFRONTEND_ONLY_TYPES(filtered from backend serialization) and are only added back astype: "sink"nodes ifoutputSinkEnabled === true. A disabled Output node → no sink in the serialized graph.Fix
Frontend (before-the-server-gets-it):
validateGraphForStream(nodes, edges)utility ingraphUtils.tsthat detects missing/disabled sinksvalidateForStream()onGraphEditorHandlehandleStartStream()calls validation first → showstoast.errorwith actionable messageOutputNodeshows amber warning banner when disabledBackend (last-resort fallback):
graph_schema.pywith fix hintTests:
tests/test_graph_schema.pyall passingTesting
python -m pytest tests/test_graph_schema.py -v # 10 passedFor manual testing: create a graph with only an Output node (Enabled=off) and try to start streaming → should see toast error instead of server failure.