Repository navigation
feat: unify exact-model reasoning decisions for validation and routing - #11320
Conversation
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit d1c5fb6 |
|
@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/42506093976/job/128808947535?pr=11320 |
There was a problem hiding this comment.
🟡 Changes recommended
Reasoning-effort validation incorrectly rejects supported requests, mishandles discovered model identities, and changes an error format required by existing test assertions.
4 open issues
What changed in this PR
Introduces a shared, immutable exact-model reasoning-effort decision for direct validation and automatic routing, delivering the bounded Phase 6 slice described in #11319.
Changes:
- Resolves scoped evidence with source authority, provenance, and preservation of future effort values.
- Connects validation and routing to shared decisions with request and selection pinning.
- Packages the contracts and declarations, adds regression coverage, and documents behavior changes.
| File | Description |
|---|---|
src/model-information-reasoning.test.ts |
Tests shared decisions, immutability, and off-tree distribution. |
src/model-information-contract/reasoning.js |
Adds the host-side resolver projection. |
src/model-information-contract/reasoning.d.ts |
Adds host-side contract declarations. |
shared/model-information/reasoning.js |
Defines shared evidence resolution and effort assessment. |
shared/model-information/reasoning.d.ts |
Defines typed facts, decisions, and assessments. |
scripts/model-information/compile.cjs |
Projects reasoning modules and declarations. |
package.json |
Copies reviewed declarations after compilation. |
docs/adr/0004-model-information-management.md |
Documents scope, precedence, behavior changes, and packaging. |
containers/api-proxy/upstream-http.js |
Supplies request and target context to validation. |
containers/api-proxy/runtime-model-catalog.js |
Preserves observation scopes and raw effort fields. |
containers/api-proxy/routing-provider-executor.js |
Carries pinned decisions into classifier requests. |
containers/api-proxy/routing-controller.js |
Passes scope and selected reasoning decisions through routing. |
containers/api-proxy/routing-catalogue.js |
Builds catalogue models with shared reasoning decisions. |
containers/api-proxy/routing-candidates.js |
Derives routing choices from shared assessments. |
containers/api-proxy/reasoning-effort-validation.test.js |
Extends endpoint and validation regression coverage. |
containers/api-proxy/reasoning-effort-validation.js |
Replaces independent support checks with shared assessment. |
containers/api-proxy/model-reasoning.test.js |
Tests consumer agreement, scope, precedence, and pinning. |
containers/api-proxy/model-reasoning.js |
Adapts captured evidence and manages decision pins. |
containers/api-proxy/Dockerfile |
Includes the reasoning adapter in the proxy image. |
containers/api-proxy/catalogue-contract/reasoning.js |
Adds the proxy-side resolver projection. |
containers/api-proxy/catalogue-contract/reasoning.d.ts |
Adds proxy-side contract declarations. |
Review effort: Max (auto)
| const captured = records.filter(record => !record.provider || record.provider === provider).map(record => ({ | ||
| record, | ||
| identity: resolveModelIdentity(record.id, provider, { scope, policy: { providerPrefix: false } }).identity, | ||
| })); | ||
| const resolution = capturedIdentity(model, provider, scope, captured.map(entry => entry.identity).filter(Boolean)); |
| selected.scope.deployment === scope.deployment; | ||
| pins.set(key, matches ? selected : resolveModelReasoning(model, provider, { | ||
| scope, records: runtimeCatalog ? runtimeCatalog[provider] || [] : getRuntimeModels(provider) || [], | ||
| maintained: nativeTarget, |
| scope, records: runtimeCatalog ? runtimeCatalog[provider] || [] : getRuntimeModels(provider) || [], | ||
| maintained: nativeTarget, |
Updated the API proxy error-message assertions and made the packaging test check both Dockerfile assets independently. The focused API proxy tests and model compilation suite pass. Fixed in 331d2a5.
Updated the stale error-message assertions to expect JSON-escaped supported-effort values. The focused API proxy tests pass. Fixed in 331d2a5. |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
|
@copilot address review feedback |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Implemented exact discovered-ID precedence, backend-scoped runtime facts, and native-only Copilot omission handling. Direct xhigh remains accepted for Opus 4.7/4.8 without becoming an automatic choice, and sanitized errors retain their prior format. Focused tests pass in eea819b.
Restored the original space-separated supported-values format while retaining bounded control-character sanitization. The focused API-proxy reasoning tests pass in eea819b. |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Preserve reasoning and reflection modules in the proxy image. Retain reviewed accounting families without capability inheritance. Cover both packaging and exact sibling isolation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| const error = new Error( | ||
| `${requested.field} ${JSON.stringify(requested.value)} is not supported by model ${parsed.model}; ` + | ||
| `supported values: [${supported.join(' ')}]`, | ||
| `supported values: [${safeSupported.join(' ')}]`, |


Direct effort validation and automatic routing currently apply different support policies. This bounded Phase 6 slice introduces one immutable, exact-model decision without activating staged capabilities or inheriting accounting-family facts.
Shared contract
Scoped evidence
Consumer behavior
Pins and distribution