- Restructure ClaudeSDKClient async context to catch initialization
timeouts as TransientAgentError instead of crashing the runner
- Add catch-all error handler in hunt stage so a single task failure
doesn't abort the entire run
- Add repair_attempts: 2 to gapfill and feedback stages
- Fix priority field type in gapfill/feedback prompts (integer, not string)
Adds a fourth auth mode (api_key) for users who want to bill against
their own Anthropic API account instead of through a Claude Code
subscription. The mode is opt-in to preserve the existing 'subscription
only' default — users who have ANTHROPIC_API_KEY set in their shell for
other tools won't accidentally be billed metered rates here.
Opt-in via either:
--allow-api-key (CLI flag on auth-check and run)
AUDIT_ALLOW_API_KEY=1 (env var; useful for CI)
When opted in, the precedence matches the underlying SDK:
gateway > api_key > oauth_token > keychain_login
ANTHROPIC_AUTH_TOKEN is scrubbed in api_key mode so a stale gateway
token can't outrank the API key (rung 2 > rung 3 in SDK precedence).
Default behavior is unchanged: with allow_api_key=False (or absent),
ANTHROPIC_API_KEY is scrubbed and one of the subscription modes wins,
exactly matching the original behavior.
Tests: 54/54 pass (4 new api_key-mode tests; existing tests updated to
explicitly assert the upstream default-scrub behavior they relied on).
Error message updated to mention --allow-api-key when the user has set
ANTHROPIC_API_KEY but no subscription auth, so the failure mode is
self-explanatory.