From b1187fe6060bf8862e8301b849e9cfab51a4f3ac Mon Sep 17 00:00:00 2001 From: James Wiesebron Date: Fri, 31 Jul 2026 13:40:11 -0700 Subject: [PATCH 1/6] [jwies/aic-anthropic-discount-overlay] review: meter AI credits at Khan's real Anthropic rate, not list price Khan bills Anthropic list minus 50%, but the firewall api-proxy computes AI credits from a list-price catalog baked into its container image, so every dollar figure in the workflow reads 2x high: max-ai-credits cuts a run off at half the real spend it implies, the router's maxUsd soft targets are denominated in a currency twice as expensive as the real one, and the cost counters report list. Add gh-aw's `models.providers` operator overlay with per-token rates at 50% of list for every model the reviewer can run. The overlay compiles to the firewall's apiProxy.providers and is the highest-precedence pricing source, ahead of runtime discovery, the curated table, and the bundled models.dev catalog; it covers the threat-detection proxy as well as the agent's. Nothing else changes. Because a credit becomes $0.01 of real spend rather than $0.01 of list, the existing caps and maxUsd targets become correct as written, so budgets.ts, credit-cap.ts and the counters are untouched. Inert until the gh-aw toolchain reaches v0.84.1: apiProxy.providers landed in AWF v0.27.43, and gh-aw gates emitting it on that floor, so v0.83.4 (which compiled these locks, defaulting to AWF v0.27.42) drops the block silently. Not worked around with a forward sandbox.agent.version pin, which review.md explicitly forbids. --- .../review-anthropic-pricing-overlay.md | 13 ++++ .github/workflows/review.lock.yml | 3 +- .github/workflows/review.md | 73 ++++++++++++++++++- workflows/review/review.md | 73 ++++++++++++++++++- 4 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 .changeset/review-anthropic-pricing-overlay.md diff --git a/.changeset/review-anthropic-pricing-overlay.md b/.changeset/review-anthropic-pricing-overlay.md new file mode 100644 index 00000000..9c2d5f0e --- /dev/null +++ b/.changeset/review-anthropic-pricing-overlay.md @@ -0,0 +1,13 @@ +--- +"review": patch +--- + +Meter AI credits against what Khan actually pays for Anthropic models, not list price. Khan bills Anthropic list minus 50%, but the firewall api-proxy computes AI credits from a list-price catalog baked into its container image, so every dollar figure in the workflow reads 2x high: `max-ai-credits: 1000` cuts a run off at $5 of real spend rather than $10, the router's `maxUsd` soft targets in `budgets.ts` are denominated against a currency twice as expensive as the real one, and `counters.ts` reports cost-per-run at list. This adds gh-aw's `models.providers` operator overlay with per-token rates at 50% of list for the models the reviewer can run (`claude-opus-4-8`, the current engine model; plus `claude-opus-5`, `claude-sonnet-5`, `claude-haiku-4-5`, and `claude-fable-5`, which a consumer can select via an `engine:` override or a sub-agent `model:` line). + +The overlay compiles to the firewall's `apiProxy.providers` and is the highest-precedence pricing source, ahead of runtime provider discovery, the curated table, and the bundled models.dev catalog (awf-config-spec 10.7.1); it covers the threat-detection proxy as well as the agent's. Nothing else changes: because an AI credit becomes $0.01 of real spend rather than $0.01 of list, the existing caps and `maxUsd` targets become correct as written instead of needing to be re-derived, which is why this is a frontmatter-only change with no edit to `budgets.ts`, `credit-cap.ts`, or the counters. + +**Inert until the gh-aw toolchain reaches v0.84.1, which is why this ships as a draft.** `apiProxy.providers` was added to `awf-config-schema.json` in AWF v0.27.43, and gh-aw gates emitting the field on that floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config validation rejects unknown `apiProxy` properties. gh-aw v0.83.4, which compiled the checked-in locks, defaults to AWF v0.27.42 (one patch below) and so drops the block silently: compilation is clean, the rates reach only the informational `GH_AW_INFO_MODEL_COSTS` env var, and both `awf-config.json` payloads in `review.lock.yml` carry no `providers` key. gh-aw v0.84.1 raises `DefaultFirewallVersion` to v0.27.43, so recompiling on it activates the overlay with no further edit. The silent-drop behaviour is the hazard worth knowing: there is no error to notice, so the check is `providers` appearing inside the `apiProxy` object of the compiled config. + +Deliberately not worked around with `sandbox.agent.version: v0.27.43`. The sandbox block documents that a firewall version is re-pinned there only to hold a release BACK, never to move one forward, and a forward pin would recreate the stale-floor failure that broke run 30290472047 (firewall v0.27.27 not implementing the MCP-gateway topology keys, denying every gateway call 403). + +Maintenance the overlay introduces: entries are matched per model and an unlisted model falls through to full list price with no error, so an engine-model change needs a matching entry, and these rates need re-halving whenever Anthropic list prices move. The per-model spelling is deliberate; a bare `claude-opus-4` prefix would also capture opus-4-0/4-1, which list at 3x the 4-5+ rate. diff --git a/.github/workflows/review.lock.yml b/.github/workflows/review.lock.yml index 38001ff4..1f562114 100644 --- a/.github/workflows/review.lock.yml +++ b/.github/workflows/review.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"8affe6256859da81c7756f1a829e89dcd3a1d726af2b22737312ee3fdb025918","body_hash":"51defa676770bce7b6c9a6f10b8114d8bd2b37041282944eabba8b0fec81ddc0","compiler_version":"v0.83.4","strict":true,"agent_id":"claude","agent_model":"claude-opus-4-8","engine_versions":{"claude":"2.1.220"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"b486fbcf266ca717979e9a9b334e52a61a559be698e17a2f23ffdfe9be678be0","body_hash":"51defa676770bce7b6c9a6f10b8114d8bd2b37041282944eabba8b0fec81ddc0","compiler_version":"v0.83.4","strict":true,"agent_id":"claude","agent_model":"claude-opus-4-8","engine_versions":{"claude":"2.1.220"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","KHAN_ACTIONS_BOT_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/checkout","sha":"93cb6efe18208431cddfb8368fd83d5badbf9bfd","version":"93cb6efe18208431cddfb8368fd83d5badbf9bfd"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"e89c65e17eb281bbd5ff2ff9e9199a03e96654c7","version":"v0.83.4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42","digest":"sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42","digest":"sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42","digest":"sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.6","digest":"sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748","pinned_image":"ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748"},{"image":"ghcr.io/github/github-mcp-server:v1.7.0","digest":"sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308","pinned_image":"ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308"}],"has_pull_request":true} # This file was automatically generated by gh-aw (v0.83.4). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -145,6 +145,7 @@ jobs: GH_AW_INFO_FRONTMATTER_SOURCE: "Khan/actions/workflows/review/review.md@review-v1.7.0" GH_AW_INFO_BODY_MODIFIED: "false" GH_AW_COMPILED_STRICT: "true" + GH_AW_INFO_MODEL_COSTS: '{"providers":{"anthropic":{"models":{"claude-fable-5":{"cost":{"cache_read":"5e-07","cache_write":"6.25e-06","input":"5e-06","output":"2.5e-05"}},"claude-haiku-4-5":{"cost":{"cache_read":"5e-08","cache_write":"6.25e-07","input":"5e-07","output":"2.5e-06"}},"claude-opus-4-8":{"cost":{"cache_read":"2.5e-07","cache_write":"3.125e-06","input":"2.5e-06","output":"1.25e-05"}},"claude-opus-5":{"cost":{"cache_read":"2.5e-07","cache_write":"3.125e-06","input":"2.5e-06","output":"1.25e-05"}},"claude-sonnet-5":{"cost":{"cache_read":"1e-07","cache_write":"1.25e-06","input":"1e-06","output":"5e-06"}}}}}}' uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | diff --git a/.github/workflows/review.md b/.github/workflows/review.md index 485d9ebc..5f072c54 100644 --- a/.github/workflows/review.md +++ b/.github/workflows/review.md @@ -243,7 +243,78 @@ pre-agent-steps: path: gh-aw-review-lib persist-credentials: false -# Cost guardrails (AI credits; 1 credit = $0.01). gh-aw >= v0.79 bakes in +# Anthropic pricing overlay, so an AI credit means $0.01 of what Khan actually +# pays. +# +# REQUIRES gh-aw >= v0.84.1 TO TAKE EFFECT. `apiProxy.providers` was added to +# awf-config-schema.json in AWF v0.27.43, and gh-aw gates emitting it on that +# floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config +# validation rejects unknown apiProxy properties. gh-aw v0.83.4 (the version +# this lock was compiled with) defaults to AWF v0.27.42, one patch below, so it +# SILENTLY DROPS this block: it compiles clean, the rates land only in the +# informational `GH_AW_INFO_MODEL_COSTS` env var, and metering stays at list +# price. gh-aw v0.84.1 raises `DefaultFirewallVersion` to v0.27.43, so +# recompiling on it makes this overlay live with no other change. +# +# Deliberately NOT solved by pinning `sandbox.agent.version: v0.27.43`: the +# sandbox block above documents that a version is re-pinned here only to hold a +# firewall release BACK, never to move one forward, and a forward pin would +# recreate the stale-floor failure that broke run 30290472047. Khan bills Anthropic list minus 50%, but the firewall api-proxy meters +# credits against a list-price catalog baked into its image, so every dollar +# figure downstream (the caps below, the router's `maxUsd` soft targets, the +# cost counters) reads 2x high and a run is cut off at half the real spend its +# cap implies. +# +# `models.providers` is gh-aw's operator overlay: it compiles to the firewall's +# `apiProxy.providers` and is the highest-precedence pricing source, ahead of +# runtime provider discovery, the curated table, and the bundled models.dev +# catalog (awf-config-spec 10.7.1). It applies to the threat-detection proxy as +# well as the agent's. Rates are per-token USD at 50% of Anthropic list. +# +# MAINTENANCE: entries are matched per model, and an unlisted model silently +# falls through to full list price rather than erroring. Add an entry when the +# engine model changes, and re-halve these when Anthropic list prices move. +# Do NOT collapse these to a bare `claude-opus-4` prefix: prefix matching would +# also capture opus-4-0/4-1, which list at 3x the 4-5+ rate. +models: + providers: + anthropic: + models: + # Current engine model. + claude-opus-4-8: + cost: + input: "2.5e-06" + output: "1.25e-05" + cache_read: "2.5e-07" + cache_write: "3.125e-06" + # Engine models a consumer may select via an `engine:` override. + claude-opus-5: + cost: + input: "2.5e-06" + output: "1.25e-05" + cache_read: "2.5e-07" + cache_write: "3.125e-06" + claude-sonnet-5: + cost: + input: "1e-06" + output: "5e-06" + cache_read: "1e-07" + cache_write: "1.25e-06" + claude-haiku-4-5: + cost: + input: "5e-07" + output: "2.5e-06" + cache_read: "5e-08" + cache_write: "6.25e-07" + claude-fable-5: + cost: + input: "5e-06" + output: "2.5e-05" + cache_read: "5e-07" + cache_write: "6.25e-06" + +# Cost guardrails (AI credits; 1 credit = $0.01 of real spend, given the +# pricing overlay above). gh-aw >= v0.79 bakes in # defaults of 1000/run ($10) and 5000/day ($50). Disable the daily ceiling # (-1) so reviews are never skipped on a busy PR day; the per-run cap below # still bounds the cost of any single review. diff --git a/workflows/review/review.md b/workflows/review/review.md index cb981d08..f3720a12 100644 --- a/workflows/review/review.md +++ b/workflows/review/review.md @@ -299,7 +299,78 @@ post-steps: echo "::warning title=dispatch-conformance gate::gate could not run (infra failure; review not blocked)" exit 0 -# Cost guardrails (AI credits; 1 credit = $0.01). gh-aw >= v0.79 bakes in +# Anthropic pricing overlay, so an AI credit means $0.01 of what Khan actually +# pays. +# +# REQUIRES gh-aw >= v0.84.1 TO TAKE EFFECT. `apiProxy.providers` was added to +# awf-config-schema.json in AWF v0.27.43, and gh-aw gates emitting it on that +# floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config +# validation rejects unknown apiProxy properties. gh-aw v0.83.4 (the version +# this lock was compiled with) defaults to AWF v0.27.42, one patch below, so it +# SILENTLY DROPS this block: it compiles clean, the rates land only in the +# informational `GH_AW_INFO_MODEL_COSTS` env var, and metering stays at list +# price. gh-aw v0.84.1 raises `DefaultFirewallVersion` to v0.27.43, so +# recompiling on it makes this overlay live with no other change. +# +# Deliberately NOT solved by pinning `sandbox.agent.version: v0.27.43`: the +# sandbox block above documents that a version is re-pinned here only to hold a +# firewall release BACK, never to move one forward, and a forward pin would +# recreate the stale-floor failure that broke run 30290472047. Khan bills Anthropic list minus 50%, but the firewall api-proxy meters +# credits against a list-price catalog baked into its image, so every dollar +# figure downstream (the caps below, the router's `maxUsd` soft targets, the +# cost counters) reads 2x high and a run is cut off at half the real spend its +# cap implies. +# +# `models.providers` is gh-aw's operator overlay: it compiles to the firewall's +# `apiProxy.providers` and is the highest-precedence pricing source, ahead of +# runtime provider discovery, the curated table, and the bundled models.dev +# catalog (awf-config-spec 10.7.1). It applies to the threat-detection proxy as +# well as the agent's. Rates are per-token USD at 50% of Anthropic list. +# +# MAINTENANCE: entries are matched per model, and an unlisted model silently +# falls through to full list price rather than erroring. Add an entry when the +# engine model changes, and re-halve these when Anthropic list prices move. +# Do NOT collapse these to a bare `claude-opus-4` prefix: prefix matching would +# also capture opus-4-0/4-1, which list at 3x the 4-5+ rate. +models: + providers: + anthropic: + models: + # Current engine model. + claude-opus-4-8: + cost: + input: "2.5e-06" + output: "1.25e-05" + cache_read: "2.5e-07" + cache_write: "3.125e-06" + # Engine models a consumer may select via an `engine:` override. + claude-opus-5: + cost: + input: "2.5e-06" + output: "1.25e-05" + cache_read: "2.5e-07" + cache_write: "3.125e-06" + claude-sonnet-5: + cost: + input: "1e-06" + output: "5e-06" + cache_read: "1e-07" + cache_write: "1.25e-06" + claude-haiku-4-5: + cost: + input: "5e-07" + output: "2.5e-06" + cache_read: "5e-08" + cache_write: "6.25e-07" + claude-fable-5: + cost: + input: "5e-06" + output: "2.5e-05" + cache_read: "5e-07" + cache_write: "6.25e-06" + +# Cost guardrails (AI credits; 1 credit = $0.01 of real spend, given the +# pricing overlay above). gh-aw >= v0.79 bakes in # defaults of 1000/run ($10) and 5000/day ($50). Disable the daily ceiling # (-1) so reviews are never skipped on a busy PR day; the per-run cap below # still bounds the cost of any single review. From d71a4ed55ba151f582bda52140383e16d4bbd813 Mon Sep 17 00:00:00 2001 From: James Wiesebron Date: Fri, 31 Jul 2026 13:44:14 -0700 Subject: [PATCH 2/6] [jwies/aic-anthropic-discount-overlay] review: correct the pricing-overlay blocker to a stable-release gate gh-aw raises DefaultFirewallVersion to AWF v0.27.43 as of v0.84.0, but v0.83.5/v0.84.0/v0.84.1 are all flagged prerelease and releases/latest is still v0.83.4, so the overlay is blocked on that line going stable rather than on a version that already exists. Record why pinning the extension to a prerelease is not the workaround: nothing in CI runs gh aw compile, so a prerelease-compiled lock would be silently reverted by the next compile on stable, with no test failure. Add the post-bump verification step, since the failure mode is silent. --- .../review-anthropic-pricing-overlay.md | 2 +- .github/workflows/review.lock.yml | 2 +- .github/workflows/review.md | 20 +++++++++++++------ workflows/review/review.md | 20 +++++++++++++------ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.changeset/review-anthropic-pricing-overlay.md b/.changeset/review-anthropic-pricing-overlay.md index 9c2d5f0e..28b71676 100644 --- a/.changeset/review-anthropic-pricing-overlay.md +++ b/.changeset/review-anthropic-pricing-overlay.md @@ -6,7 +6,7 @@ Meter AI credits against what Khan actually pays for Anthropic models, not list The overlay compiles to the firewall's `apiProxy.providers` and is the highest-precedence pricing source, ahead of runtime provider discovery, the curated table, and the bundled models.dev catalog (awf-config-spec 10.7.1); it covers the threat-detection proxy as well as the agent's. Nothing else changes: because an AI credit becomes $0.01 of real spend rather than $0.01 of list, the existing caps and `maxUsd` targets become correct as written instead of needing to be re-derived, which is why this is a frontmatter-only change with no edit to `budgets.ts`, `credit-cap.ts`, or the counters. -**Inert until the gh-aw toolchain reaches v0.84.1, which is why this ships as a draft.** `apiProxy.providers` was added to `awf-config-schema.json` in AWF v0.27.43, and gh-aw gates emitting the field on that floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config validation rejects unknown `apiProxy` properties. gh-aw v0.83.4, which compiled the checked-in locks, defaults to AWF v0.27.42 (one patch below) and so drops the block silently: compilation is clean, the rates reach only the informational `GH_AW_INFO_MODEL_COSTS` env var, and both `awf-config.json` payloads in `review.lock.yml` carry no `providers` key. gh-aw v0.84.1 raises `DefaultFirewallVersion` to v0.27.43, so recompiling on it activates the overlay with no further edit. The silent-drop behaviour is the hazard worth knowing: there is no error to notice, so the check is `providers` appearing inside the `apiProxy` object of the compiled config. +**Inert until gh-aw v0.84.x goes stable, which is why this ships as a draft.** `apiProxy.providers` was added to `awf-config-schema.json` in AWF v0.27.43, and gh-aw gates emitting the field on that floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config validation rejects unknown `apiProxy` properties. gh-aw v0.83.4, which compiled the checked-in locks and is still `releases/latest`, defaults to AWF v0.27.42 (one patch below) and so drops the block silently: compilation is clean, the rates reach only the informational `GH_AW_INFO_MODEL_COSTS` env var, and both `awf-config.json` payloads in `review.lock.yml` carry no `providers` key. gh-aw raises `DefaultFirewallVersion` to v0.27.43 as of v0.84.0, but v0.83.5, v0.84.0 and v0.84.1 are all flagged prerelease, so the unblocking event is that line going stable. Pinning the extension to a prerelease is deliberately not the workaround: nothing in CI runs `gh aw compile`, so a prerelease-compiled lock would be silently reverted by the next compile on stable, with no test failure to catch it. The silent-drop behaviour is the hazard worth knowing: the check is `providers` appearing inside the `apiProxy` object of the compiled config. Deliberately not worked around with `sandbox.agent.version: v0.27.43`. The sandbox block documents that a firewall version is re-pinned there only to hold a release BACK, never to move one forward, and a forward pin would recreate the stale-floor failure that broke run 30290472047 (firewall v0.27.27 not implementing the MCP-gateway topology keys, denying every gateway call 403). diff --git a/.github/workflows/review.lock.yml b/.github/workflows/review.lock.yml index 1f562114..be263af2 100644 --- a/.github/workflows/review.lock.yml +++ b/.github/workflows/review.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"b486fbcf266ca717979e9a9b334e52a61a559be698e17a2f23ffdfe9be678be0","body_hash":"51defa676770bce7b6c9a6f10b8114d8bd2b37041282944eabba8b0fec81ddc0","compiler_version":"v0.83.4","strict":true,"agent_id":"claude","agent_model":"claude-opus-4-8","engine_versions":{"claude":"2.1.220"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"3062eb496ef13bfd925458995b6e3ae417d96b805a0d22094e7fca09599f2cb7","body_hash":"51defa676770bce7b6c9a6f10b8114d8bd2b37041282944eabba8b0fec81ddc0","compiler_version":"v0.83.4","strict":true,"agent_id":"claude","agent_model":"claude-opus-4-8","engine_versions":{"claude":"2.1.220"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","KHAN_ACTIONS_BOT_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/checkout","sha":"93cb6efe18208431cddfb8368fd83d5badbf9bfd","version":"93cb6efe18208431cddfb8368fd83d5badbf9bfd"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"e89c65e17eb281bbd5ff2ff9e9199a03e96654c7","version":"v0.83.4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42","digest":"sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42","digest":"sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42","digest":"sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.6","digest":"sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748","pinned_image":"ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748"},{"image":"ghcr.io/github/github-mcp-server:v1.7.0","digest":"sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308","pinned_image":"ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308"}],"has_pull_request":true} # This file was automatically generated by gh-aw (v0.83.4). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # diff --git a/.github/workflows/review.md b/.github/workflows/review.md index 5f072c54..f161f12a 100644 --- a/.github/workflows/review.md +++ b/.github/workflows/review.md @@ -246,15 +246,23 @@ pre-agent-steps: # Anthropic pricing overlay, so an AI credit means $0.01 of what Khan actually # pays. # -# REQUIRES gh-aw >= v0.84.1 TO TAKE EFFECT. `apiProxy.providers` was added to +# INERT UNTIL gh-aw v0.84.x GOES STABLE. `apiProxy.providers` was added to # awf-config-schema.json in AWF v0.27.43, and gh-aw gates emitting it on that # floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config # validation rejects unknown apiProxy properties. gh-aw v0.83.4 (the version -# this lock was compiled with) defaults to AWF v0.27.42, one patch below, so it -# SILENTLY DROPS this block: it compiles clean, the rates land only in the -# informational `GH_AW_INFO_MODEL_COSTS` env var, and metering stays at list -# price. gh-aw v0.84.1 raises `DefaultFirewallVersion` to v0.27.43, so -# recompiling on it makes this overlay live with no other change. +# this lock was compiled with, and still `releases/latest`) defaults to AWF +# v0.27.42, one patch below, so it SILENTLY DROPS this block: it compiles +# clean, the rates land only in the informational `GH_AW_INFO_MODEL_COSTS` env +# var, and metering stays at list price. gh-aw raises `DefaultFirewallVersion` +# to v0.27.43 as of v0.84.0, but v0.83.5/v0.84.0/v0.84.1 are all prereleases, +# so recompiling is blocked on that line going stable rather than on any edit +# here. Do NOT pin the extension to a prerelease to force it: nothing in CI +# runs `gh aw compile`, so the next compile on stable would silently drop +# `providers` again with no test failure. +# +# VERIFY AFTER ANY TOOLCHAIN BUMP: `providers` must appear inside the +# `apiProxy` object of both awf-config payloads in review.lock.yml. Its +# presence in `GH_AW_INFO_MODEL_COSTS` alone means the overlay is NOT live. # # Deliberately NOT solved by pinning `sandbox.agent.version: v0.27.43`: the # sandbox block above documents that a version is re-pinned here only to hold a diff --git a/workflows/review/review.md b/workflows/review/review.md index f3720a12..3b9e3582 100644 --- a/workflows/review/review.md +++ b/workflows/review/review.md @@ -302,15 +302,23 @@ post-steps: # Anthropic pricing overlay, so an AI credit means $0.01 of what Khan actually # pays. # -# REQUIRES gh-aw >= v0.84.1 TO TAKE EFFECT. `apiProxy.providers` was added to +# INERT UNTIL gh-aw v0.84.x GOES STABLE. `apiProxy.providers` was added to # awf-config-schema.json in AWF v0.27.43, and gh-aw gates emitting it on that # floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config # validation rejects unknown apiProxy properties. gh-aw v0.83.4 (the version -# this lock was compiled with) defaults to AWF v0.27.42, one patch below, so it -# SILENTLY DROPS this block: it compiles clean, the rates land only in the -# informational `GH_AW_INFO_MODEL_COSTS` env var, and metering stays at list -# price. gh-aw v0.84.1 raises `DefaultFirewallVersion` to v0.27.43, so -# recompiling on it makes this overlay live with no other change. +# this lock was compiled with, and still `releases/latest`) defaults to AWF +# v0.27.42, one patch below, so it SILENTLY DROPS this block: it compiles +# clean, the rates land only in the informational `GH_AW_INFO_MODEL_COSTS` env +# var, and metering stays at list price. gh-aw raises `DefaultFirewallVersion` +# to v0.27.43 as of v0.84.0, but v0.83.5/v0.84.0/v0.84.1 are all prereleases, +# so recompiling is blocked on that line going stable rather than on any edit +# here. Do NOT pin the extension to a prerelease to force it: nothing in CI +# runs `gh aw compile`, so the next compile on stable would silently drop +# `providers` again with no test failure. +# +# VERIFY AFTER ANY TOOLCHAIN BUMP: `providers` must appear inside the +# `apiProxy` object of both awf-config payloads in review.lock.yml. Its +# presence in `GH_AW_INFO_MODEL_COSTS` alone means the overlay is NOT live. # # Deliberately NOT solved by pinning `sandbox.agent.version: v0.27.43`: the # sandbox block above documents that a version is re-pinned here only to hold a From 64355501b8391921025eb538ae0ec0f978400683 Mon Sep 17 00:00:00 2001 From: James Wiesebron Date: Fri, 31 Jul 2026 14:16:04 -0700 Subject: [PATCH 3/6] [upd314] review: mark the installed pricing overlay as a local override, trim the changeset The installed copy may differ from its pinned release only inside hunks carrying the KHAN/ACTIONS LOCAL OVERRIDE marker (review-pins.test.ts). The overlay hunk had none and passed only because diff -u context merged it into the adjacent marked max-ai-credits hunk, which would stop holding as soon as anything between them changed. Mark it, following the pattern the timeout-minutes override already uses, with the condition for dropping it. Changeset trimmed from 511 words to 203: the investigation notes belong in the PR, not the changelog. --- .changeset/review-anthropic-pricing-overlay.md | 10 +++------- .github/workflows/review.lock.yml | 2 +- .github/workflows/review.md | 5 +++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.changeset/review-anthropic-pricing-overlay.md b/.changeset/review-anthropic-pricing-overlay.md index 28b71676..2c16d224 100644 --- a/.changeset/review-anthropic-pricing-overlay.md +++ b/.changeset/review-anthropic-pricing-overlay.md @@ -2,12 +2,8 @@ "review": patch --- -Meter AI credits against what Khan actually pays for Anthropic models, not list price. Khan bills Anthropic list minus 50%, but the firewall api-proxy computes AI credits from a list-price catalog baked into its container image, so every dollar figure in the workflow reads 2x high: `max-ai-credits: 1000` cuts a run off at $5 of real spend rather than $10, the router's `maxUsd` soft targets in `budgets.ts` are denominated against a currency twice as expensive as the real one, and `counters.ts` reports cost-per-run at list. This adds gh-aw's `models.providers` operator overlay with per-token rates at 50% of list for the models the reviewer can run (`claude-opus-4-8`, the current engine model; plus `claude-opus-5`, `claude-sonnet-5`, `claude-haiku-4-5`, and `claude-fable-5`, which a consumer can select via an `engine:` override or a sub-agent `model:` line). +Meter AI credits at Khan's real Anthropic rate instead of list price. Khan bills list minus 50%, but the firewall api-proxy prices credits from a list-price catalog baked into its image, so `max-ai-credits` cuts a run off at half the spend it implies and the router's `maxUsd` targets are denominated in a currency twice as expensive as the real one. Adds gh-aw's `models.providers` operator overlay at 50% of list for every model the reviewer can run. Because a credit now means $0.01 of real spend, the existing caps and `maxUsd` targets are correct as written, so `budgets.ts`, `credit-cap.ts` and the counters are untouched. -The overlay compiles to the firewall's `apiProxy.providers` and is the highest-precedence pricing source, ahead of runtime provider discovery, the curated table, and the bundled models.dev catalog (awf-config-spec 10.7.1); it covers the threat-detection proxy as well as the agent's. Nothing else changes: because an AI credit becomes $0.01 of real spend rather than $0.01 of list, the existing caps and `maxUsd` targets become correct as written instead of needing to be re-derived, which is why this is a frontmatter-only change with no edit to `budgets.ts`, `credit-cap.ts`, or the counters. +Inert until gh-aw v0.84.x goes stable: `apiProxy.providers` needs AWF v0.27.43, and gh-aw v0.83.4 (still `releases/latest`) defaults to v0.27.42 and drops the key silently, with the rates reaching only the informational `GH_AW_INFO_MODEL_COSTS`. v0.84.0 raises the default, but the v0.84.x line is prerelease. Not forced with a `sandbox.agent.version` pin, which `review.md` allows only to hold a release back, never to move one forward. -**Inert until gh-aw v0.84.x goes stable, which is why this ships as a draft.** `apiProxy.providers` was added to `awf-config-schema.json` in AWF v0.27.43, and gh-aw gates emitting the field on that floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config validation rejects unknown `apiProxy` properties. gh-aw v0.83.4, which compiled the checked-in locks and is still `releases/latest`, defaults to AWF v0.27.42 (one patch below) and so drops the block silently: compilation is clean, the rates reach only the informational `GH_AW_INFO_MODEL_COSTS` env var, and both `awf-config.json` payloads in `review.lock.yml` carry no `providers` key. gh-aw raises `DefaultFirewallVersion` to v0.27.43 as of v0.84.0, but v0.83.5, v0.84.0 and v0.84.1 are all flagged prerelease, so the unblocking event is that line going stable. Pinning the extension to a prerelease is deliberately not the workaround: nothing in CI runs `gh aw compile`, so a prerelease-compiled lock would be silently reverted by the next compile on stable, with no test failure to catch it. The silent-drop behaviour is the hazard worth knowing: the check is `providers` appearing inside the `apiProxy` object of the compiled config. - -Deliberately not worked around with `sandbox.agent.version: v0.27.43`. The sandbox block documents that a firewall version is re-pinned there only to hold a release BACK, never to move one forward, and a forward pin would recreate the stale-floor failure that broke run 30290472047 (firewall v0.27.27 not implementing the MCP-gateway topology keys, denying every gateway call 403). - -Maintenance the overlay introduces: entries are matched per model and an unlisted model falls through to full list price with no error, so an engine-model change needs a matching entry, and these rates need re-halving whenever Anthropic list prices move. The per-model spelling is deliberate; a bare `claude-opus-4` prefix would also capture opus-4-0/4-1, which list at 3x the 4-5+ rate. +Maintenance: entries match per model, and an unlisted model falls through to list price with no error, so an engine-model change needs a matching entry and the rates need re-halving when Anthropic list prices move. diff --git a/.github/workflows/review.lock.yml b/.github/workflows/review.lock.yml index be263af2..0644f9d5 100644 --- a/.github/workflows/review.lock.yml +++ b/.github/workflows/review.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"3062eb496ef13bfd925458995b6e3ae417d96b805a0d22094e7fca09599f2cb7","body_hash":"51defa676770bce7b6c9a6f10b8114d8bd2b37041282944eabba8b0fec81ddc0","compiler_version":"v0.83.4","strict":true,"agent_id":"claude","agent_model":"claude-opus-4-8","engine_versions":{"claude":"2.1.220"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"74e04a81fdf253a34f7620fc17725ae17a4ddf277a570c2097fb95fbda2c17c8","body_hash":"51defa676770bce7b6c9a6f10b8114d8bd2b37041282944eabba8b0fec81ddc0","compiler_version":"v0.83.4","strict":true,"agent_id":"claude","agent_model":"claude-opus-4-8","engine_versions":{"claude":"2.1.220"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","KHAN_ACTIONS_BOT_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/checkout","sha":"93cb6efe18208431cddfb8368fd83d5badbf9bfd","version":"93cb6efe18208431cddfb8368fd83d5badbf9bfd"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"e89c65e17eb281bbd5ff2ff9e9199a03e96654c7","version":"v0.83.4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42","digest":"sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42","digest":"sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42","digest":"sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.6","digest":"sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748","pinned_image":"ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748"},{"image":"ghcr.io/github/github-mcp-server:v1.7.0","digest":"sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308","pinned_image":"ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308"}],"has_pull_request":true} # This file was automatically generated by gh-aw (v0.83.4). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # diff --git a/.github/workflows/review.md b/.github/workflows/review.md index f161f12a..2b599249 100644 --- a/.github/workflows/review.md +++ b/.github/workflows/review.md @@ -243,6 +243,11 @@ pre-agent-steps: path: gh-aw-review-lib persist-credentials: false +# KHAN/ACTIONS LOCAL OVERRIDE: the pricing overlay added at source, carried +# here ahead of the release that ships it (this pinned v1.7.0 copy predates +# it). Drop this override at the next installed-reviewer version bump, when +# `gh aw update` brings the same block down from the source workflow. +# # Anthropic pricing overlay, so an AI credit means $0.01 of what Khan actually # pays. # From d0c7b72905c3b2972b0e6ee4055dbe3b7c387b41 Mon Sep 17 00:00:00 2001 From: James Wiesebron Date: Fri, 31 Jul 2026 14:30:00 -0700 Subject: [PATCH 4/6] [upd314] review: keep the pricing overlay in the shared source only The installed copy carried a second hand-maintained copy of the override table, marked as a local override that existed only to be deleted at the next installed-reviewer version bump. Since the overlay is inert until gh-aw v0.84.x is stable, that bought nothing now and cost a divergence to unwind later. Define the rates once, in the shared source. This repo's own reviewer picks them up the normal way, when a release bumps the installed pin. The installed copy and its lock are byte-identical to main again. --- .github/workflows/review.lock.yml | 3 +- .github/workflows/review.md | 86 +------------------------------ 2 files changed, 2 insertions(+), 87 deletions(-) diff --git a/.github/workflows/review.lock.yml b/.github/workflows/review.lock.yml index 0644f9d5..38001ff4 100644 --- a/.github/workflows/review.lock.yml +++ b/.github/workflows/review.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"74e04a81fdf253a34f7620fc17725ae17a4ddf277a570c2097fb95fbda2c17c8","body_hash":"51defa676770bce7b6c9a6f10b8114d8bd2b37041282944eabba8b0fec81ddc0","compiler_version":"v0.83.4","strict":true,"agent_id":"claude","agent_model":"claude-opus-4-8","engine_versions":{"claude":"2.1.220"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"8affe6256859da81c7756f1a829e89dcd3a1d726af2b22737312ee3fdb025918","body_hash":"51defa676770bce7b6c9a6f10b8114d8bd2b37041282944eabba8b0fec81ddc0","compiler_version":"v0.83.4","strict":true,"agent_id":"claude","agent_model":"claude-opus-4-8","engine_versions":{"claude":"2.1.220"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","KHAN_ACTIONS_BOT_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/checkout","sha":"93cb6efe18208431cddfb8368fd83d5badbf9bfd","version":"93cb6efe18208431cddfb8368fd83d5badbf9bfd"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"e89c65e17eb281bbd5ff2ff9e9199a03e96654c7","version":"v0.83.4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42","digest":"sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42","digest":"sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42","digest":"sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.6","digest":"sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748","pinned_image":"ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748"},{"image":"ghcr.io/github/github-mcp-server:v1.7.0","digest":"sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308","pinned_image":"ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308"}],"has_pull_request":true} # This file was automatically generated by gh-aw (v0.83.4). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -145,7 +145,6 @@ jobs: GH_AW_INFO_FRONTMATTER_SOURCE: "Khan/actions/workflows/review/review.md@review-v1.7.0" GH_AW_INFO_BODY_MODIFIED: "false" GH_AW_COMPILED_STRICT: "true" - GH_AW_INFO_MODEL_COSTS: '{"providers":{"anthropic":{"models":{"claude-fable-5":{"cost":{"cache_read":"5e-07","cache_write":"6.25e-06","input":"5e-06","output":"2.5e-05"}},"claude-haiku-4-5":{"cost":{"cache_read":"5e-08","cache_write":"6.25e-07","input":"5e-07","output":"2.5e-06"}},"claude-opus-4-8":{"cost":{"cache_read":"2.5e-07","cache_write":"3.125e-06","input":"2.5e-06","output":"1.25e-05"}},"claude-opus-5":{"cost":{"cache_read":"2.5e-07","cache_write":"3.125e-06","input":"2.5e-06","output":"1.25e-05"}},"claude-sonnet-5":{"cost":{"cache_read":"1e-07","cache_write":"1.25e-06","input":"1e-06","output":"5e-06"}}}}}}' uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | diff --git a/.github/workflows/review.md b/.github/workflows/review.md index 2b599249..485d9ebc 100644 --- a/.github/workflows/review.md +++ b/.github/workflows/review.md @@ -243,91 +243,7 @@ pre-agent-steps: path: gh-aw-review-lib persist-credentials: false -# KHAN/ACTIONS LOCAL OVERRIDE: the pricing overlay added at source, carried -# here ahead of the release that ships it (this pinned v1.7.0 copy predates -# it). Drop this override at the next installed-reviewer version bump, when -# `gh aw update` brings the same block down from the source workflow. -# -# Anthropic pricing overlay, so an AI credit means $0.01 of what Khan actually -# pays. -# -# INERT UNTIL gh-aw v0.84.x GOES STABLE. `apiProxy.providers` was added to -# awf-config-schema.json in AWF v0.27.43, and gh-aw gates emitting it on that -# floor (`AWFAPIProxyProvidersMinVersion`) because older AWF strict config -# validation rejects unknown apiProxy properties. gh-aw v0.83.4 (the version -# this lock was compiled with, and still `releases/latest`) defaults to AWF -# v0.27.42, one patch below, so it SILENTLY DROPS this block: it compiles -# clean, the rates land only in the informational `GH_AW_INFO_MODEL_COSTS` env -# var, and metering stays at list price. gh-aw raises `DefaultFirewallVersion` -# to v0.27.43 as of v0.84.0, but v0.83.5/v0.84.0/v0.84.1 are all prereleases, -# so recompiling is blocked on that line going stable rather than on any edit -# here. Do NOT pin the extension to a prerelease to force it: nothing in CI -# runs `gh aw compile`, so the next compile on stable would silently drop -# `providers` again with no test failure. -# -# VERIFY AFTER ANY TOOLCHAIN BUMP: `providers` must appear inside the -# `apiProxy` object of both awf-config payloads in review.lock.yml. Its -# presence in `GH_AW_INFO_MODEL_COSTS` alone means the overlay is NOT live. -# -# Deliberately NOT solved by pinning `sandbox.agent.version: v0.27.43`: the -# sandbox block above documents that a version is re-pinned here only to hold a -# firewall release BACK, never to move one forward, and a forward pin would -# recreate the stale-floor failure that broke run 30290472047. Khan bills Anthropic list minus 50%, but the firewall api-proxy meters -# credits against a list-price catalog baked into its image, so every dollar -# figure downstream (the caps below, the router's `maxUsd` soft targets, the -# cost counters) reads 2x high and a run is cut off at half the real spend its -# cap implies. -# -# `models.providers` is gh-aw's operator overlay: it compiles to the firewall's -# `apiProxy.providers` and is the highest-precedence pricing source, ahead of -# runtime provider discovery, the curated table, and the bundled models.dev -# catalog (awf-config-spec 10.7.1). It applies to the threat-detection proxy as -# well as the agent's. Rates are per-token USD at 50% of Anthropic list. -# -# MAINTENANCE: entries are matched per model, and an unlisted model silently -# falls through to full list price rather than erroring. Add an entry when the -# engine model changes, and re-halve these when Anthropic list prices move. -# Do NOT collapse these to a bare `claude-opus-4` prefix: prefix matching would -# also capture opus-4-0/4-1, which list at 3x the 4-5+ rate. -models: - providers: - anthropic: - models: - # Current engine model. - claude-opus-4-8: - cost: - input: "2.5e-06" - output: "1.25e-05" - cache_read: "2.5e-07" - cache_write: "3.125e-06" - # Engine models a consumer may select via an `engine:` override. - claude-opus-5: - cost: - input: "2.5e-06" - output: "1.25e-05" - cache_read: "2.5e-07" - cache_write: "3.125e-06" - claude-sonnet-5: - cost: - input: "1e-06" - output: "5e-06" - cache_read: "1e-07" - cache_write: "1.25e-06" - claude-haiku-4-5: - cost: - input: "5e-07" - output: "2.5e-06" - cache_read: "5e-08" - cache_write: "6.25e-07" - claude-fable-5: - cost: - input: "5e-06" - output: "2.5e-05" - cache_read: "5e-07" - cache_write: "6.25e-06" - -# Cost guardrails (AI credits; 1 credit = $0.01 of real spend, given the -# pricing overlay above). gh-aw >= v0.79 bakes in +# Cost guardrails (AI credits; 1 credit = $0.01). gh-aw >= v0.79 bakes in # defaults of 1000/run ($10) and 5000/day ($50). Disable the daily ceiling # (-1) so reviews are never skipped on a busy PR day; the per-run cap below # still bounds the cost of any single review. From 90e373a8c86923a89e9bfb38012e20aec0373378 Mon Sep 17 00:00:00 2001 From: James Wiesebron Date: Fri, 31 Jul 2026 14:30:29 -0700 Subject: [PATCH 5/6] [upd314] review: trim the pricing-overlay changeset to 137 words --- .changeset/review-anthropic-pricing-overlay.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.changeset/review-anthropic-pricing-overlay.md b/.changeset/review-anthropic-pricing-overlay.md index 2c16d224..c357d638 100644 --- a/.changeset/review-anthropic-pricing-overlay.md +++ b/.changeset/review-anthropic-pricing-overlay.md @@ -2,8 +2,6 @@ "review": patch --- -Meter AI credits at Khan's real Anthropic rate instead of list price. Khan bills list minus 50%, but the firewall api-proxy prices credits from a list-price catalog baked into its image, so `max-ai-credits` cuts a run off at half the spend it implies and the router's `maxUsd` targets are denominated in a currency twice as expensive as the real one. Adds gh-aw's `models.providers` operator overlay at 50% of list for every model the reviewer can run. Because a credit now means $0.01 of real spend, the existing caps and `maxUsd` targets are correct as written, so `budgets.ts`, `credit-cap.ts` and the counters are untouched. +Meter AI credits at Khan's real Anthropic rate rather than list price. Khan bills list minus 50%, but the firewall api-proxy prices credits from a list-price catalog baked into its image, so `max-ai-credits` stops a run at half the spend it implies and the router's `maxUsd` targets are denominated in a currency twice as expensive as the real one. Adds gh-aw's `models.providers` overlay at 50% of list for every model the reviewer can run. Since a credit now means $0.01 of real spend, the existing caps and targets are correct as written, so `budgets.ts`, `credit-cap.ts` and the counters are untouched. -Inert until gh-aw v0.84.x goes stable: `apiProxy.providers` needs AWF v0.27.43, and gh-aw v0.83.4 (still `releases/latest`) defaults to v0.27.42 and drops the key silently, with the rates reaching only the informational `GH_AW_INFO_MODEL_COSTS`. v0.84.0 raises the default, but the v0.84.x line is prerelease. Not forced with a `sandbox.agent.version` pin, which `review.md` allows only to hold a release back, never to move one forward. - -Maintenance: entries match per model, and an unlisted model falls through to list price with no error, so an engine-model change needs a matching entry and the rates need re-halving when Anthropic list prices move. +Inert until gh-aw v0.84.x is stable: `apiProxy.providers` needs firewall v0.27.43, and gh-aw v0.83.4 defaults to v0.27.42 and drops the key silently. Nothing else is required to activate it; recompiling on v0.84.x is enough. From 879902b4e7c397795627c877198b8ef13631fa10 Mon Sep 17 00:00:00 2001 From: James Wiesebron Date: Thu, 13 Aug 2026 10:34:07 -0400 Subject: [PATCH 6/6] [jwies/aic-anthropic-discount-overlay] review: price claude-sonnet-4-6 in the overlay; detach the orphaned rationale sentence Review feedback on #314. The overlay covered the orchestrator model and four override candidates but not claude-sonnet-4-6, the pattern-triage pin, so that lens would have metered at full list (2x) once the overlay went live. One entry at 50% of its list rates fixes it; every in-use pin (opus-4-8 x20, fable-5 x2, sonnet-4-6 x1) is now covered. Also moves the 'Khan bills list minus 50%' sentence out of the sandbox-pinning paragraph into its own WHY THE OVERLAY paragraph. --- workflows/review/review.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/workflows/review/review.md b/workflows/review/review.md index 3b9e3582..2d7aa221 100644 --- a/workflows/review/review.md +++ b/workflows/review/review.md @@ -323,7 +323,9 @@ post-steps: # Deliberately NOT solved by pinning `sandbox.agent.version: v0.27.43`: the # sandbox block above documents that a version is re-pinned here only to hold a # firewall release BACK, never to move one forward, and a forward pin would -# recreate the stale-floor failure that broke run 30290472047. Khan bills Anthropic list minus 50%, but the firewall api-proxy meters +# recreate the stale-floor failure that broke run 30290472047. +# +# WHY THE OVERLAY: Khan bills Anthropic list minus 50%, but the firewall api-proxy meters # credits against a list-price catalog baked into its image, so every dollar # figure downstream (the caps below, the router's `maxUsd` soft targets, the # cost counters) reads 2x high and a run is cut off at half the real spend its @@ -376,6 +378,15 @@ models: output: "2.5e-05" cache_read: "5e-07" cache_write: "6.25e-06" + # The pattern-triage sub-agent's pin (the cheap first pass; see its + # `model:` line below). Not an engine model, but dispatched inside + # the sandboxed agent step and metered by the same api-proxy. + claude-sonnet-4-6: + cost: + input: "1.5e-06" + output: "7.5e-06" + cache_read: "1.5e-07" + cache_write: "1.875e-06" # Cost guardrails (AI credits; 1 credit = $0.01 of real spend, given the # pricing overlay above). gh-aw >= v0.79 bakes in