Repository navigation
feat(router): expose distinct eligible primary routing options - #11794
Conversation
Keep the ordinary pick and full eligible rank in the proxy, apply primary-only soft exclusions before taking three pairs, and report a bounded summary through the private bootstrap. Co-authored-by: Copilot <[email protected]>
…dependently Co-authored-by: Copilot <[email protected]>
Walk the full eligible rank after exclusions or suspensions. Keep exact pairs and their original order for the ordinary pick and recorded arms. Co-authored-by: Copilot <[email protected]>
Compare the whole provider-qualified ID without case in host and proxy validation, but retain the supplied spelling for a valid exclusion. Co-authored-by: Copilot <[email protected]>
Keep the cost-only goal accepted by main and the primary-only exclusions documented by FW-1. Co-authored-by: Copilot <[email protected]>
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 5fa8ec7 |
|
Validated No-paid-inference Docker smoke: on an internal Linux ARM64 network, the real v0.3.0 router served this head's three cost tables to the PR-head proxy controller. The production session published private results and the host bootstrap accepted selection and completion. Four dispatches passed: no opt-in, three distinct options, exclude the ordinary base and refill, and exclude all bases and retain the ordinary pick. Each used the same 74-pair rank, one Limits: this exercises the routing bootstrap, not a full agent launch or live provider discovery/inference. The legacy six-profile v0.3.0 configuration was rejected by the new cost-only capabilities validator inherited from main; the three-cost-profile run passed. I did not change that validator or dispatch the live workflow. |
There was a problem hiding this comment.
🟡 Changes recommended
Valid routes can incorrectly fail with routing_contract_error when raw and provider-prefixed catalogue entries share a model/effort under different choice IDs, even without exclusions.
1 open issue
What changed in this PR
This PR extends AWF’s task-level model routing to expose up to three distinct eligible models from the existing validated ranking, without another router call.
Changes:
- Adds primary-only
excludedModelsconfiguration with case-insensitive duplicate validation. - Publishes an opt-in private options summary and records when exclusions fall back to the ordinary pick.
- Adds documentation and regression coverage for distinct-model selection, fallback, guards, and baseline compatibility.
| File | Description |
|---|---|
src/types/api-proxy-routing-options.ts |
Adds the optional exclusions type. |
src/services/api-proxy-env-config.test.ts |
Tests exclusion transmission to the proxy. |
src/config-file.ts |
Rejects case-insensitive duplicate exclusions. |
src/config-file-validation.test.ts |
Covers host-side exclusion validation. |
src/awf-config-schema.json |
Adds runtime schema constraints for exclusions. |
docs/awf-config.schema.json |
Defines exclusions in the canonical schema. |
docs/awf-config-spec.md |
Documents selection, private options, and fallback. |
containers/api-proxy/routing-runtime.test.js |
Tests the combined private-result size limit. |
containers/api-proxy/routing-runtime.js |
Publishes options only in the private result. |
containers/api-proxy/routing-persistence.test.js |
Tests fallback logging and summary omission. |
containers/api-proxy/routing-persistence.js |
Allows the fallback audit field. |
containers/api-proxy/routing-efforts.test.js |
Covers private options and omitted-effort semantics. |
containers/api-proxy/routing-controller.test.js |
Adds ranking, fallback, guard, and compatibility tests. |
containers/api-proxy/routing-controller.js |
Integrates primary options, selection, and audit output. |
containers/api-proxy/routing-config.test.js |
Covers proxy-side exclusion validation. |
containers/api-proxy/routing-config.js |
Parses and validates exclusions. |
containers/api-proxy/routing-candidates.test.js |
Tests distinct-model shortlisting and refill. |
containers/api-proxy/routing-candidates.js |
Builds primary options from the validated rank. |
containers/api-proxy/fixtures/routing-options/three-efforts.json |
Supplies ranking and fallback fixtures. |
Review effort: Balanced
|
Reviewed head Checks finished: 42 passed and 5 skipped. The coverage job ran and saved PR-head coverage, then hit its 15-minute limit while collecting base coverage. There is no coverage comparison. The four isolated Docker cases did not use paid inference or launch a full agent. Leaving this draft unmerged. |
Only build bounded options when requested. A wire-valid rank with two IDs for one model and effort keeps its original first ID and final guard without opt-in. The options contract still rejects duplicate pairs before filtering. Co-authored-by: Copilot <[email protected]>
|
✅ Copilot review passed with no inline comments. @rabeckett Add the |
There was a problem hiding this comment.
🔵 Needs a closer look
Opt-in exclusions affect primary selection across classifier eligibility, ranked-choice mappings, provider guards, and private bootstrap publication, creating interacting routing and startup contracts that require broader review.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
|
CI handoff for For upstream triage, the last passing main integration run and the next failing main run are one commit apart. That first red run already failed API Proxy, Protocol & Security, and Domain; Container & Ops was not red in that run. This narrows where to start, not which change caused all seven failures. The FW-1 alias finding is resolved on this head. The focused tests and four no-inference Docker routing cases passed. CI maintainers/coordinator: please link the upstream fix here when tracked. Once it is on main, the next step for this PR is to take the fix, retest routing, and run the deterministic integration workflow on the resulting SHA. No check bypass or paid smoke run is needed for triage. |
|
✅ Security Guard completed successfully! Security GuardOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Merged |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. Smoke ChrootOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
✅ Build Test Suite completed successfully! Build Test SuiteOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "169.254.169.254"See Network Configuration for more information.
|
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.
|
|
✅ Smoke Claude passed
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
❌ Security Guard failed. Please review the logs for details. Security GuardOutcome: The agent failed after emitting a no-op output. Task completion is unconfirmed; the no-op does not establish success or a transient failure. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Smoke CodexOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
Cloud Hypervisor + Copilot smoke test
Overall: PASS
|
Smoke Test: Copilot Network Isolation ✅ PASSBoth egress isolation checks completed successfully:
The firewall correctly permits traffic to allowlisted domains and blocks non-allowlisted domains via SNI inspection.
|
|
Services smoke test: PASS
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS All clones succeeded. Environment workarounds were needed on this runner (none affect test results):
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "169.254.169.254"See Network Configuration for more information.
|
Smoke Test: Claude Engine Validation
Overall result: PASS
|
Chroot Version Comparison
Result:
|
|
Smoke Test: Copilot Engine (PR #11794, @rabeckett) Merged PR titles checked:
Overall status: PASS
|
|
Smoke test results
|
Smoke Test: Copilot BYOK (Direct Mode)
Status: PASS — Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar
|
OTEL Tracing Smoke Test Results
Overall: Scenarios 1–4 pass. Scenario 5 needs a run where the api-proxy sidecar is active to confirm span export.
|

Fixes #11793
Request
apiProxy.routing.topK(1–32; pilot: 3) to report the first eligible effort for each of up to K distinct models from the configured provider. The proxy uses its existing validated rank and always guards the ordinary first pick. OmittingtopKpreserves the old selection, wire and log shape. No classifier, router request, discovery, inference, or table changes. There is no manual exclusion option; workflow-learned suspensions belong to the separate selector, not this PR.The trusted host's private selection receipt adds only
routeOptions.ordinaryPickandrouteOptions.optionswhen requested. Nothing is added to/reflect. The full rank stays intact and the receipt stays inside the existing 16 KiB bound. Alternatives blocked by the model multiplier cap are skipped before taking K; a blocked primary still fails rather than falling through.Verified at
5f632f449e72939e506c02745a37138ea91e2e20: 278 focused proxy/guard tests, 281 host tests, build, type-check, lint and schema sync. Five no-inference Linux Docker cases on a 74-pair real-router rank covered ordinary routing, K=1/3/4, capped-alternative refill and the private host bootstrap. These use a synthetic provider/classifier, not a full agent run. Full rank, ordinary pick and bounded fixture cases.The preceding head's red coverage job failed a shell-output assertion in the Docker harness observation suite before the coverage comparison. It did not report a drop. Prior deterministic integration CI comparison against main.