Repository navigation
Conversation
feat commit 552f056 added match_materials_to_script to VideoParams and wired it through task.py, but VideoTermsParams was not updated and the /terms controller still calls generate_terms() without match_script_order. As a result the /terms REST endpoint always generates relevance-ordered terms, even when callers set match_materials_to_script=true, and the chronological prompt branch in generate_terms() is never reachable through the API. Add match_materials_to_script: bool = False to VideoTermsParams and pass it as match_script_order to generate_terms() in the controller. Default is False so existing callers are unaffected.
Owner
|
Thank you for catching this gap and for the clear explanation. I verified the API path locally with a small FastAPI smoke test: when This has been merged. |
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.
What's the bug
Commit 552f056 added
match_materials_to_scripttoVideoParamsand correctly wired it throughtask.py→material.py. ButVideoTermsParamswas not updated, and the/termscontroller still callsgenerate_terms()withoutmatch_script_order.Result: calling
POST /api/v1/llm/termswith"match_materials_to_script": truesilently ignores the flag —generate_terms()always uses the relevance-ordered prompt, never the chronological one.Root cause
VideoTermsParamsalso has nomatch_materials_to_scriptfield, so the body field is dropped at parse time even if a caller sends it.Fix
Two changes:
app/models/schema.py— addmatch_materials_to_script: bool = FalsetoVideoTermsParamsapp/controllers/v1/llm.py— passmatch_script_order=body.match_materials_to_scripttogenerate_terms()Default is
False, so existing callers are completely unaffected.How I found it
I was doing a commit-by-commit review of recent changes using a static analysis tool I built for catching inter-module gaps like this — where a new field added to one schema doesn't get propagated to sibling schemas. The tool flagged that
VideoTermsParamswas not updated alongsideVideoParamsin 552f056. I then manually traced the call path (VideoTermsRequest→ controller →generate_terms()) to confirm the flag was silently dropped end-to-end.(Happy to share more about the tool if you're curious.)
Test