fix: pass explicit argv to CLI entrypoint - #800
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
Exact-head review complete at a2a3edc. The branch is a clean stack on PR #789 (base corrected from main to feat/auto-embedding-model-selection); the effective diff is only the explicit argv CLI boundary and its regression. Local proof: 13 tests passed (CLI auth plus API contract), Ruff, compileall, and git diff --check passed. Auto-merge is being armed; protected approval and hosted Checks remain required. |
|
Stack reconciliation completed at exact HEAD 365442b (verify live SHA). Current PR #789 commits are now integrated without dropping its auto-discovery startup behavior; explicit argv is preserved and the effective stack diff remains the CLI boundary plus its regression. Local proof on the reconciled tree: 50 tests passed across CLI/API, discovery, embedding, and security suites; Ruff, compileall, and git diff --check passed. Hosted Checks are re-running on this exact head; protected auto-merge remains enabled and still requires independent approval. |
| if args.auto_discover_model_agents: | ||
| _auto_discover_runtime_agents(orchestrator) |
There was a problem hiding this comment.
🟡 Startup model discovery runs twice, doubling provider queries
When automatic model discovery is requested, the discovery routine is invoked twice back-to-back (_auto_discover_runtime_agents(orchestrator) at contextual_orchestrator/__main__.py:361-362) instead of once, so the server contacts every provider and re-syncs agents a second time for no reason.
Impact: Every server startup with auto-discovery enabled makes a redundant full round of provider network calls and agent syncing, wasting time and provider quota and doubling the chance of a startup failure.
Duplicated conditional block introduced by the PR
The original code had a single guarded call. This PR added an identical second copy:
if args.auto_discover_model_agents:
_auto_discover_runtime_agents(orchestrator)
if args.auto_discover_model_agents:
_auto_discover_runtime_agents(orchestrator)_auto_discover_runtime_agents (contextual_orchestrator/__main__.py:254-262) calls discover_all_models() (provider queries) and orchestrator.sync_discovered_agents(...), both of which now execute twice. This duplication is unrelated to the PR's stated intent (passing explicit argv) and is almost certainly an accidental bad merge/edit.
| if args.auto_discover_model_agents: | |
| _auto_discover_runtime_agents(orchestrator) | |
| if args.auto_discover_model_agents: | |
| _auto_discover_runtime_agents(orchestrator) |
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Review repair at current HEAD |
Why
The local bootstrap wrapper had to replace
sys.argvbefore importing the CLI entrypoint. That made the authenticated server invocation implicit and prevented a reliable local orchestrator boundary.Change
argvparameter tocontextual_orchestrator.__main__.mainLineageWeave can now call the upstream entrypoint without monkey patching.
Verification
uv run pytest tests/test_cli_auth.py -q