Repository navigation
Apply directed compatibility contracts to fallback decisions and /reflect diagnostics - #11328
Conversation
Preserve recognized Gemini/Vertex inference paths and unchanged primary requests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit c78ae3b |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.82% | 93.81% | ➡️ -0.01% |
| Statements | 92.36% | 92.36% | ➡️ +0.00% |
| Functions | 93.02% | 93.02% | ➡️ +0.00% |
| Branches | 86.70% | 86.69% | 📉 -0.01% |
📁 Per-file Coverage Changes (1 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/nvx/one-shot-process.ts |
84.0% → 81.5% (-2.47%) | 76.8% → 74.7% (-2.11%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
There was a problem hiding this comment.
🟡 Changes recommended
An uncaught compatibility-assessment exception during alias recovery can terminate the sidecar and interrupt other requests.
7 open issues
Catch alias-recovery assessment errors and skip unverified candidates · New Retain local rejection capture when native compatibility is out of scope · New Allow consecutive parallel tool results in the same turn · New Allow empty assistant content when tool calls preserve the turn · New Preserve the original model for resolver replacement failures · New Skip reasoning lookup until a candidate endpoint is selected · New Avoid classifying transient 503s as compatibility exhaustion · New
What changed in this PR
This PR connects directed compatibility contracts to AWF’s API proxy fallback admission and /reflect diagnostics, without expanding translator support.
Changes:
- Assess captured request semantics, endpoint plans, and exact-model reasoning before automatic fallback attempts.
- Add sanitized compatibility and reasoning decisions to the existing bounded
/reflecthistory. - Add dispatch, native-passthrough, pinning, translator-drift, and packaging regressions; document the tightened fallback policy.
| File | Description |
|---|---|
| docs/api-proxy-sidecar.md | Documents admission policy, diagnostics, and coverage boundaries. |
| containers/api-proxy/upstream-retry.test.js | Tests permanent endpoint-rejection retry behavior. |
| containers/api-proxy/upstream-retry.js | Preserves endpoint-error envelopes and prevents transient retry loops. |
| containers/api-proxy/upstream-http.test.js | Updates reasoning-rejection expectations to pre-dispatch skips. |
| containers/api-proxy/upstream-http.js | Integrates compatibility assessment across upstream fallback paths. |
| containers/api-proxy/upstream-http.compatibility.test.js | Covers dispatch admission, candidate order, and request pins. |
| containers/api-proxy/server.model-recovery.test.js | Exercises initial recovery admission and exhaustion. |
| containers/api-proxy/server.model-not-supported.test.js | Updates endpoint compatibility-error expectations. |
| containers/api-proxy/server.model-fallback-chain.test.js | Verifies Gemini and Vertex native fallback preservation. |
| containers/api-proxy/server.cross-provider-fallback.test.js | Tests skipping lossy cross-provider translations. |
| containers/api-proxy/proxy-request.js | Captures the concrete target for reasoning assessment. |
| containers/api-proxy/protocol-compatibility/assessment.js | Adds bounded request and translation-plan assessment. |
| containers/api-proxy/protocol-compatibility.packaging.test.js | Exercises admission and reflection in the shipped layout. |
| containers/api-proxy/protocol-compatibility-assessment.test.js | Covers request conditions, bounds, and implementation drift. |
| containers/api-proxy/model-resolver.js | Tracks automatic replacement provenance. |
| containers/api-proxy/model-resolver-fallback.test.js | Tests synthesized versus explicitly authorized selections. |
| containers/api-proxy/model-recovery.js | Applies compatibility and reasoning admission during recovery. |
| containers/api-proxy/model-decision-reflection.test.js | Verifies production fallback decisions reach /reflect. |
| containers/api-proxy/model-decision-observation.test.js | Tests sanitization, isolation, attribution, and retention. |
| containers/api-proxy/model-decision-observation.js | Captures explicit production decisions for bounded history. |
| containers/api-proxy/model-decision-diagnostics.test.js | Adjusts observer fixtures for target-scope checks. |
| containers/api-proxy/model-decision-diagnostics.schema.json | Defines additive compatibility and reasoning fields. |
| containers/api-proxy/model-decision-diagnostics.js | Sanitizes and projects captured decisions and guidance. |
| containers/api-proxy/model-config.js | Pins synthesized resolver-fallback metadata. |
| containers/api-proxy/model-body-rewriter.js | Propagates automatic replacement provenance. |
| containers/api-proxy/cross-provider-fallback.test.js | Tests request-pinned Copilot endpoint planning. |
| containers/api-proxy/cross-provider-fallback.js | Plans concrete endpoints and invokes admission before building requests. |
| containers/api-proxy/body-handler.test.js | Covers initial fallback admission and native passthrough. |
| containers/api-proxy/body-handler.js | Preserves assessment input and filters initial resolver replacements. |
Review effort: Max (auto)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Refactor assessment handling to include error catching. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.81% | 93.80% | 📉 -0.01% |
| Statements | 92.35% | 92.35% | ➡️ +0.00% |
| 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 |
92.0% → 91.7% (-0.25%) | 91.7% → 91.4% (-0.24%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.82% | 93.80% | 📉 -0.02% |
| Statements | 92.36% | 92.35% | 📉 -0.01% |
| Functions | 93.02% | 93.02% | ➡️ +0.00% |
| Branches | 86.70% | 86.69% | 📉 -0.01% |
📁 Per-file Coverage Changes (3 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/nvx/one-shot-process.ts |
84.0% → 81.5% (-2.47%) | 76.8% → 74.7% (-2.11%) |
src/commands/main-action.ts |
92.0% → 91.7% (-0.25%) | 91.7% → 91.4% (-0.24%) |
src/enclave/host-executor-server.ts |
91.2% → 91.2% (+0.00%) | 89.8% → 90.1% (+0.29%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts


Summary
/reflecthistory, preserving origin/candidate attribution, scope isolation, retention, public exhaustion envelopes, and permanent-rejection guidance.generateContentandstreamGenerateContentpassthrough. Initial resolver fallbacks now reject unimplemented endpoints rather than treating an unchanged unknown path as verified native compatibility. Primary direct-request behavior remains unchanged.Fixes #11327.
Validation
Published HEAD:
b02961486e4a653ae735e6cd43201f3f22d423db.cd containers/api-proxy && npm test -- --runInBand: 153 suites passed; 3,882 tests passed, 2 skipped. Includes fallback, translator, reasoning, management/diagnostics, accounting, and actual Docker-COPY-layout tests.npm run build,npm run lint,npm run type-check,npm run models:check, changed-document Markdown lint, andgit diff --check: passed. Root lint reports existing warnings, with zero errors.npm test -- --runInBand: 549 suites passed, 20 failed, 10 skipped; 12,426 tests passed, 218 failed, 273 skipped. This is not a green root run. Failures are in unchanged root sources/tests on macOS, including Linux/proc/self/fdand/dev/fddirectory assumptions, symlink-safe evidence staging, host-platform prerequisites, shell tooling, and enclave socket/timing fixtures. Allsrc/andscripts/files are unchanged from the PR merge base; no unrelated fixes or weakened assertions were introduced.Review and CI handoff
No submitted reviews, review threads, or top-level feedback were present at triage. The PR was mergeable without conflicts; it is not merged and auto-merge is not enabled.
Current-head CI is unverified. Prior Actions runs were
action_requiredwith no jobs or failure logs available; the only reported check was successful license compliance. A maintainer must approve applicable Actions runs and verify CI for the published HEAD, then review the changes before merge. No workflows or live inference were dispatched for this work. Docker/KVM/live-runner validation was not performed locally.