Skip to content

perf: defer provider SDK imports for static scans - #1164

Open
AdemVessell wants to merge 1 commit into
NVIDIA:mainfrom
AdemVessell:codex/static-scan-provider-imports-865
Open

AdemVessell wants to merge 1 commit into
NVIDIA:mainfrom
AdemVessell:codex/static-scan-provider-imports-865

Conversation

@AdemVessell

Copy link
Copy Markdown

Static --no-llm scans still load the OpenAI and Anthropic SDKs and their adapters before the disabled LLM nodes return. This change defers those imports until LLM helpers need them and keeps sampling-control parsing available to static report provenance without importing chat clients. Analyzer registration and reporting behavior are unchanged. LangGraph startup remains outside this change. Refs #865.

Four fresh-process CLI regressions block provider SDK imports while checking clean scans, configured controls, disabled analyzer statuses and static findings. Local baseline/candidate reports agree apart from timestamps and generated finding IDs.

Validation on macOS arm64 / Python 3.13: lint, formatting, wheel build and 238 static/mocked integration tests pass. The full unit selection produced 27,002 passes and 10 environment-related failures. All 10 reproduced on pristine main and passed on both trees after correcting only local path and Unix-socket conditions; the original full run was not all green. I did not run the complete make test target because it includes live provider/agent checks that may incur charges. Live provider/agent behavior and cross-platform validation remain untested.

AI assistance was used to investigate, implement and verify this contribution.

Load provider client modules only when LLM helpers need them. Keep pure
sampling controls available to static provenance and retain existing
chat_models control exports.

Add fresh-process CLI regressions that reject provider SDK imports and
preserve controls, disabled analyzer statuses, coverage and findings.

Refs NVIDIA#865.

AI assistance was used to investigate, implement and verify this change.

Signed-off-by: Adem Vessell <ademvessell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant