[REVIEW STAGING] Support CLAUDE_CODE_EFFORT and CLAUDE_CODE_OAUTH_TOKEN for the Claude Code agent - #1
[REVIEW STAGING] Support CLAUDE_CODE_EFFORT and CLAUDE_CODE_OAUTH_TOKEN for the Claude Code agent#1rrailton wants to merge 2 commits into
Conversation
HighBenchmark log artifacts committed at repo root ( These are run artifacts from the experiment described in the PR body, not part of either commit's stated scope (neither commit message mentions them). The PR body says the same diff will target LowNo fail-fast validation of A typo (
A subscription-only user (the exact audience of the second commit) who runs the preflight gets told their Anthropic credentials are missing even though benchmarks will work. Worst case is confusion, not breakage. Suggested fix: teach Unescaped single-quote wrapping in env setup applies to the new token ( Pre-existing pattern (API keys go through the same path), so not introduced by this PR — noting only because this PR adds a new secret flowing through it. No action needed unless touching that function anyway. Handoff readiness
Scoping verdict (for author's merge decision)
🤖 Left by Claude Code |
Mirrors OPENAI_CODEX_REASONING_EFFORT (dbt-labs#149): an optional env-var override for Claude Code's --effort level (low|medium|high|xhigh|max), useful when comparing agents or model configurations at matched effort levels. Set via env var rather than a constructor kwarg so the existing harness/factory plumbing doesn't need to change.
7c8e047 to
aa8abf4
Compare
…nner Review findings from #1: pilot logs were swept into history by git add -A; effort typos previously burned a container batch before the CLI rejected them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Eet1UBLbqnwM4fHQKdNxLM
|
All four findings resolved or dispositioned; branch force-pushed (old tip preserved at
Tests: 17/17 passing on the rewritten branch. 🤖 Left by Claude Code |
MediumTrial arithmetic in the PR body doesn't reconcile (PR description, "Why" section) — Goal-fit: Goal-adjacent · Effort: trivial "all 60 ready duckdb+dbt tasks (75 trials/arm, 1 attempt)" — 60 tasks × 1 attempt is 60 trials, not 75. Presumably some tasks run multiple variants/trials, but an upstream reviewer doing the same arithmetic will trip on it, and this body ships verbatim to LowWhitespace-handling skew between the preflight and the agent ( A whitespace-only No unit test for the check.py OAuth branch — Goal-fit: Polish · Effort: one-edit The precedence logic now lives in two places (agent Handoff readiness
Scoping verdict (for author's merge decision)
🤖 Left by Claude Code |
When set, the Claude Code agent authenticates the sandboxed CLI with a long-lived subscription OAuth token (from `claude setup-token`) instead of an API key, letting subscription holders run benchmarks against their plan's usage quota rather than metered API billing. ANTHROPIC_API_KEY remains the default when the token is not set. Also teaches the `ab check environment anthropic` preflight to accept the token, so OAuth-only environments don't report missing credentials.
aa8abf4 to
4d93e4e
Compare
|
Round-2 findings resolved; commit 2 amended and force-pushed (
Taking the round note's recommendation: no round 3; proceeding to the upstream submission after author sign-off. 🤖 Left by Claude Code |
|
Review staging complete (2 rounds, all findings resolved). Shipped upstream as dbt-labs#153 — closing without merge as intended; branch retained. 🤖 Left by Claude Code |
Note
Fork-internal staging PR for review only — do not merge. The real PR will target
dbt-labs/ade-bench:mainwith this same diff after review.What
Two opt-in env vars for the Claude Code agent, in two separable commits:
CLAUDE_CODE_EFFORT— appends--effort <value>(low|medium|high|xhigh|max) to theclaudeinvocation. This is the Claude Code counterpart ofOPENAI_CODEX_REASONING_EFFORT(DI-4253: support OPENAI_CODEX_REASONING_EFFORT env var dbt-labs/ade-bench#149), with the same design: an env var rather than a constructor kwarg, so no harness/factory plumbing changes. Value isshlex.quoted. Note--effortrequires a recent Claude Code CLI; the setup script installs latest, so this can't regress existing runs.CLAUDE_CODE_OAUTH_TOKEN— when set, the sandboxed CLI authenticates with a long-lived subscription OAuth token (fromclaude setup-token) instead ofANTHROPIC_API_KEY, letting subscription holders run benchmarks against their plan quota rather than metered API billing. The API key remains the default; this commit is separable if a single auth path is preferred.Both are covered by unit tests mirroring
test_openai_codex_agent.py(no-env-var, value emitted, shell-quoting; plus auth-precedence cases). Neither changes behavior when the env vars are unset.Why
Same motivation as dbt-labs#149: comparing agents/models at matched effort levels. As a working example, we used this to run all 60 ready duckdb+dbt tasks — 75 trials per arm once per-task prompt variants are included — at 1 attempt per trial (Claude Code pinned to 2.1.207) comparing
claude-fable-5 --effort lowvsclaude-opus-4-8 --effort xhigh:i.e. statistical parity on outcomes with a ~2x latency and ~4x token gap — the kind of readout this flag makes easy to produce.
Testing
pytest tests/agents/installed_agents/— 17 passed (11 existing + 6 new)--effortflag is present in the recorded container commands (commands.txtartifacts), and OAuth auth confirmed via subscription usage accountingmodelUsageaudit across all 75 fable-5 trials confirmed no cross-model fallback occurred (fable-5 + the CLI's internal Haiku utility model only)🤖 Left by Claude Code