• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / ralphex / 25509109438
83%

Build:
DEFAULT BRANCH: master
Ran 07 May 2026 04:38PM UTC
Jobs 1
Files 42
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 May 2026 04:37PM UTC coverage: 82.751% (+0.2%) from 82.574%
25509109438

push

github

web-flow
feat: add preserve_anthropic_api_key option for API-key auth (#333) (#335)

* feat: add preserve_anthropic_api_key option for API-key auth (#333)

ralphex unconditionally stripped ANTHROPIC_API_KEY from the child claude
process environment. This broke users who authenticate Claude Code via
ANTHROPIC_API_KEY rather than OAuth/keychain — claude started without
credentials, printed "Not logged in", and ralphex bailed out matching
that string against claude_error_patterns.

The strip was deliberate: an OAuth-authenticated user with ANTHROPIC_API_KEY
exported for the SDK would otherwise have claude silently switch to the API
key and bill a different account. Removing the strip unconditionally is not
acceptable, so this change makes it opt-in.

Add `preserve_anthropic_api_key` config option and `--preserve-anthropic-api-key`
CLI flag, default false (existing OAuth-protective behavior). When enabled,
ANTHROPIC_API_KEY is passed through to the claude child. CLAUDECODE continues
to be stripped unconditionally (prevents nested-session errors).

Implementation:
- new claudeChildEnv() helper in pkg/executor/executor.go
- preserveAPIKey field on execClaudeRunner, PreserveAnthropicAPIKey on ClaudeExecutor
- config field with INI parsing, merge sentinel only on Values (Config carries the
  resolved bool, matching the move_plan_on_completion pattern)
- CLI flag + applyCLIOverrides plumbing
- propagation to both task and review ClaudeExecutor instances in runner.go

Tests: TestClaudeChildEnv (5 subtests), TestLoad_PreserveAnthropicAPIKey (3
subtests + invalid-value case), TestPreserveAnthropicAPIKeyFlag (3 subtests).

Fixes #333

* review: address PR #335 feedback

- Add --no-preserve-anthropic-api-key companion flag for per-run safety
  override (go-flags rejects --bool=value, so a paired flag is the
  idiomatic way to express explicit-false override). On conflict the
  no-form wins on safety bias to avoid the billing footgun where a
  config-set true sticks across a... (continued)

78 of 90 new or added lines in 5 files covered. (86.67%)

6894 of 8331 relevant lines covered (82.75%)

225.83 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
45.65
1.06% cmd/ralphex/main.go
Jobs
ID Job ID Ran Files Coverage
1 25509109438.1 07 May 2026 04:38PM UTC 42
82.75
GitHub Action Run
Source Files on build 25509109438
  • Tree
  • List 42
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • befb2a90 on github
  • Prev Build on master (#25464741497)
  • Next Build on master (#25566794495)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc