01-pr29-provider-remap
evals/01-pr29-provider-remap ↑ +28.6 pts with plugin 57.1%Results
✗ fail finds-magic-string-remap
judge votes: FAIL FAIL FAIL
I pulled in Anthropic's own API guidance to check the Anthropic-specific parts of this diff (I wasn't able to reach the `brooks-review` skill's file outside the sandboxed working directory, so this is a manual review rather than the templated one — happy to retry if you can point me at the file). Here's what I found:
## Blocking / should-fix before merge
**1. `anthropic/claude-sonnet-5` is an unverified model-ID format.**
Anthropic's own model IDs are bare strings (`claude-sonnet-5`, `claude-opus-5` — no provider prefix, no date suffix). The `anthropic/…` slash-prefix convention shown here looks like an OpenRouter-style routing convention, not something Anthropic itself uses (compare: Bedrock uses a dot, `anthropic.claude-opus-5`; Vertex/Foundry use no prefix at all). Nothing in the diff or its comments cites ExampleGW's own docs confirming this is the id it expects. If it's wrong, every ExampleGW-routed CI review call fails at request time — and this string is hardcoded independently in both `ci-review.mjs` and `run-evals-live.mjs`, so it can drift. Confirm the exact id against ExampleGW's model catalog before merging, and consider defining it once (see #2).
**2. Provider logic is duplicated three times.** The `provider` validation, the `DEFAULT_MODELS` map, the `EXAMPLEGW_BASE_URL` constant, and the "disable thinking" block are copy-pasted verbatim across `action.yml`'s bash, `ci-review.mjs`, and `run-evals-live.mjs`. A future change to the gateway URL or the pinned model id means updating three places and risking them going out of sync. Worth factoring into one small shared module the two `.mjs` scripts import.
**3. Disabling thinking outright is riskier than the docs recommend, and the risk lands directly on this pipeline's output parsing.** Per current Anthropic guidance, forcing `thinking: {type: "disabled"}` on newer models can cause the model to write content (including stray `<thinking>`-style tags, or even a tool call) into the *visible text* instead of behaving as expected — silently, no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into JSON/SARIF parsing for the CI gate, so a leaked tag would corrupt that output without anyone noticing until a build behaves strangely. The documented safer alternative is `output_config: { effort: "low" }` (works on Sonnet 5), which gets the same token-budget economy without disabling thinking wholesale. Given the whole point of this change is trustworthy CI output, I'd swap to effort tuning, or at minimum add the "don't emit internal tags" instruction the docs suggest as a mitigation, and test it against the real gateway model before relying on it.
## Worth a look, not blocking
**4.** The thinking-disable block is gated on `provider === "examplegw"` for *any* model, but the code comment justifies it as a fix for "reasoning models." If a non-reasoning model ever gets routed through ExampleGW, it'll have thinking force-disabled for no reason. Consider gating on the resolved model name instead of the whole provider.
**5.** `EXAMPLEGW_BASE_URL` is a hardcoded literal in two files rather than an action input/env override. Given `action.yml` already exposes `examplegw-api-key` and `provider` as configurable inputs, a fixed URL is the odd one out if ExampleGW ever needs a per-tenant or self-hosted endpoint.
**6.** If a caller overrides `--model` explicitly while using `provider: examplegw`, there's no translation — they must already know to type the `anthropic/…` prefix themselves. Worth a line in `action.yml`'s `model` input description saying so.
**7.** I only have the diff hunks, not the full file — worth double-checking what happens after the `catch` block in `ci-review.mjs` on a gateway auth/model-id failure. This change adds two new failure modes (bad provider value, bad model id) that didn't exist before; confirm they still fail the CI check loudly rather than being swallowed.
## Looks right
- `claude-sonnet-4-6` and `claude-opus-4-6` (the pre-existing, unchanged model ids) are current, valid Anthropic model ids.
- Constructing the SDK client with a custom `baseURL` for a generic Anthropic-compatible third-party endpoint is the correct pattern — Anthropic's own guidance only steers you away from `baseURL` overrides for the three specifically-supported partner platforms (Bedrock/Vertex/Foundry), which have dedicated client classes. ExampleGW isn't one of those, so this is fine.
- Moving `anthropic-api-key` from `required: true` to a runtime-validated default is the right call, since GitHub Actions inputs can't express "required unless X."
**Bottom line:** the shape of the change is reasonable, but I'd confirm the `anthropic/claude-sonnet-5` id against ExampleGW's actual docs and reconsider the blanket `thinking: disabled` before merging — both are the kind of thing that fails silently in exactly the pipeline that's supposed to catch silent failures.
✓ pass finds-multiple-sources-of-truth
judge votes: PASS PASS PASS
I pulled in Anthropic's own API guidance to check the Anthropic-specific parts of this diff (I wasn't able to reach the `brooks-review` skill's file outside the sandboxed working directory, so this is a manual review rather than the templated one — happy to retry if you can point me at the file). Here's what I found:
## Blocking / should-fix before merge
**1. `anthropic/claude-sonnet-5` is an unverified model-ID format.**
Anthropic's own model IDs are bare strings (`claude-sonnet-5`, `claude-opus-5` — no provider prefix, no date suffix). The `anthropic/…` slash-prefix convention shown here looks like an OpenRouter-style routing convention, not something Anthropic itself uses (compare: Bedrock uses a dot, `anthropic.claude-opus-5`; Vertex/Foundry use no prefix at all). Nothing in the diff or its comments cites ExampleGW's own docs confirming this is the id it expects. If it's wrong, every ExampleGW-routed CI review call fails at request time — and this string is hardcoded independently in both `ci-review.mjs` and `run-evals-live.mjs`, so it can drift. Confirm the exact id against ExampleGW's model catalog before merging, and consider defining it once (see #2).
**2. Provider logic is duplicated three times.** The `provider` validation, the `DEFAULT_MODELS` map, the `EXAMPLEGW_BASE_URL` constant, and the "disable thinking" block are copy-pasted verbatim across `action.yml`'s bash, `ci-review.mjs`, and `run-evals-live.mjs`. A future change to the gateway URL or the pinned model id means updating three places and risking them going out of sync. Worth factoring into one small shared module the two `.mjs` scripts import.
**3. Disabling thinking outright is riskier than the docs recommend, and the risk lands directly on this pipeline's output parsing.** Per current Anthropic guidance, forcing `thinking: {type: "disabled"}` on newer models can cause the model to write content (including stray `<thinking>`-style tags, or even a tool call) into the *visible text* instead of behaving as expected — silently, no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into JSON/SARIF parsing for the CI gate, so a leaked tag would corrupt that output without anyone noticing until a build behaves strangely. The documented safer alternative is `output_config: { effort: "low" }` (works on Sonnet 5), which gets the same token-budget economy without disabling thinking wholesale. Given the whole point of this change is trustworthy CI output, I'd swap to effort tuning, or at minimum add the "don't emit internal tags" instruction the docs suggest as a mitigation, and test it against the real gateway model before relying on it.
## Worth a look, not blocking
**4.** The thinking-disable block is gated on `provider === "examplegw"` for *any* model, but the code comment justifies it as a fix for "reasoning models." If a non-reasoning model ever gets routed through ExampleGW, it'll have thinking force-disabled for no reason. Consider gating on the resolved model name instead of the whole provider.
**5.** `EXAMPLEGW_BASE_URL` is a hardcoded literal in two files rather than an action input/env override. Given `action.yml` already exposes `examplegw-api-key` and `provider` as configurable inputs, a fixed URL is the odd one out if ExampleGW ever needs a per-tenant or self-hosted endpoint.
**6.** If a caller overrides `--model` explicitly while using `provider: examplegw`, there's no translation — they must already know to type the `anthropic/…` prefix themselves. Worth a line in `action.yml`'s `model` input description saying so.
**7.** I only have the diff hunks, not the full file — worth double-checking what happens after the `catch` block in `ci-review.mjs` on a gateway auth/model-id failure. This change adds two new failure modes (bad provider value, bad model id) that didn't exist before; confirm they still fail the CI check loudly rather than being swallowed.
## Looks right
- `claude-sonnet-4-6` and `claude-opus-4-6` (the pre-existing, unchanged model ids) are current, valid Anthropic model ids.
- Constructing the SDK client with a custom `baseURL` for a generic Anthropic-compatible third-party endpoint is the correct pattern — Anthropic's own guidance only steers you away from `baseURL` overrides for the three specifically-supported partner platforms (Bedrock/Vertex/Foundry), which have dedicated client classes. ExampleGW isn't one of those, so this is fine.
- Moving `anthropic-api-key` from `required: true` to a runtime-validated default is the right call, since GitHub Actions inputs can't express "required unless X."
**Bottom line:** the shape of the change is reasonable, but I'd confirm the `anthropic/claude-sonnet-5` id against ExampleGW's actual docs and reconsider the blanket `thinking: disabled` before merging — both are the kind of thing that fails silently in exactly the pipeline that's supposed to catch silent failures.
✗ fail health-score-line ×0.5
pattern not found in last_message
✓ pass no-factual-misreads
judge votes: PASS PASS PASS
I pulled in Anthropic's own API guidance to check the Anthropic-specific parts of this diff (I wasn't able to reach the `brooks-review` skill's file outside the sandboxed working directory, so this is a manual review rather than the templated one — happy to retry if you can point me at the file). Here's what I found:
## Blocking / should-fix before merge
**1. `anthropic/claude-sonnet-5` is an unverified model-ID format.**
Anthropic's own model IDs are bare strings (`claude-sonnet-5`, `claude-opus-5` — no provider prefix, no date suffix). The `anthropic/…` slash-prefix convention shown here looks like an OpenRouter-style routing convention, not something Anthropic itself uses (compare: Bedrock uses a dot, `anthropic.claude-opus-5`; Vertex/Foundry use no prefix at all). Nothing in the diff or its comments cites ExampleGW's own docs confirming this is the id it expects. If it's wrong, every ExampleGW-routed CI review call fails at request time — and this string is hardcoded independently in both `ci-review.mjs` and `run-evals-live.mjs`, so it can drift. Confirm the exact id against ExampleGW's model catalog before merging, and consider defining it once (see #2).
**2. Provider logic is duplicated three times.** The `provider` validation, the `DEFAULT_MODELS` map, the `EXAMPLEGW_BASE_URL` constant, and the "disable thinking" block are copy-pasted verbatim across `action.yml`'s bash, `ci-review.mjs`, and `run-evals-live.mjs`. A future change to the gateway URL or the pinned model id means updating three places and risking them going out of sync. Worth factoring into one small shared module the two `.mjs` scripts import.
**3. Disabling thinking outright is riskier than the docs recommend, and the risk lands directly on this pipeline's output parsing.** Per current Anthropic guidance, forcing `thinking: {type: "disabled"}` on newer models can cause the model to write content (including stray `<thinking>`-style tags, or even a tool call) into the *visible text* instead of behaving as expected — silently, no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into JSON/SARIF parsing for the CI gate, so a leaked tag would corrupt that output without anyone noticing until a build behaves strangely. The documented safer alternative is `output_config: { effort: "low" }` (works on Sonnet 5), which gets the same token-budget economy without disabling thinking wholesale. Given the whole point of this change is trustworthy CI output, I'd swap to effort tuning, or at minimum add the "don't emit internal tags" instruction the docs suggest as a mitigation, and test it against the real gateway model before relying on it.
## Worth a look, not blocking
**4.** The thinking-disable block is gated on `provider === "examplegw"` for *any* model, but the code comment justifies it as a fix for "reasoning models." If a non-reasoning model ever gets routed through ExampleGW, it'll have thinking force-disabled for no reason. Consider gating on the resolved model name instead of the whole provider.
**5.** `EXAMPLEGW_BASE_URL` is a hardcoded literal in two files rather than an action input/env override. Given `action.yml` already exposes `examplegw-api-key` and `provider` as configurable inputs, a fixed URL is the odd one out if ExampleGW ever needs a per-tenant or self-hosted endpoint.
**6.** If a caller overrides `--model` explicitly while using `provider: examplegw`, there's no translation — they must already know to type the `anthropic/…` prefix themselves. Worth a line in `action.yml`'s `model` input description saying so.
**7.** I only have the diff hunks, not the full file — worth double-checking what happens after the `catch` block in `ci-review.mjs` on a gateway auth/model-id failure. This change adds two new failure modes (bad provider value, bad model id) that didn't exist before; confirm they still fail the CI check loudly rather than being swallowed.
## Looks right
- `claude-sonnet-4-6` and `claude-opus-4-6` (the pre-existing, unchanged model ids) are current, valid Anthropic model ids.
- Constructing the SDK client with a custom `baseURL` for a generic Anthropic-compatible third-party endpoint is the correct pattern — Anthropic's own guidance only steers you away from `baseURL` overrides for the three specifically-supported partner platforms (Bedrock/Vertex/Foundry), which have dedicated client classes. ExampleGW isn't one of those, so this is fine.
- Moving `anthropic-api-key` from `required: true` to a runtime-validated default is the right call, since GitHub Actions inputs can't express "required unless X."
**Bottom line:** the shape of the change is reasonable, but I'd confirm the `anthropic/claude-sonnet-5` id against ExampleGW's actual docs and reconsider the blanket `thinking: disabled` before merging — both are the kind of thing that fails silently in exactly the pipeline that's supposed to catch silent failures.
✓ pass skill-fired plugin-fired indicator
Skill called 1x (expected 1..∞)
✗ fail finds-magic-string-remap
judge votes: FAIL FAIL FAIL
Reviewed the diff against current Anthropic API/SDK behavior. One finding is a real bug worth fixing before merge; the rest are smaller things to double check.
## Bug: `run-evals-live.mjs` never authenticates to ExampleGW
In `ci-review.mjs`, the `examplegw` credential flow works because **`action.yml`** does the heavy lifting first:
```bash
export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"
```
before invoking the script — so by the time `new Anthropic({ baseURL: ... })` runs, `ANTHROPIC_API_KEY` is already the gateway key.
`run-evals-live.mjs` has no such wrapper. It's invoked directly (per its own updated header comment: `EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw`), but the script:
- never reads `process.env.EXAMPLEGW_API_KEY`
- never passes `apiKey` to the `Anthropic` constructor
- only sets `baseURL` when `provider === "examplegw"`
The Anthropic SDK's credential resolution falls through `ANTHROPIC_API_KEY` → `ANTHROPIC_AUTH_TOKEN` → active OAuth profile → WIF → default profile-on-disk if the key isn't explicitly passed. So on a machine with a local `ant auth login` profile or `ANTHROPIC_API_KEY` already exported for other work, this script will silently authenticate with **real Anthropic credentials against ExampleGW's `baseURL`** — sending Anthropic secrets to a third-party host — rather than failing loudly or using the gateway key. That's a credential-leakage risk, not just a broken feature.
Fix: in both scripts, when `provider === "examplegw"`, explicitly construct the client with the gateway key rather than relying on ambient env state:
```js
new Anthropic(
provider === "examplegw"
? { baseURL: EXAMPLEGW_BASE_URL, apiKey: process.env.EXAMPLEGW_API_KEY }
: undefined
)
```
This also removes `ci-review.mjs`'s implicit dependency on the bash wrapper — right now that script silently does the wrong thing if anyone runs it directly (e.g. local testing) without replicating the `action.yml` export line.
## Verified as correct
- **`baseURL` constructor option** — correct key for the TS/JS SDK (confirmed against the SDK reference; Python's equivalent is `base_url`).
- **`thinking: { type: "disabled" }`** — this is a real, valid shape, and it's accepted for Sonnet 5 (which `anthropic/claude-sonnet-5` presumably resolves to on the gateway). No hallucinated parameter here.
## Worth a second look, not blocking
- **`"anthropic/claude-sonnet-5"` model ID format** — Anthropic's own model IDs are never provider-prefixed like this; that's an OpenRouter/aggregator-style convention. It's plausible this is exactly how ExampleGW namespaces models internally, but it's worth explicitly confirming against ExampleGW's model catalog before merge — a wrong/stale ID here only surfaces as a runtime error, not a type error.
- **Disabling thinking outright vs. lowering effort** — general guidance for Sonnet-5/Opus-5-tier models is to prefer `output_config.effort: "low"|"medium"` over fully disabling thinking, partly because disabled thinking can occasionally leak stray `<thinking>`-tag text into the visible response. These scripts don't declare `tools`, so the "tool call written as text" failure mode doesn't apply, but if the leaked-tags issue shows up it would land inside the JSON/SARIF-bound output these scripts parse. Might be worth a quick eval run against `run-evals-live.mjs --provider examplegw` to confirm output stays clean before relying on it in CI.
- **Default model for `provider=anthropic`** stays `claude-sonnet-4-6` (previous-gen) — unrelated to this PR's purpose, so not a blocker, just flagging in case you want to align defaults while you're in this code.
✗ fail finds-multiple-sources-of-truth
judge votes: FAIL FAIL FAIL
Reviewed the diff against current Anthropic API/SDK behavior. One finding is a real bug worth fixing before merge; the rest are smaller things to double check.
## Bug: `run-evals-live.mjs` never authenticates to ExampleGW
In `ci-review.mjs`, the `examplegw` credential flow works because **`action.yml`** does the heavy lifting first:
```bash
export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"
```
before invoking the script — so by the time `new Anthropic({ baseURL: ... })` runs, `ANTHROPIC_API_KEY` is already the gateway key.
`run-evals-live.mjs` has no such wrapper. It's invoked directly (per its own updated header comment: `EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw`), but the script:
- never reads `process.env.EXAMPLEGW_API_KEY`
- never passes `apiKey` to the `Anthropic` constructor
- only sets `baseURL` when `provider === "examplegw"`
The Anthropic SDK's credential resolution falls through `ANTHROPIC_API_KEY` → `ANTHROPIC_AUTH_TOKEN` → active OAuth profile → WIF → default profile-on-disk if the key isn't explicitly passed. So on a machine with a local `ant auth login` profile or `ANTHROPIC_API_KEY` already exported for other work, this script will silently authenticate with **real Anthropic credentials against ExampleGW's `baseURL`** — sending Anthropic secrets to a third-party host — rather than failing loudly or using the gateway key. That's a credential-leakage risk, not just a broken feature.
Fix: in both scripts, when `provider === "examplegw"`, explicitly construct the client with the gateway key rather than relying on ambient env state:
```js
new Anthropic(
provider === "examplegw"
? { baseURL: EXAMPLEGW_BASE_URL, apiKey: process.env.EXAMPLEGW_API_KEY }
: undefined
)
```
This also removes `ci-review.mjs`'s implicit dependency on the bash wrapper — right now that script silently does the wrong thing if anyone runs it directly (e.g. local testing) without replicating the `action.yml` export line.
## Verified as correct
- **`baseURL` constructor option** — correct key for the TS/JS SDK (confirmed against the SDK reference; Python's equivalent is `base_url`).
- **`thinking: { type: "disabled" }`** — this is a real, valid shape, and it's accepted for Sonnet 5 (which `anthropic/claude-sonnet-5` presumably resolves to on the gateway). No hallucinated parameter here.
## Worth a second look, not blocking
- **`"anthropic/claude-sonnet-5"` model ID format** — Anthropic's own model IDs are never provider-prefixed like this; that's an OpenRouter/aggregator-style convention. It's plausible this is exactly how ExampleGW namespaces models internally, but it's worth explicitly confirming against ExampleGW's model catalog before merge — a wrong/stale ID here only surfaces as a runtime error, not a type error.
- **Disabling thinking outright vs. lowering effort** — general guidance for Sonnet-5/Opus-5-tier models is to prefer `output_config.effort: "low"|"medium"` over fully disabling thinking, partly because disabled thinking can occasionally leak stray `<thinking>`-tag text into the visible response. These scripts don't declare `tools`, so the "tool call written as text" failure mode doesn't apply, but if the leaked-tags issue shows up it would land inside the JSON/SARIF-bound output these scripts parse. Might be worth a quick eval run against `run-evals-live.mjs --provider examplegw` to confirm output stays clean before relying on it in CI.
- **Default model for `provider=anthropic`** stays `claude-sonnet-4-6` (previous-gen) — unrelated to this PR's purpose, so not a blocker, just flagging in case you want to align defaults while you're in this code.
✗ fail health-score-line ×0.5
pattern not found in last_message
✓ pass no-factual-misreads
judge votes: PASS PASS PASS
Reviewed the diff against current Anthropic API/SDK behavior. One finding is a real bug worth fixing before merge; the rest are smaller things to double check.
## Bug: `run-evals-live.mjs` never authenticates to ExampleGW
In `ci-review.mjs`, the `examplegw` credential flow works because **`action.yml`** does the heavy lifting first:
```bash
export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"
```
before invoking the script — so by the time `new Anthropic({ baseURL: ... })` runs, `ANTHROPIC_API_KEY` is already the gateway key.
`run-evals-live.mjs` has no such wrapper. It's invoked directly (per its own updated header comment: `EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw`), but the script:
- never reads `process.env.EXAMPLEGW_API_KEY`
- never passes `apiKey` to the `Anthropic` constructor
- only sets `baseURL` when `provider === "examplegw"`
The Anthropic SDK's credential resolution falls through `ANTHROPIC_API_KEY` → `ANTHROPIC_AUTH_TOKEN` → active OAuth profile → WIF → default profile-on-disk if the key isn't explicitly passed. So on a machine with a local `ant auth login` profile or `ANTHROPIC_API_KEY` already exported for other work, this script will silently authenticate with **real Anthropic credentials against ExampleGW's `baseURL`** — sending Anthropic secrets to a third-party host — rather than failing loudly or using the gateway key. That's a credential-leakage risk, not just a broken feature.
Fix: in both scripts, when `provider === "examplegw"`, explicitly construct the client with the gateway key rather than relying on ambient env state:
```js
new Anthropic(
provider === "examplegw"
? { baseURL: EXAMPLEGW_BASE_URL, apiKey: process.env.EXAMPLEGW_API_KEY }
: undefined
)
```
This also removes `ci-review.mjs`'s implicit dependency on the bash wrapper — right now that script silently does the wrong thing if anyone runs it directly (e.g. local testing) without replicating the `action.yml` export line.
## Verified as correct
- **`baseURL` constructor option** — correct key for the TS/JS SDK (confirmed against the SDK reference; Python's equivalent is `base_url`).
- **`thinking: { type: "disabled" }`** — this is a real, valid shape, and it's accepted for Sonnet 5 (which `anthropic/claude-sonnet-5` presumably resolves to on the gateway). No hallucinated parameter here.
## Worth a second look, not blocking
- **`"anthropic/claude-sonnet-5"` model ID format** — Anthropic's own model IDs are never provider-prefixed like this; that's an OpenRouter/aggregator-style convention. It's plausible this is exactly how ExampleGW namespaces models internally, but it's worth explicitly confirming against ExampleGW's model catalog before merge — a wrong/stale ID here only surfaces as a runtime error, not a type error.
- **Disabling thinking outright vs. lowering effort** — general guidance for Sonnet-5/Opus-5-tier models is to prefer `output_config.effort: "low"|"medium"` over fully disabling thinking, partly because disabled thinking can occasionally leak stray `<thinking>`-tag text into the visible response. These scripts don't declare `tools`, so the "tool call written as text" failure mode doesn't apply, but if the leaked-tags issue shows up it would land inside the JSON/SARIF-bound output these scripts parse. Might be worth a quick eval run against `run-evals-live.mjs --provider examplegw` to confirm output stays clean before relying on it in CI.
- **Default model for `provider=anthropic`** stays `claude-sonnet-4-6` (previous-gen) — unrelated to this PR's purpose, so not a blocker, just flagging in case you want to align defaults while you're in this code.
Prompt
Can you review this PR before I merge it? It lets our CI review action route requests through ExampleGW, an Anthropic-compatible model gateway, instead of calling Anthropic directly. Only the code files from the PR are included below.
diff --git a/.github/actions/brooks-lint/action.yml b/.github/actions/brooks-lint/action.yml
index 73977da..3f2e0b2 100644
--- a/.github/actions/brooks-lint/action.yml
+++ b/.github/actions/brooks-lint/action.yml
@@ -7,8 +7,14 @@ inputs:
description: "Review mode: review, audit, debt, test, health, sweep"
default: "review"
anthropic-api-key:
- description: "Anthropic API key"
- required: true
+ description: "Anthropic API key (required unless provider is examplegw)"
+ default: ""
+ provider:
+ description: "Model provider: anthropic (default) or examplegw"
+ default: "anthropic"
+ examplegw-api-key:
+ description: "ExampleGW API key, sk-gw-... (required when provider is examplegw)"
+ default: ""
fail-below:
description: "Fail the check if Health Score is below this threshold (0 = never fail)"
default: "0"
@@ -71,10 +77,29 @@ runs:
shell: bash
env:
ANTHROPIC_API_KEY: ${{ inputs.anthropic-api-key }}
+ EXAMPLEGW_API_KEY: ${{ inputs.examplegw-api-key }}
+ PROVIDER: ${{ inputs.provider }}
SARIF_FILE: ${{ inputs.sarif-file }}
MODE: ${{ inputs.mode }}
MODEL: ${{ inputs.model }}
run: |
+ if [ "$PROVIDER" = "examplegw" ]; then
+ # ExampleGW serves an Anthropic-compatible /v1/messages endpoint. The
+ # key lives in examplegw-api-key (sk-gw-...); bare Anthropic model
+ # ids are not resolvable through the gateway, so the action's default
+ # claude-sonnet-4-6 is remapped to the ExampleGW-pinned id.
+ if [ -z "$EXAMPLEGW_API_KEY" ]; then
+ echo "provider=examplegw requires examplegw-api-key (sk-gw-...)" >&2
+ exit 1
+ fi
+ export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"
+ if [ "$MODEL" = "claude-sonnet-4-6" ]; then
+ MODEL="anthropic/claude-sonnet-5"
+ fi
+ elif [ -z "$ANTHROPIC_API_KEY" ]; then
+ echo "anthropic-api-key is required unless provider=examplegw" >&2
+ exit 1
+ fi
sarif_arg=()
if [ -n "$SARIF_FILE" ]; then
sarif_arg=(--sarif-out "$SARIF_FILE")
@@ -82,6 +107,7 @@ runs:
node "$BROOKS_LINT_ROOT/scripts/ci-review.mjs" \
--mode "$MODE" \
--model "$MODEL" \
+ --provider "$PROVIDER" \
--skills-dir "$BROOKS_LINT_ROOT/skills" \
--project-dir "$GITHUB_WORKSPACE" \
"${sarif_arg[@]}" \
diff --git a/scripts/ci-review.mjs b/scripts/ci-review.mjs
index 61d67a7..91b31b6 100644
--- a/scripts/ci-review.mjs
+++ b/scripts/ci-review.mjs
@@ -13,11 +13,13 @@
* --model claude-sonnet-4-6 \
* --skills-dir ./skills \
* --project-dir /path/to/project \
+ * [--provider anthropic|examplegw] \
* [--format json|sarif] \
* [--sarif-out brooks-lint.sarif]
*
* Environment:
- * ANTHROPIC_API_KEY required
+ * ANTHROPIC_API_KEY required (provider=anthropic)
+ * EXAMPLEGW_API_KEY required (provider=examplegw; sk-gw-...)
*/
import { execFileSync } from "node:child_process";
@@ -35,8 +37,22 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
const args = parseArgs(process.argv.slice(2));
+const provider = args.provider ?? "anthropic";
+if (!["anthropic", "examplegw"].includes(provider)) {
+ console.error(`Unknown provider: ${provider}. Valid providers: anthropic, examplegw`);
+ process.exit(1);
+}
+
+// ExampleGW serves an Anthropic-compatible /v1/messages endpoint. Bare Anthropic
+// model ids (e.g. claude-sonnet-4-6) are not resolvable through the gateway, so
+// the default is pinned to the ExampleGW-prefixed id.
+const DEFAULT_MODELS = {
+ anthropic: "claude-sonnet-4-6",
+ examplegw: "anthropic/claude-sonnet-5",
+};
+
const mode = args.mode ?? "review";
-const model = args.model ?? "claude-sonnet-4-6";
+const model = args.model ?? DEFAULT_MODELS[provider];
const format = args.format ?? "json";
const skillsDir = path.resolve(args["skills-dir"] ?? path.join(__dirname, "..", "skills"));
const projectDir = path.resolve(args["project-dir"] ?? process.cwd());
@@ -79,7 +95,9 @@ function getGitDiff(projectRoot) {
// ── Main ──────────────────────────────────────────────────────────────────────
-const client = new Anthropic();
+// ExampleGW's Anthropic-compatible endpoint — the client appends /v1/messages.
+const EXAMPLEGW_BASE_URL = "https://api.examplegw.example";
+const client = new Anthropic(provider === "examplegw" ? { baseURL: EXAMPLEGW_BASE_URL } : undefined);
const { diff, scope } = getGitDiff(projectDir);
const systemPrompt = assembleSystemPrompt(mode, skillsDir);
@@ -95,6 +113,10 @@ try {
max_tokens: 4096,
system: systemPrompt,
messages: [{ role: "user", content: userMessage }],
+ // Reasoning models on ExampleGW spend the output budget on thinking blocks
+ // by default; the 4096-token budget here assumes direct text output, so the
+ // gateway path disables extended thinking to preserve that contract.
+ ...(provider === "examplegw" ? { thinking: { type: "disabled" } } : {}),
});
} catch (err) {
console.error(JSON.stringify({ error: err.message, mode, scope }, null, 2));
diff --git a/scripts/run-evals-live.mjs b/scripts/run-evals-live.mjs
index cfdda01..bb64406 100644
--- a/scripts/run-evals-live.mjs
+++ b/scripts/run-evals-live.mjs
@@ -8,6 +8,7 @@
* ANTHROPIC_API_KEY=... node scripts/run-evals-live.mjs --id 5
* ANTHROPIC_API_KEY=... node scripts/run-evals-live.mjs --mode review
* ANTHROPIC_API_KEY=... node scripts/run-evals-live.mjs --model claude-opus-4-6
+ * EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw
*/
import { readFileSync } from "node:fs";
@@ -22,10 +23,24 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
const root = path.resolve(__dirname, "..");
const args = parseArgs(process.argv.slice(2));
+const provider = args.provider ?? "anthropic";
+if (!["anthropic", "examplegw"].includes(provider)) {
+ console.error(`Unknown provider: ${provider}. Valid providers: anthropic, examplegw`);
+ process.exit(1);
+}
+
+// ExampleGW serves an Anthropic-compatible /v1/messages endpoint. Bare Anthropic
+// model ids are not resolvable through the gateway, so the default is pinned to
+// the ExampleGW-prefixed id.
+const DEFAULT_MODELS = {
+ anthropic: "claude-sonnet-4-6",
+ examplegw: "anthropic/claude-sonnet-5",
+};
+
const filterRisk = args.risk ?? null;
const filterId = args.id ? parseInt(args.id, 10) : null;
const filterMode = args.mode ?? null;
-const model = args.model ?? "claude-sonnet-4-6";
+const model = args.model ?? DEFAULT_MODELS[provider];
const skillsDir = path.join(root, "skills");
if (filterMode && !VALID_MODES.includes(filterMode)) {
@@ -59,7 +74,9 @@ function getSystemPrompt(mode) {
// ── Run scenarios ─────────────────────────────────────────────────────────────
-const client = new Anthropic();
+// ExampleGW's Anthropic-compatible endpoint — the client appends /v1/messages.
+const EXAMPLEGW_BASE_URL = "https://api.examplegw.example";
+const client = new Anthropic(provider === "examplegw" ? { baseURL: EXAMPLEGW_BASE_URL } : undefined);
const results = [];
for (const scenario of scenarios) {
@@ -80,6 +97,10 @@ for (const scenario of scenarios) {
max_tokens: 4096,
system: systemPrompt,
messages: [{ role: "user", content: userMessage }],
+ // Reasoning models on ExampleGW spend the output budget on thinking blocks
+ // by default; the 4096-token budget here assumes direct text output, so the
+ // gateway path disables extended thinking to preserve that contract.
+ ...(provider === "examplegw" ? { thinking: { type: "disabled" } } : {}),
});
aiText = message.content[0]?.text ?? "";
verdict = classify(scenario, aiText);
Graders — what "good" means for this case
Facts about the diff under review (use them to check the answer; do not grade the facts themselves):
- In
.github/actions/brooks-lint/action.yml, whenPROVIDERisexamplegwthe script runsif [ "$MODEL" = "claude-sonnet-4-6" ]; then MODEL="anthropic/claude-sonnet-5"; fi. claude-sonnet-4-6is the action's current default value for itsmodelinput.
PASS only if the answer does BOTH:
- Identifies this equality check / model rewrite in
action.yml(quoting it, or clearly describing "the action rewrites the model only when it equals the current default id"). - States at least one concrete consequence of tying the rewrite to that literal id:
(a) when the action's default model is bumped, the check silently stops matching and the gateway receives an id it cannot resolve; or
(b) a user who explicitly sets
model: claude-sonnet-4-6is silently switched to a different model; or (c) any other bare model id a user passes is not mapped for the gateway at all.
FAIL if the rewrite is not mentioned, or is only described neutrally (e.g. "remaps the default model") without explaining why the literal comparison is fragile.
Facts about the diff under review:
- The gateway's default model is encoded in more than one place:
action.ymlhard-codes the rewriteclaude-sonnet-4-6 → anthropic/claude-sonnet-5, whilescripts/ci-review.mjsandscripts/run-evals-live.mjseach define their ownDEFAULT_MODELS = { anthropic: "claude-sonnet-4-6", examplegw: "anthropic/claude-sonnet-5" }. action.ymlalways passes--model "$MODEL"toci-review.mjs, and the script doesargs.model ?? DEFAULT_MODELS[provider], so on the action pathDEFAULT_MODELSnever takes effect.
PASS if the answer makes at least one of these points AND names at least two of the locations involved (file names or clearly identified code sites):
A. The provider → default-model mapping lives in two or more places (the action.yml rewrite vs DEFAULT_MODELS, or DEFAULT_MODELS copied into both scripts), so the copies can drift apart.
B. DEFAULT_MODELS in ci-review.mjs is dead / never used when invoked from the action, because the action always passes --model.
FAIL if neither A nor B is made. Pointing out that the provider-handling block is duplicated across the two scripts counts as A only if the answer makes clear the default-model mapping is part of what is duplicated.
"last_message""Health Score\\W*\\d{1,3}\\s*/\\s*100""i""contains"Check the review for factual misreadings of the diff. Ground truth about what the diff does:
action.yml: whenPROVIDERisexamplegwit exits 1 ifEXAMPLEGW_API_KEYis empty, otherwise exports it asANTHROPIC_API_KEY. For any other provider value it still exits 1 whenANTHROPIC_API_KEYis empty — the Anthropic path keeps a missing-key check (moved fromrequired: trueto a runtime check).action.ymlpasses--provider "$PROVIDER"toci-review.mjs. The action itself does not reject unknown provider values; both scripts do, exiting 1 with "Unknown provider".- Both scripts construct
new Anthropic({ baseURL: "https://api.examplegw.example" })only when provider isexamplegw; otherwisenew Anthropic(undefined), which uses the SDK defaults (valid, does not throw). thinking: { type: "disabled" }is added to the request only when provider isexamplegw.- No API key value is printed or logged; the error messages only name the missing input.
- An explicit
--modelalways wins;DEFAULT_MODELS[provider]is only the fallback when--modelis absent.
FAIL if the answer states as fact anything that contradicts items 1–6 — for example: the Anthropic path no longer validates its key; the base URL is applied to both providers or never applied; thinking is disabled for every provider; a key is leaked to logs; new Anthropic(undefined) throws; an unknown provider silently falls back to anthropic inside the scripts; DEFAULT_MODELS overrides an explicit --model.
Do NOT fail for: hedged remarks about behaviour outside the diff (e.g. whether the gateway accepts the thinking field), design opinions, or observations consistent with the ground truth (e.g. "action.yml does not validate the provider itself, so a typo only fails later in the script").
PASS if no contradicting claim is present.
"Skill""brooks-review"