fix: accept legacy source/target edge keys in GraphEdge for backwards compat (#895)#900
Open
livepeer-tessa wants to merge 1 commit intomainfrom
Open
fix: accept legacy source/target edge keys in GraphEdge for backwards compat (#895)#900livepeer-tessa wants to merge 1 commit intomainfrom
livepeer-tessa wants to merge 1 commit intomainfrom
Conversation
…ds-compat (#895) Old Scope clients send edge definitions using the deprecated 'source'/'target' key names instead of the current 'from'/'from_port'/ 'to_node'/'to_port' fields. This caused a pydantic ValidationError in scope.server.frame_processor, resulting in sessions starting but processing 0 frames (silent failure for users). Error was observed 4x in a 12 h window. Changes: - Add a model_validator(mode='before') on GraphEdge that detects legacy 'source'/'target' keys and transparently maps them to the current schema. - When port fields are absent, default from_port to 'video' and to_port to 'video' (matching the existing convention for simple linear graphs). - Log a WARNING with the raw edge data whenever legacy keys are coerced so operators can identify outdated clients in logs. - Add tests/test_graph_schema.py covering legacy-only, mixed, and current-only edge formats plus the deprecation warning emission. Fixes #895 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
Older Scope desktop clients send
GraphEdgepayloads withsource/targetkeys instead of the currentfrom/from_port/to_node/to_portschema. This triggered a pydanticValidationError(8 missing fields) inframe_processor, causing sessions to start but process 0 frames — a silent failure from the user's perspective.Observed 4 times in a 12 h window (2026-04-09 23:09–23:45 UTC), fal_job_id
d35991f0-7869-44ca-88b4-1459ad9c7774.Fix
Added a
model_validator(mode='before')toGraphEdgeingraph_schema.pythat:source/targetlegacy keysfrom/to_node(only when the canonical fields are absent)from_portandto_portto"video"when port info is missingWARNINGlog to help identify outdated clients in productionMixed payloads (partial legacy + current keys) are also handled.
Tests
Added
tests/test_graph_schema.pywith 10 test cases:source/targetminimal (no ports) — defaults tovideocaplogGraphConfigwith legacy edgesvalidate_structure()passes after coercionAll 10 pass; no regressions in broader suite.
Related
Fixes #895