Repository navigation
Studio: name the Cosmos guardrail module outright so the risky-loader lint passes on main - #17041
Merged
Merged
Conversation
… lint passes on main
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Summary
Lint CI / Source lintfails on main at its "No new risky loader call sites" step, so every PR based on main fails it too. For example, a staging run of #16965, which does not touch this file:#16742 (the Cosmos3 guardrail refusal message) added
guardrail_hub_token. It wraps the guardrail package'ssnapshot_downloadso each load sends its own token. It imports that module withimportlib.import_module(f"{GUARDRAIL_PACKAGE}.{GUARDRAIL_PACKAGE}").scripts/lint_risky_loaders.pyflags anyimport_modulewhose name it cannot read as fixed, and an f-string reads as dynamic even thoughGUARDRAIL_PACKAGEis the constant"cosmos_guardrail". The import itself is safe and the PR's behaviour is correct. Only the form trips the guard.Change
studio/backend/core/inference/video_cosmos3.py: the import names the module outright,importlib.import_module("cosmos_guardrail.cosmos_guardrail"). That is the same module, and this is the lint's first suggested remedy ("load from a written-out name"). It keeps the baseline free of an entry that would have to be justified. No behaviour changes.Testing
python scripts/lint_risky_loaders.py117 risky loader call site(s), all recordedstudio/backend/tests/test_video_cosmos3.py, which coversguardrail_hub_tokenthrough acosmos_guardrail.cosmos_guardrailmodule stub: 195 passed.