Repository navigation
Remove Anthropic key - #434
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9640aca. Configure here.
1 task
Jeffreyhung
added a commit
that referenced
this pull request
Nov 4, 2026
The `evals` job fails before running anything on PRs that touch `packages/evals/` (e.g. #562): `WARDEN_ANTHROPIC_API_KEY is required to run evals in CI`. The workflow only wires the Anthropic secret. Warden's own review workflow dropped that key in #434 and runs on `WARDEN_OPENROUTER_API_KEY`, which resolves fine on the same PRs. The evals harness was also hardcoded to Anthropic: suites skipped without `ANTHROPIC_API_KEY`, and the judge called the Anthropic SDK directly. ## Changes **Provider selection (`packages/evals/src/provider.ts`)** - `WARDEN_EVAL_MODEL`: a Pi `provider/model` selector. When set, it replaces every scenario's model, forces the Pi runtime, and enables the suites without an Anthropic key. - `WARDEN_EVAL_JUDGE_MODEL`: optional judge model. Defaults to `WARDEN_EVAL_MODEL`, then `anthropic/claude-sonnet-4-6`. - Credentials use the existing `WARDEN_<PROVIDER>_API_KEY` convention, which eval setup already bridges to the SDK's env name. - With neither variable set, behavior is unchanged: YAML models, Anthropic key required. **Judge** - `runJudge` now goes through `getRuntime('pi').runAuxiliary` with the configured model instead of `new Anthropic()`. Same prompt, same verdict-count validation, same fail-closed fallback. - Adds an `eval_judge` auxiliary task name so judge calls are labeled in telemetry. - `@anthropic-ai/sdk` is no longer a dependency of `warden-evals`. **Workflow** - `WARDEN_EVAL_MODEL` defaults to `openrouter/anthropic/claude-sonnet-4.6`. That's the same model the suites already pin, so scores stay comparable, on the OpenRouter key the repo already has. The `WARDEN_EVAL_MODEL` / `WARDEN_EVAL_JUDGE_MODEL` repo variables override it. - Passes `WARDEN_OPENROUTER_API_KEY`, `WARDEN_ANTHROPIC_API_KEY`, and `WARDEN_OPENAI_API_KEY`. Unset secrets are empty and harmless. - "Verify eval credentials" checks the `WARDEN_<PROVIDER>_API_KEY` for each selected model and names the missing one. - "Create eval status check" only runs when verification passed. It used to throw a second, misleading `Eval results file not found` on top of the real error. This PR touches `evals.yml`, so its own `evals` run exercises the OpenRouter path end to end. ## Verification - New `provider.test.ts` and `judge.test.ts`. `harness.test.ts` was updated for the new judge options. The evals unit suite passes: 69 tests. - `pnpm lint`, `pnpm build`, and typecheck all pass. The Warden `src/sdk` tests pass. - With no keys, `pnpm evals` skips all 62 evals, same as before. - With `WARDEN_EVAL_MODEL=openrouter/anthropic/claude-sonnet-4.6` and a fake key, the run reaches OpenRouter on Pi and fails with `Authentication required.`. Without a key it fails locally with `No API key found for openrouter`. - I ran the verify step script locally for: valid key, missing key, a judge on a different provider with a missing key, and a selector without a provider. ## Notes - Providers whose SDK env name doesn't follow `<PROVIDER>_API_KEY` (e.g. `vercel-ai-gateway` → `AI_GATEWAY_API_KEY`) still work locally via the SDK's own env name. In CI the verify step expects the `WARDEN_`-prefixed form, so adding one means adding that secret to the workflow env. <!-- junior-request-attribution:start --> via **Jeffrey Hung**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0AH1TP6CHJ%3A1793816729.438159 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AD0AH1TP6CHJ%3A1793816729.438159) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0AH1TP6CHJ%3A1793816729.438159/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Jeffrey Hung <[email protected]> Co-authored-by: Claude <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.