-
Notifications
You must be signed in to change notification settings - Fork 250
feat(runner): accept subagents on an llm_classifier route (#493)
#635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -743,7 +743,7 @@ confidence_threshold = 0.5 | |
| } | ||
|
|
||
| #[test] | ||
| fn passthrough_and_stage_accept_subagent_routing() -> RunnerResult<()> { | ||
| fn parent_routes_accept_subagent_routing() -> RunnerResult<()> { | ||
| let stage = stage_config(); | ||
| let stage_with_classifier = with_subagent_llm_classifier(&stage, "stage", ""); | ||
| let parsed: DeploymentConfig = toml::from_str(&stage_with_classifier).map_err(|error| { | ||
|
|
@@ -757,11 +757,41 @@ confidence_threshold = 0.5 | |
| assert!(callable_targets.contains(&expected)); | ||
| } | ||
|
|
||
| // An llm_classifier parent ends up with two judges once it nests a sub-agent route: | ||
| // its own and the child's. Renaming the parent's tells them apart. The exact vector | ||
| // pins that the child's targets are appended rather than merely present -- the child | ||
| // reuses the parent's own `strong`/`weak`, so `contains` cannot see the difference. | ||
| let base = VALID_CONFIG.replace( | ||
| "classifier_target = \"classifier\"", | ||
| "classifier_target = \"parent_judge\"", | ||
| ) + "\n[targets.parent_judge]\nid = \"parent-judge/model\"\nllm_client = \"primary\"\n"; | ||
| let classifier_with_classifier = with_subagent_llm_classifier(&base, "classifier", ""); | ||
| let parsed: DeploymentConfig = | ||
| toml::from_str(&classifier_with_classifier).map_err(|error| { | ||
| RunnerError::configuration(format!("failed to parse classifier config: {error}")) | ||
| })?; | ||
| let Some(classifier_route) = parsed.routes.get("classifier") else { | ||
| return Err(RunnerError::configuration("classifier route is missing")); | ||
| }; | ||
| assert_eq!( | ||
| classifier_route.callable_target_names(), | ||
| [ | ||
| "weak", | ||
| "strong", | ||
| "strong", | ||
| "weak", | ||
| "parent_judge", | ||
| "classifier" | ||
| ] | ||
| ); | ||
|
|
||
| for configured in [ | ||
| with_subagent_llm_classifier(VALID_CONFIG, "passthrough", ""), | ||
| with_subagent_passthrough(VALID_CONFIG, "passthrough"), | ||
| stage_with_classifier, | ||
| with_subagent_passthrough(&stage, "stage"), | ||
| classifier_with_classifier, | ||
| with_subagent_passthrough(VALID_CONFIG, "classifier"), | ||
| ] { | ||
| runner_from_toml(&configured)?; | ||
| } | ||
|
|
@@ -1031,6 +1061,14 @@ classifier_magic = true | |
| ), | ||
| "cannot use message_hash_fallback", | ||
| ), | ||
| ( | ||
| with_subagent_llm_classifier( | ||
| VALID_CONFIG, | ||
| "classifier", | ||
| "\nmessage_hash_fallback = true", | ||
| ), | ||
| "cannot use message_hash_fallback", | ||
| ), | ||
|
Comment on lines
+1064
to
+1071
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Document the nested fallback restriction. Add a concise comment that nested classifier routes reject As per coding guidelines: “For Rust changes, add concise comments for ... tests that encode important behavior.” 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| ( | ||
| with_subagent_llm_classifier(VALID_CONFIG, "passthrough", "") | ||
| .replace("mode = \"custom\"", "mode = \"capability\""), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🤖 get_repo_knowledge executed:
get_repo_knowledge NVIDIA-NeMo/Switchyard /tmp/coderabbit-repo-knowledge/nvidia-nemo-switchyard-a5e744d3/learnings /tmp/coderabbit-repo-knowledge/nvidia-nemo-switchyard-a5e744d3/conventionsLength of output: 3691
🏁 Script executed:
Repository: NVIDIA-NeMo/Switchyard
Length of output: 31761
🏁 Script executed:
Repository: NVIDIA-NeMo/Switchyard
Length of output: 50380
🏁 Script executed:
Repository: NVIDIA-NeMo/Switchyard
Length of output: 31088
Sensitive Data Exposure (CWE-319): Cleartext Transmission of Sensitive Information
Reachability: External · Exploitability: Moderate
Reject HTTP clients that forward caller credentials.
forward_authcopies caller credentials into outbound headers, whileHttpBaseUrlacceptshttp. Reject non-HTTPS URLs whenforward_authis enabled.🤖 Prompt for AI Agents