Skip to content

fix: warn instead of rejecting models without pricing - #10757

Merged
lpcox merged 4 commits into
mainfrom
lpcox-warn-on-missing-pricing
Oct 28, 2026
Merged

lpcox merged 4 commits into
mainfrom
lpcox-warn-on-missing-pricing

Conversation

@lpcox

@lpcox lpcox commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Missing model pricing no longer rejects HTTP requests or WebSocket upgrades, with or without maxAiCredits. Emit one warning per model explaining that unpriced usage is excluded from AI-credit totals and budget enforcement may undercount spending.
  • Remove pricing-coverage filters from automatic fallback, alias resolution, and display-selector candidates. Preserve canonical model identities, policy, compatibility, retirement, and already-exhausted budget guards.
  • Preserve configured-default pricing, existing dynamic-selector accounting, and all accounting for priced usage; do not fabricate prices for concrete unpriced models.
  • Update the config specification, canonical and generated schemas, TypeScript docs, and regression coverage.

This is a pricing-only change based on main at 651eda18. It addresses only the missing-pricing rejection reported in github/gh-aw#72353; custom-tool, cache-breakpoint, and detection-alias issues are outside this PR's scope. It does not close that issue.

Validation

  • Complete API proxy suite: 132 suites, 2,838 tests passed.
  • Root schema/config regressions: 247 tests passed.
  • TypeScript build and targeted TypeScript ESLint passed.
  • Updated transport tests rerun after final edits: 42 tests passed.
  • JavaScript syntax, generated-schema equality, and whitespace checks passed.

Allow unpriced HTTP and WebSocket requests and keep pricing coverage out of fallback and selector eligibility. Warn once per model about unaccounted usage while preserving priced accounting and existing guards.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 2907a2e6-b75a-46bf-9909-9fe32922a753
Copilot AI max review requested due to automatic review settings October 28, 2026 00:40
@github-actions

github-actions Bot commented Oct 28, 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-10757 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit ea61ac7

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@lpcox

lpcox commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

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

The root Jest regression still calls the removed checkUnknownModelRejection export, causing a TypeError instead of verifying the new warning and unaccounted-usage behavior.

1 open issue
What changed in this PR

This PR lets AWF’s API proxy forward requests for models without pricing, warning that unpriced usage is excluded from credit totals. It also removes pricing coverage as a model-selection constraint while preserving existing policy and budget guards.

Changes:

  • Replace missing-pricing rejection with once-per-model warnings for HTTP and WebSocket requests.
  • Keep unpriced models eligible for fallback, alias, and display-selector resolution.
  • Update regression tests and document the accounting limits in specifications, schemas, and TypeScript comments.
File Description
src/​types/​rate-limit-options.ts Document unpriced usage and budget undercounting.
src/​awf-config-schema.json Update generated pricing and budget descriptions.
docs/​awf-config.schema.json Update canonical pricing and budget descriptions.
docs/​awf-config-spec.md Specify warnings, accounting exclusions, and preserved guards.
containers/​api-proxy/​websocket-proxy.js Wire the renamed pricing check into WebSocket handling.
containers/​api-proxy/​websocket-guards.js Pass pricing options to the new check.
containers/​api-proxy/​server.websocket.test.js Cover unpriced upgrades and exhausted budgets.
containers/​api-proxy/​server.token-guards.test.js Cover HTTP forwarding, warnings, and unpriced accounting.
containers/​api-proxy/​server.models.test.js Expect alias resolution independent of pricing.
containers/​api-proxy/​proxy-request.js Update pricing-check imports and dependencies.
containers/​api-proxy/​proxy-guards.js Connect HTTP guards to the new pricing check.
containers/​api-proxy/​model-selector.test.js Keep unpriced alias candidates and retries.
containers/​api-proxy/​model-selector.js Remove the priceability argument from selector resolution.
containers/​api-proxy/​model-resolver.js Remove pricing-based alias filtering.
containers/​api-proxy/​model-resolver-fallback.test.js Test fallback selection independent of pricing.
containers/​api-proxy/​model-fallback.js Select fallbacks without pricing filters.
containers/​api-proxy/​model-config.js Remove pricing-predicate setup and plumbing.
containers/​api-proxy/​guards/​model-policy-guard.test.js Adapt guard fixtures to the renamed check.
containers/​api-proxy/​guards/​common-guard-checks.js Run pricing warnings without a rejection guard.
containers/​api-proxy/​guards/​ai-credits-guard.test.js Cover warnings, deduplication, and accounting behavior.
containers/​api-proxy/​guards/​ai-credits-guard.js Implement nonblocking pricing checks and explanatory warnings.

Review effort: Max

getPendingAiCreditSteeringWarning,
acknowledgeAiCreditSteeringWarning,
checkUnknownModelRejection,
checkModelPricing,

Copilot AI commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/40611079970/job/122562475045?pr=10757

Updated the stale warning assertions to expect modelProvided and verify the raw model isn’t logged. All 132 API proxy suites (2,838 tests) pass. Fixed in commit 0ab3d39.

@lpcox

lpcox commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback and make sure that 'npm test' completes without any failures

Copilot AI commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback and make sure that 'npm test' completes without any failures

Updated the AOAI pricing regression to use checkModelPricing, assert configured-price accounting, confirm unpriced usage is left unaccounted, and verify the warning omits the model. The full npm test passes: 526 suites, 10,612 tests (67 skipped). Fixed in commit 3c2a8f1.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.62% 93.63% ➡️ +0.01%
Statements 92.11% 92.12% 📈 +0.01%
Functions 91.22% 91.22% ➡️ +0.00%
Branches 86.19% 86.20% 📈 +0.01%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/enclave/host-executor-server.ts 91.2% → 91.2% (+0.00%) 90.1% → 89.8% (-0.29%)
src/nvx/one-shot-adapter.ts 82.9% → 83.4% (+0.56%) 80.2% → 80.7% (+0.52%)

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

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

Copy link
Copy Markdown
Contributor

🔌 Smoke Services is testing service connectivity for this pull request...

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

❌ Security Guard failed. Please review the logs for details.

Generated by Security Guard for #10757

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #10757

@github-actions

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot smoke test

  1. Merged PR lookup: PASS
  2. github.com connectivity: PASS (HTTP 200)
  3. File write/read: PASS
  4. example.com blocked: PASS (HTTP 000)

Overall: PASS

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS

✅ GitHub MCP connectivity confirmed (2 merged PRs fetched)
✅ HTTP 200 to github.com
✅ File write/read verified
✅ Direct BYOK inference path active (COPILOT_PROVIDER_API_KEY → api-proxy → api.githubcopilot.com)

Running in direct BYOK mode via api-proxy sidecar.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

chore: upgrade gh-aw workflows to v1.0.1
fix: skip stream_options injection for Claude on Vertex
GitHub MCP connectivity: ✅
GitHub.com connectivity: ✅
File write/read test: ✅
BYOK inference: ✅
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra
Overall: PASS
@lpcox

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ 1 Module loading: otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, routerCallTracing, shutdown, isEnabled (+ internals)
  • ✅ 2 Tests: otel.test.js 46/46 passed
  • ✅ 3 Env forwarding: trace/parent span IDs in env-passthrough.ts; OTEL vars in api-proxy-env-config.ts
  • ✅ 4 Token tracker: onUsage hook present in token-tracker-http.js
  • ✅ 5 Diagnostics: /tmp/gh-aw/otel.jsonl present (1 line)

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔴 Security Review: AI Credits Enforcement Bypass

This PR changes model pricing enforcement from rejection to warning, which introduces a critical security regression for AI credit budget enforcement.

Issue: Budget Bypass via Unpriced Models

Files affected:

  • containers/api-proxy/guards/ai-credits-guard.js (lines 289–325 deleted)
  • containers/api-proxy/guards/common-guard-checks.js (lines 156–160 deleted)
  • containers/api-proxy/model-fallback.js (lines 89–101 deleted)
  • containers/api-proxy/model-resolver.js (lines 305–325 deleted)

What changed:

  1. checkUnknownModelRejection() removed → requests with unknown models no longer rejected
  2. Price filtering removed from model fallback → can synthesize unpriced models
  3. checkModelPricing() only warns, doesn't block → unknown models proceed to execution

Security impact:
When maxAiCredits is configured with no defaultAiCreditsPricing, unknown models:

  • Previously: Rejected with error → spending stopped
  • Now: Warned and allowed → credits consumed without budget counting them

This allows AI agents to exceed spending limits undetected.

Suggested action:

  • Ensure warnings are reliably logged/monitored in operational workflow
  • Document that budget enforcement depends on warning visibility
  • Consider adding telemetry to detect high-volume unpriced usage
  • Test that warnings appear in observable logs (not lost in noise)

Generated by Security Guard for #10757 · copilot · haiku45 · ~6 AIC · ⊞ 6K · ◷
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com → 200)
  • ✅ Blocked domain (example.com blocked)

Overall: PASS — @lpcox

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test

  • chore: upgrade gh-aw workflows to v1.0.1 / fix: skip stream_options injection for Claude on Vertex
  • GitHub reads ✅
  • Playwright title ❌
  • Temp file + cat ✅
  • Latest discussion lookup ❌
  • npm ci && npm run build ✅
  • Overall: FAIL

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Copilot: PRs: "chore: upgrade gh-aw workflows to v1.0.1", "fix: skip stream_options injection for Claude on Vertex"

  • GitHub MCP ✅
  • github.com ✅ (200)
  • File write/read ✅

PASS — @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia ✅ 1/1 passed ✅ PASS
Bun hono ✅ 1/1 passed ✅ PASS
C++ fmt ✅ N/A ✅ PASS
C++ json ✅ N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world ✅ N/A ✅ PASS
.NET json-parse ✅ N/A ✅ PASS
Go color ✅ pass ✅ PASS
Go env ✅ pass ✅ PASS
Go uuid ✅ pass ✅ PASS
Java gson ❌ not run ❌ FAIL
Java caffeine ❌ not run ❌ FAIL
Node.js clsx ✅ pass ✅ PASS
Node.js execa ✅ pass ✅ PASS
Node.js p-limit ✅ pass ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 7/8 ecosystems passed — FAIL

Java failure: mvn compile could not resolve maven-resources-plugin:3.4.0 from Maven Central: InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty. The Java truststore is empty, so TLS fails. The default ~/.m2 repo was also inaccessible, so I retried with a custom -Dmaven.repo.local, which hit the same error.

.NET needed XDG_RUNTIME_DIR and DOTNET_CLI_HOME set to a writable path, because /run/user/1001 does not exist.

Generated by Build Test Suite for #10757 · copilot · auto · ~19 AIC · ⊞ 5.7K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.15 Python 3.12.15 ✅
Node.js v24.21.0 v22.23.2 ❌
Go go1.22.12 go1.22.12 ✅

Node.js differs between host and chroot, so the smoke-chroot label was not added.

Tested by Smoke Chroot
Add label ready-for-aw to run again

This branch was previously deployed

1 inactive deployment
aoai-model — 25242c42 Deployed Oct 28, 2026 by lpcox via conclusion #2194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants