Skip to content

feat: unify exact-model reasoning decisions for validation and routing - #11320

Merged
lpcox merged 7 commits into
mainfrom
copilot/feat-unify-reasoning-effort
Nov 8, 2026
Merged

lpcox merged 7 commits into
mainfrom
copilot/feat-unify-reasoning-effort

Conversation

Copilot AI commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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

    • Distinguishes absent, unknown, unsupported and supported evidence.
    • Carries supported/selectable efforts, evidenced modes/defaults, provenance and sanitized reasons.
    • Preserves future effort strings; only understood, model-supported values become automatic choices.
  • Scoped evidence

    • Reuses canonical identity resolution and exact-ID precedence.
    • Applies provider/channel/deployment scope and runtime-over-maintained authority.
    • Excludes cross-backend, custom-deployment, imported and target-only support; contradictory facts report unknown.
  • Consumer behavior

    • Removes independent direct/router effort policy while retaining endpoint fields and error envelopes.
    • Preserves direct unknown-support pass-through; automatic routing requires known support.
    • Explicit corrections: direct validation now honors active native maintained effort lists and Copilot’s advertised lack of effort control.
    • No stripping, substitution or unevidenced default insertion.
  • Pins and distribution

    • Pins decisions across request/selection refreshes without bypassing eligibility, policy or accounting.
    • Ships shared modules and reviewed declarations through existing host/proxy layouts, with provider-free off-tree regressions.
    • Leaves translation compatibility, public exports and broader Phase 6/7 work unchanged.

Copilot AI changed the title [WIP] Unify exact-model reasoning-effort decisions for validation and routing feat: unify exact-model reasoning decisions for validation and routing Nov 8, 2026
Copilot AI requested a review from lpcox November 8, 2026 17:39
@lpcox
lpcox marked this pull request as ready for review November 8, 2026 17:39
Copilot AI adaptive review requested due to automatic review settings November 8, 2026 17:39
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11320 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit d1c5fb6

@lpcox

lpcox commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Comment thread containers/api-proxy/model-reasoning.js Outdated
Comment on lines +69 to +73
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,
Comment on lines +124 to +125
scope, records: runtimeCatalog ? runtimeCatalog[provider] || [] : getRuntimeModels(provider) || [],
maintained: nativeTarget,

Copilot AI commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

@copilot fix the failing ci checks https://github.com/github/gh-aw-firewall/actions/runs/42506093976/job/128808947272?pr=11320 and https://github.com/github/gh-aw-firewall/actions/runs/42506094069/jo...

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.

@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/42506093976/job/128808947535?pr=11320

Updated the stale error-message assertions to expect JSON-escaped supported-effort values. The focused API proxy tests pass. Fixed in 331d2a5.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@lpcox

lpcox commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

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.

@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/42506093976/job/128808947535?pr=11320

Restored the original space-separated supported-values format while retaining bounded control-character sanitization. The focused API-proxy reasoning tests pass in eea819b.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.80% 93.81% 📈 +0.01%
Statements 92.35% 92.36% 📈 +0.01%
Functions 93.02% 93.02% ➡️ +0.00%
Branches 86.69% 86.69% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/commands/main-action.ts 91.7% → 92.0% (+0.25%) 91.4% → 91.7% (+0.24%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

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(' ')}]`,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: unify exact-model reasoning-effort decisions for direct validation and routing

4 participants