01-pr29-provider-remap
evals/01-pr29-provider-remap ↓ -57.1 pts with plugin 28.6%Results
✗ fail finds-magic-string-remap
judge votes: FAIL FAIL FAIL
I now have the full Anthropic API reference loaded. Here's the technical verification (points 1–5), while the brooks-review agent finishes the broader code-quality pass in the background.
## Technical verification
**1. `new Anthropic({ baseURL: "..." })` for a third-party gateway — fine.**
The "use the platform's dedicated client, not `baseURL`" rule only applies to the three Anthropic-partnered hyperscaler platforms (Bedrock/Foundry/Vertex), which have dedicated SDK classes. For a generic third-party "Anthropic-compatible" gateway there's no dedicated client — `baseURL` (equivalently `ANTHROPIC_BASE_URL`) is the documented, supported mechanism. The comment about the SDK appending `/v1/messages` to the base URL is also accurate.
**2. `thinking: { type: "disabled" }` — works, but is the wrong fix.**
For the model actually in use here (`anthropic/claude-sonnet-5` via the gateway), `disabled` is a legal value — it won't 400. But the documented pitfall (real, not model-specific in practice) is that disabling thinking entirely can cause the model to write a tool call into visible text instead of leaking `<thinking>` tags into the output — silently corrupting the review output text/JSON this script parses. Since the actual complaint here is "reasoning eats the 4096-token budget," the correct fix is `output_config: { effort: "low" }` (or `"medium"`) with thinking left on `adaptive`, not `disabled`. That gets the token-budget control they want without the leakage risk. Worth raising as a should-fix, not a blocker.
**3. Model ID defaults — real IDs, but inconsistent across providers.**
`claude-sonnet-4-6` and `claude-opus-4-6` are real (previous-gen) IDs, not fabricated. The actual issue: the PR makes the `anthropic` path default to `claude-sonnet-4-6` (older gen) while the `examplegw` path defaults to `anthropic/claude-sonnet-5` (current gen). Same CI review action, two different model generations depending on which provider flag is set — that's a silent quality/behavior divergence a reviewer running `provider=anthropic` vs `provider=examplegw` wouldn't expect. Pre-existing default aside, this PR is a natural point to also bump the anthropic-path default to `claude-sonnet-5`.
**4 & 5. Reusing `ANTHROPIC_API_KEY` for the gateway key — mechanically works, but rests on an unverified assumption.**
The SDK's zero-arg client reads `ANTHROPIC_API_KEY` and sends it via the `x-api-key` header (not `Authorization: Bearer`). So `export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"` will work correctly **only if ExampleGW also authenticates via `x-api-key`**. If ExampleGW instead expects `Authorization: Bearer sk-gw-...` (common for many gateways), every request will 401 and the failure mode is opaque (the action would just fail on the API call, not at the validation step). This should be confirmed against ExampleGW's actual docs before merging, and ideally exercised once in CI against a real (or sandboxed) gateway endpoint rather than assumed from the "Anthropic-compatible" label. The `export` is correctly scoped to that one `run:` step (not written to `$GITHUB_ENV`), so there's no cross-step leakage — that part is sound. No beta headers are used (plain `client.messages.create`), so there's nothing beta-specific for the gateway to replicate.
The brooks-review agent is still running the standard PR-review pass (secret handling, provider-branching correctness, duplication between `ci-review.mjs`/`run-evals-live.mjs`, error handling). I'll report back once it lands.
✗ fail finds-multiple-sources-of-truth
judge votes: FAIL FAIL FAIL
I now have the full Anthropic API reference loaded. Here's the technical verification (points 1–5), while the brooks-review agent finishes the broader code-quality pass in the background.
## Technical verification
**1. `new Anthropic({ baseURL: "..." })` for a third-party gateway — fine.**
The "use the platform's dedicated client, not `baseURL`" rule only applies to the three Anthropic-partnered hyperscaler platforms (Bedrock/Foundry/Vertex), which have dedicated SDK classes. For a generic third-party "Anthropic-compatible" gateway there's no dedicated client — `baseURL` (equivalently `ANTHROPIC_BASE_URL`) is the documented, supported mechanism. The comment about the SDK appending `/v1/messages` to the base URL is also accurate.
**2. `thinking: { type: "disabled" }` — works, but is the wrong fix.**
For the model actually in use here (`anthropic/claude-sonnet-5` via the gateway), `disabled` is a legal value — it won't 400. But the documented pitfall (real, not model-specific in practice) is that disabling thinking entirely can cause the model to write a tool call into visible text instead of leaking `<thinking>` tags into the output — silently corrupting the review output text/JSON this script parses. Since the actual complaint here is "reasoning eats the 4096-token budget," the correct fix is `output_config: { effort: "low" }` (or `"medium"`) with thinking left on `adaptive`, not `disabled`. That gets the token-budget control they want without the leakage risk. Worth raising as a should-fix, not a blocker.
**3. Model ID defaults — real IDs, but inconsistent across providers.**
`claude-sonnet-4-6` and `claude-opus-4-6` are real (previous-gen) IDs, not fabricated. The actual issue: the PR makes the `anthropic` path default to `claude-sonnet-4-6` (older gen) while the `examplegw` path defaults to `anthropic/claude-sonnet-5` (current gen). Same CI review action, two different model generations depending on which provider flag is set — that's a silent quality/behavior divergence a reviewer running `provider=anthropic` vs `provider=examplegw` wouldn't expect. Pre-existing default aside, this PR is a natural point to also bump the anthropic-path default to `claude-sonnet-5`.
**4 & 5. Reusing `ANTHROPIC_API_KEY` for the gateway key — mechanically works, but rests on an unverified assumption.**
The SDK's zero-arg client reads `ANTHROPIC_API_KEY` and sends it via the `x-api-key` header (not `Authorization: Bearer`). So `export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"` will work correctly **only if ExampleGW also authenticates via `x-api-key`**. If ExampleGW instead expects `Authorization: Bearer sk-gw-...` (common for many gateways), every request will 401 and the failure mode is opaque (the action would just fail on the API call, not at the validation step). This should be confirmed against ExampleGW's actual docs before merging, and ideally exercised once in CI against a real (or sandboxed) gateway endpoint rather than assumed from the "Anthropic-compatible" label. The `export` is correctly scoped to that one `run:` step (not written to `$GITHUB_ENV`), so there's no cross-step leakage — that part is sound. No beta headers are used (plain `client.messages.create`), so there's nothing beta-specific for the gateway to replicate.
The brooks-review agent is still running the standard PR-review pass (secret handling, provider-branching correctness, duplication between `ci-review.mjs`/`run-evals-live.mjs`, error handling). I'll report back once it lands.
✗ fail health-score-line ×0.5
pattern not found in last_message
✓ pass no-factual-misreads
judge votes: PASS PASS PASS
I now have the full Anthropic API reference loaded. Here's the technical verification (points 1–5), while the brooks-review agent finishes the broader code-quality pass in the background.
## Technical verification
**1. `new Anthropic({ baseURL: "..." })` for a third-party gateway — fine.**
The "use the platform's dedicated client, not `baseURL`" rule only applies to the three Anthropic-partnered hyperscaler platforms (Bedrock/Foundry/Vertex), which have dedicated SDK classes. For a generic third-party "Anthropic-compatible" gateway there's no dedicated client — `baseURL` (equivalently `ANTHROPIC_BASE_URL`) is the documented, supported mechanism. The comment about the SDK appending `/v1/messages` to the base URL is also accurate.
**2. `thinking: { type: "disabled" }` — works, but is the wrong fix.**
For the model actually in use here (`anthropic/claude-sonnet-5` via the gateway), `disabled` is a legal value — it won't 400. But the documented pitfall (real, not model-specific in practice) is that disabling thinking entirely can cause the model to write a tool call into visible text instead of leaking `<thinking>` tags into the output — silently corrupting the review output text/JSON this script parses. Since the actual complaint here is "reasoning eats the 4096-token budget," the correct fix is `output_config: { effort: "low" }` (or `"medium"`) with thinking left on `adaptive`, not `disabled`. That gets the token-budget control they want without the leakage risk. Worth raising as a should-fix, not a blocker.
**3. Model ID defaults — real IDs, but inconsistent across providers.**
`claude-sonnet-4-6` and `claude-opus-4-6` are real (previous-gen) IDs, not fabricated. The actual issue: the PR makes the `anthropic` path default to `claude-sonnet-4-6` (older gen) while the `examplegw` path defaults to `anthropic/claude-sonnet-5` (current gen). Same CI review action, two different model generations depending on which provider flag is set — that's a silent quality/behavior divergence a reviewer running `provider=anthropic` vs `provider=examplegw` wouldn't expect. Pre-existing default aside, this PR is a natural point to also bump the anthropic-path default to `claude-sonnet-5`.
**4 & 5. Reusing `ANTHROPIC_API_KEY` for the gateway key — mechanically works, but rests on an unverified assumption.**
The SDK's zero-arg client reads `ANTHROPIC_API_KEY` and sends it via the `x-api-key` header (not `Authorization: Bearer`). So `export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"` will work correctly **only if ExampleGW also authenticates via `x-api-key`**. If ExampleGW instead expects `Authorization: Bearer sk-gw-...` (common for many gateways), every request will 401 and the failure mode is opaque (the action would just fail on the API call, not at the validation step). This should be confirmed against ExampleGW's actual docs before merging, and ideally exercised once in CI against a real (or sandboxed) gateway endpoint rather than assumed from the "Anthropic-compatible" label. The `export` is correctly scoped to that one `run:` step (not written to `$GITHUB_ENV`), so there's no cross-step leakage — that part is sound. No beta headers are used (plain `client.messages.create`), so there's nothing beta-specific for the gateway to replicate.
The brooks-review agent is still running the standard PR-review pass (secret handling, provider-branching correctness, duplication between `ci-review.mjs`/`run-evals-live.mjs`, error handling). I'll report back once it lands.
✓ pass skill-fired plugin-fired indicator
Skill called 1x (expected 1..∞)
✓ pass finds-magic-string-remap
judge votes: PASS PASS PASS
Reviewed against current Anthropic API behavior. One thing I'd fix before merging, plus a few to verify/tighten.
## Fix before merging
**Disabling thinking outright is the wrong lever, and it's not free.** On Sonnet 5 (and Opus-5-tier models generally), `thinking: {type: "disabled"}` is accepted, but with a known failure mode: the model can occasionally write a tool call into its **visible text** instead of a proper block, or leak reasoning-tag artifacts into the output — with no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into the report/SARIF pipeline, so any leaked tags would silently corrupt the CI output rather than fail loudly.
The token-budget problem this is solving (thinking eating into a fixed `max_tokens: 4096`) is better solved with `output_config: { effort: "low" }` (or `"medium"`) — this keeps adaptive thinking on (avoiding the leak mode) while still capping how much of the budget goes to reasoning. Sonnet 5 supports `effort` natively. I'd swap the `thinking: {disabled}` block for this in both `ci-review.mjs` and `run-evals-live.mjs`.
## Worth verifying
- **`anthropic/claude-sonnet-5`-style model ID**: provider-prefixed model strings aren't an Anthropic API convention — they're purely a gateway's own routing syntax. Since you've anonymized the real value, I can't check it, but confirm it's copied verbatim from ExampleGW's current docs, not inferred from the bare Anthropic ID by pattern-matching. Gateways change these prefixes without much notice.
- **Default-model remap is duplicated and fragile.** `ci-review.mjs` computes `DEFAULT_MODELS[provider]` when `--model` is *absent*, but `action.yml` always passes `--model "$MODEL"` (from the input's own default), so that mjs fallback is dead code on the action path — only the shell's `if [ "$MODEL" = "claude-sonnet-4-6" ]` string match actually does the remapping. If the action's `model` input default ever changes, this silently stops firing and the raw Anthropic model ID gets sent to ExampleGW. Simpler fix: default the `model` input to `""` in `action.yml` and let `ci-review.mjs`'s existing `args.model ?? DEFAULT_MODELS[provider]` be the single source of truth.
## Looks right
- Using the bare `Anthropic` client with a `baseURL` override for a third-party gateway is the correct pattern (dedicated provider clients like `AnthropicBedrockMantle`/`AnthropicVertex` only exist for Anthropic's own platform partners — ExampleGW isn't one, so `baseURL` is the intended mechanism here).
- `EXAMPLEGW_API_KEY` → `ANTHROPIC_API_KEY` handoff and the required-unless-examplegw validation in `action.yml` are sound; the native Anthropic path is unaffected by the new branch.
✓ pass finds-multiple-sources-of-truth
judge votes: PASS PASS PASS
Reviewed against current Anthropic API behavior. One thing I'd fix before merging, plus a few to verify/tighten.
## Fix before merging
**Disabling thinking outright is the wrong lever, and it's not free.** On Sonnet 5 (and Opus-5-tier models generally), `thinking: {type: "disabled"}` is accepted, but with a known failure mode: the model can occasionally write a tool call into its **visible text** instead of a proper block, or leak reasoning-tag artifacts into the output — with no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into the report/SARIF pipeline, so any leaked tags would silently corrupt the CI output rather than fail loudly.
The token-budget problem this is solving (thinking eating into a fixed `max_tokens: 4096`) is better solved with `output_config: { effort: "low" }` (or `"medium"`) — this keeps adaptive thinking on (avoiding the leak mode) while still capping how much of the budget goes to reasoning. Sonnet 5 supports `effort` natively. I'd swap the `thinking: {disabled}` block for this in both `ci-review.mjs` and `run-evals-live.mjs`.
## Worth verifying
- **`anthropic/claude-sonnet-5`-style model ID**: provider-prefixed model strings aren't an Anthropic API convention — they're purely a gateway's own routing syntax. Since you've anonymized the real value, I can't check it, but confirm it's copied verbatim from ExampleGW's current docs, not inferred from the bare Anthropic ID by pattern-matching. Gateways change these prefixes without much notice.
- **Default-model remap is duplicated and fragile.** `ci-review.mjs` computes `DEFAULT_MODELS[provider]` when `--model` is *absent*, but `action.yml` always passes `--model "$MODEL"` (from the input's own default), so that mjs fallback is dead code on the action path — only the shell's `if [ "$MODEL" = "claude-sonnet-4-6" ]` string match actually does the remapping. If the action's `model` input default ever changes, this silently stops firing and the raw Anthropic model ID gets sent to ExampleGW. Simpler fix: default the `model` input to `""` in `action.yml` and let `ci-review.mjs`'s existing `args.model ?? DEFAULT_MODELS[provider]` be the single source of truth.
## Looks right
- Using the bare `Anthropic` client with a `baseURL` override for a third-party gateway is the correct pattern (dedicated provider clients like `AnthropicBedrockMantle`/`AnthropicVertex` only exist for Anthropic's own platform partners — ExampleGW isn't one, so `baseURL` is the intended mechanism here).
- `EXAMPLEGW_API_KEY` → `ANTHROPIC_API_KEY` handoff and the required-unless-examplegw validation in `action.yml` are sound; the native Anthropic path is unaffected by the new branch.
✗ fail health-score-line ×0.5
pattern not found in last_message
✓ pass no-factual-misreads
judge votes: PASS PASS PASS
Reviewed against current Anthropic API behavior. One thing I'd fix before merging, plus a few to verify/tighten.
## Fix before merging
**Disabling thinking outright is the wrong lever, and it's not free.** On Sonnet 5 (and Opus-5-tier models generally), `thinking: {type: "disabled"}` is accepted, but with a known failure mode: the model can occasionally write a tool call into its **visible text** instead of a proper block, or leak reasoning-tag artifacts into the output — with no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into the report/SARIF pipeline, so any leaked tags would silently corrupt the CI output rather than fail loudly.
The token-budget problem this is solving (thinking eating into a fixed `max_tokens: 4096`) is better solved with `output_config: { effort: "low" }` (or `"medium"`) — this keeps adaptive thinking on (avoiding the leak mode) while still capping how much of the budget goes to reasoning. Sonnet 5 supports `effort` natively. I'd swap the `thinking: {disabled}` block for this in both `ci-review.mjs` and `run-evals-live.mjs`.
## Worth verifying
- **`anthropic/claude-sonnet-5`-style model ID**: provider-prefixed model strings aren't an Anthropic API convention — they're purely a gateway's own routing syntax. Since you've anonymized the real value, I can't check it, but confirm it's copied verbatim from ExampleGW's current docs, not inferred from the bare Anthropic ID by pattern-matching. Gateways change these prefixes without much notice.
- **Default-model remap is duplicated and fragile.** `ci-review.mjs` computes `DEFAULT_MODELS[provider]` when `--model` is *absent*, but `action.yml` always passes `--model "$MODEL"` (from the input's own default), so that mjs fallback is dead code on the action path — only the shell's `if [ "$MODEL" = "claude-sonnet-4-6" ]` string match actually does the remapping. If the action's `model` input default ever changes, this silently stops firing and the raw Anthropic model ID gets sent to ExampleGW. Simpler fix: default the `model` input to `""` in `action.yml` and let `ci-review.mjs`'s existing `args.model ?? DEFAULT_MODELS[provider]` be the single source of truth.
## Looks right
- Using the bare `Anthropic` client with a `baseURL` override for a third-party gateway is the correct pattern (dedicated provider clients like `AnthropicBedrockMantle`/`AnthropicVertex` only exist for Anthropic's own platform partners — ExampleGW isn't one, so `baseURL` is the intended mechanism here).
- `EXAMPLEGW_API_KEY` → `ANTHROPIC_API_KEY` handoff and the required-unless-examplegw validation in `action.yml` are sound; the native Anthropic path is unaffected by the new branch.
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, and I've anonymized the gateway's name, key prefix and URL in the paste.
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 to logs; the error messages only name the missing input.
- An explicit
--modelalways wins;DEFAULT_MODELS[provider]is only the fallback when--modelis absent. - Only
action.ymlcompares the model against the literalclaude-sonnet-4-6. Neither script contains such a comparison — they useargs.model ?? DEFAULT_MODELS[provider]. - Neither script reads
EXAMPLEGW_API_KEY; the SDK picks upANTHROPIC_API_KEYfrom the environment.action.ymlexports the gateway key intoANTHROPIC_API_KEYfirst, butrun-evals-live.mjsis documented asEXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegwwith no such export — so a claim that this path ignores the gateway key, fails auth, or could send a realANTHROPIC_API_KEYto the gateway host is CORRECT, not a misread.
FAIL if the answer states as fact anything that contradicts items 1–8 — 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 printed to logs; new Anthropic(undefined) throws; an unknown provider silently falls back to anthropic inside the scripts; DEFAULT_MODELS overrides an explicit --model; the scripts themselves remap claude-sonnet-4-6 by literal comparison.
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", or the credential issue in item 8).
PASS if no contradicting claim is present.
"Skill""brooks-review"