feat(evals): add subscription-first Atomic auth - #1639
Conversation
Assistant-model: GPT-5.5
| finally: | ||
| try: | ||
| temp_path.unlink() | ||
| except OSError: |
| finally: | ||
| try: | ||
| temp_path.unlink() | ||
| except OSError: |
Code ReviewSolid PR overall: the subscription-first selection logic is clearly commented, the provider→env-key table refactor in A few findings, ordered by severity: 1. Anthropic API-key users are silently rerouted to OpenRouter (correctness)
if provider == "anthropic":
return bool(
self._get_env("ANTHROPIC_OAUTH_TOKEN") or self._get_env("ANTHROPIC_API_KEY")
)The README section ("fall back … when the subscription token is unavailable") also doesn't mention that an API key alone triggers the reroute, so users could get OpenRouter results while believing they benchmarked the native API. 2.
|
Summary
Adds subscription-first authentication for the Atomic Pier/Harbor eval adapters, with an OpenRouter fallback when subscription credentials are unavailable, and isolates Atomic's mutable agent state from the benchmark git workspace.
Key changes
ANTHROPIC_OAUTH_TOKENand pass it through to the sandbox; both adapters accept the credential without requiringANTHROPIC_API_KEY.openai-codexentry out of the host's~/.atomic/agent/auth.json(falling back to legacy~/.pi/agent/auth.json), write just that entry to a temp file, upload it into the sandbox,chown/chmod 600it into$HOME/.atomic/agent/auth.json, and remove the temp copy. No Codex-specific auth env vars are introduced, and credential contents are never printed._select_provider_modelswaps to the equivalentopenrouter/anthropic/...oropenrouter/openai/...model before launch when the subscription credential is missing andOPENROUTER_API_KEYis set, since Atomic's CLI has no subscription→OpenRouter retry at the top level. Includes dash-to-dot slug translation (e.g.claude-opus-4-8→claude-opus-4.8) for Anthropic's OpenRouter mirrors.~/.atomic/agent(viaATOMIC_CODING_AGENT_DIR,--session-dir, andATOMIC_TODO_PATH) instead of the benchmark repo, preventing the todo tool or session state from polluting the git workspace under evaluation. Directories are created with700permissions./logsafter the run for Harbor/Pier artifact parsing, with anEXIT/TERMtrap so transcripts are preserved even when a run is killed on timeout.openai-codexprovider registration: added to both adapters' provider env-key and (Pier) network-allowlist maps (chatgpt.com,auth.openai.com), with no required env keys since auth flows through the uploadedauth.jsoninstead.evals/README.mddocuments the Anthropic and OpenAI Codex subscription-first flows, their OpenRouter fallback options, and the updated adapter behavior (agent-state isolation, session-copy-on-exit).Validation
cd evals && uv run python -c "import atomic_pier, atomic_harbor"cd evals && uv run python -m py_compile atomic_pier.py atomic_harbor.py! rg 'CODEX_AUTH|CODEX.*AUTH|AUTH.*CODEX|CODEX_AUTH_JSON|CODEX_TOKEN' evals/atomic_pier.py evals/atomic_harbor.py evals/README.mdgit diff --check -- evals/atomic_pier.py evals/atomic_harbor.py evals/README.mdgit push -u origin feat/evals-subscription-authran repository pre-push hooks successfully, includingbun run lint,bun run check:file-length, andbun run test:unit.Goal-run evidence used
The goal ledger and worker receipt reported the eval objective complete: import/py_compile checks passed, forbidden Codex auth-env grep had no matches, Codex auth provisioning reached live
openai-codexmodel execution in a smoke run, and reviewer quorum accepted remaining P3 findings as non-blocking. The PR focuses on the accepted scope and does not include unrelated.atomic/contextartifacts.