fix(launch): guard zero-config default trio and report routing bundle in --dry-run#108
fix(launch): guard zero-config default trio and report routing bundle in --dry-run#108elyasmnvidian wants to merge 1 commit into
Conversation
|
WalkthroughThe CLI now fails fast for zero-config deterministic launches using non-OpenRouter providers, while explicit model overrides remain supported. Dry-run output also reports routing-profile bundles for Claude, Codex, and OpenClaw. ChangesRouting CLI behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/test_launch_claude_deterministic.py (1)
279-281: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the bundle path and route ID too.
This passes if only
route: bundleis rendered; assertrouting profiles: {yaml_path}andmy-routeto cover the stated dry-run contract.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_launch_claude_deterministic.py` around lines 279 - 281, Strengthen the assertions in the dry-run output test by verifying the bundle path includes both the routing profiles value using yaml_path and the route ID my-route, in addition to route: bundle; retain the existing assertion that route: single is absent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@switchyard/cli/launch_command.py`:
- Around line 121-126: Update the provider-guard bypass condition to return only
when args.model is set; do not treat args.weak_model or args.classifier_model as
opt-outs. Preserve deterministic routing and provider validation whenever only
the partial model overrides are provided.
In `@tests/test_launch_codex.py`:
- Around line 509-511: Remove the project-management tracker reference “NvBug
6401771” from the source comment near the deterministic default dispatch
behavior, while preserving the explanation that the zero-flag default trio is
OpenRouter-only and non-OpenRouter providers are rejected.
---
Nitpick comments:
In `@tests/test_launch_claude_deterministic.py`:
- Around line 279-281: Strengthen the assertions in the dry-run output test by
verifying the bundle path includes both the routing profiles value using
yaml_path and the route ID my-route, in addition to route: bundle; retain the
existing assertion that route: single is absent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8bb30082-4f92-4343-88cc-ddbba579a886
📒 Files selected for processing (5)
docs/guides/agent_launchers.mdswitchyard/cli/launch_command.pyswitchyard/cli/output.pytests/test_launch_claude_deterministic.pytests/test_launch_codex.py
… in --dry-run Signed-off-by: Elyas Mehtabuddin <emehtabuddin@nvidia.com> (cherry picked from commit 6109ae4) Signed-off-by: Elyas Mehtabuddin <emehtabuddin@nvidia.com>
a478815 to
6e5cd4a
Compare
Live before/after — launcher guard and dry-run bundle reportingThese are launcher-behavior fixes, so the reproduction is command output. Same commands on 1) 2) Zero-config launch on a non-OpenRouter endpoint —
Audit follow-up in this push: the guard now rejects any deterministic launch on a non-OpenRouter endpoint. It previously skipped itself when |
Two launcher fixes.
Zero-config launch on a non-OpenRouter provider now stops before it launches.
With no
--modeland no--routing-profiles,switchyard launch claude(andcodex/openclaw) uses the fixed default trio — stronganthropic/claude-opus-4.7, weakmoonshotai/kimi-k2.6, classifiergoogle/gemini-3.5-flash— which are all OpenRouter model ids. If your credentials resolve to a different provider (for example NVIDIA viaNVIDIA_API_KEY), those ids don't exist on that endpoint. The old code launched anyway and only failed on the first request. Now the launcher exits first with a message that names the trio, the resolved provider, and the way out: pass--modelfor a single model or--routing-profiles FILEfor a bundle, or setOPENROUTER_API_KEY.launch --dry-runnow labels a routing-profiles bundle as a bundle.Running a dry run with
--routing-profiles FILEprintedroute: single(the placeholder single-tier view). It now printsroute: bundle, the bundle path, and the routable ids read from the YAML.How to try it:
NVIDIA_API_KEY=... switchyard launch claude→ exits with the "OpenRouter-only" guidance instead of spawning.switchyard --routing-profiles routes.yaml -- launch claude --dry-run→ printsroute: bundle.Regression tests for both live in
tests/test_launch_claude_deterministic.py. The existing codex zero-flag test now points at an OpenRouter endpoint so it still exercises the deterministic dispatch path rather than tripping the new guard.