A member is never handed its launcher's ANTHROPIC_BASE_URL or model overrides, so a crew shell on another provider cannot 401 it (martha#102) #129

Closed
opened 2026-11-24 05:11:15 +00:00 by venus · 1 comment
Member

Purpose (fix): a Claude Code member that martha up or martha start launches from a shell whose Claude Code runs on another provider's endpoint still reaches Anthropic with its own billing, instead of failing every prompt with Please run /login · API Error: 401.

Found on the 0.4.0 pilot (macula-io/martha#102 c3465). That comment reads the cause as an inherited ANTHROPIC_AUTH_TOKEN. The launch already drops that variable (f097e80e, martha#916 r=4, NEVER_GIVEN in src/give_a_member_its_own_config/give_a_member_its_own_config.ts), so the cause is a different variable.

What the member is handed, read from /proc/<pid>/environ (variable names only) of the pilot's live Neptunus, pid 1769248, started from Pluto's crew shell. That shell's Claude Code runs on DeepSeek's Anthropic-compatible endpoint:

ANTHROPIC_BASE_URL ANTHROPIC_MODEL ANTHROPIC_SMALL_FAST_MODEL CLAUDECODE CLAUDE_CODE_CHILD_NOTES_DIR CLAUDE_CODE_CHILD_SESSION ...
ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic

No ANTHROPIC_AUTH_TOKEN is handed; the drop works. But ANTHROPIC_BASE_URL, ANTHROPIC_MODEL and ANTHROPIC_SMALL_FAST_MODEL pass through. So a member billed by the owner's subscription sends that sign-in to DeepSeek, which answers 401.

The fix: a billed member is never handed the launcher's endpoint or model overrides, whichever its billing: ANTHROPIC_BASE_URL, ANTHROPIC_MODEL, ANTHROPIC_SMALL_FAST_MODEL, next to ANTHROPIC_AUTH_TOKEN in NEVER_GIVEN. A member's model comes from its declared profile, never from the shell that started it.

Not in this package: the CLAUDE_CODE_* child-session variables (CLAUDECODE, CLAUDE_CODE_SESSION_ID, CLAUDE_CODE_MESSAGING_*) are handed too. No harm from them has been seen; they are noted here only.

Refs macula-io/martha#102

Purpose (fix): a Claude Code member that `martha up` or `martha start` launches from a shell whose Claude Code runs on another provider's endpoint still reaches Anthropic with its own billing, instead of failing every prompt with `Please run /login · API Error: 401`. Found on the 0.4.0 pilot (macula-io/martha#102 c3465). That comment reads the cause as an inherited `ANTHROPIC_AUTH_TOKEN`. The launch already drops that variable (f097e80e, martha#916 r=4, `NEVER_GIVEN` in `src/give_a_member_its_own_config/give_a_member_its_own_config.ts`), so the cause is a different variable. **What the member is handed**, read from `/proc/<pid>/environ` (variable names only) of the pilot's live Neptunus, pid 1769248, started from Pluto's crew shell. That shell's Claude Code runs on DeepSeek's Anthropic-compatible endpoint: ``` ANTHROPIC_BASE_URL ANTHROPIC_MODEL ANTHROPIC_SMALL_FAST_MODEL CLAUDECODE CLAUDE_CODE_CHILD_NOTES_DIR CLAUDE_CODE_CHILD_SESSION ... ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic ``` No `ANTHROPIC_AUTH_TOKEN` is handed; the drop works. But `ANTHROPIC_BASE_URL`, `ANTHROPIC_MODEL` and `ANTHROPIC_SMALL_FAST_MODEL` pass through. So a member billed by the owner's subscription sends that sign-in to DeepSeek, which answers 401. **The fix:** a billed member is never handed the launcher's endpoint or model overrides, whichever its billing: `ANTHROPIC_BASE_URL`, `ANTHROPIC_MODEL`, `ANTHROPIC_SMALL_FAST_MODEL`, next to `ANTHROPIC_AUTH_TOKEN` in `NEVER_GIVEN`. A member's model comes from its declared profile, never from the shell that started it. Not in this package: the `CLAUDE_CODE_*` child-session variables (CLAUDECODE, CLAUDE_CODE_SESSION_ID, CLAUDE_CODE_MESSAGING_*) are handed too. No harm from them has been seen; they are noted here only. Refs macula-io/martha#102
Author
Member

Landed: PR 130 (cb804487) is on main c02dc1f7. The relay job (9098) was green.

Purpose met in code and test: a member billed by the owner's sign-in is no longer handed the launcher's ANTHROPIC_BASE_URL, ANTHROPIC_MODEL or ANTHROPIC_SMALL_FAST_MODEL (ENDPOINT_VARIABLES, dropped for BILLED_BY_SUBSCRIPTION in give_a_member_its_own_config.ts). The test asserts on the environment the member is actually handed.

One difference from the fix as written above: r=1 narrowed the drop to members billed by the sign-in. A member billed by API key keeps ANTHROPIC_BASE_URL, because the recorded-host runs (the CI relay job) reach their stand-in model through it.

Not yet observed live: a pilot member started from a crew shell on another provider getting through to Anthropic. That comes with Pluto's restart of the pilot pair (macula-io/martha#102).

Landed: PR 130 (cb804487) is on main c02dc1f7. The relay job (9098) was green. Purpose met in code and test: a member billed by the owner's sign-in is no longer handed the launcher's `ANTHROPIC_BASE_URL`, `ANTHROPIC_MODEL` or `ANTHROPIC_SMALL_FAST_MODEL` (`ENDPOINT_VARIABLES`, dropped for `BILLED_BY_SUBSCRIPTION` in give_a_member_its_own_config.ts). The test asserts on the environment the member is actually handed. One difference from the fix as written above: r=1 narrowed the drop to members billed by the sign-in. A member billed by API key keeps `ANTHROPIC_BASE_URL`, because the recorded-host runs (the CI relay job) reach their stand-in model through it. Not yet observed live: a pilot member started from a crew shell on another provider getting through to Anthropic. That comes with Pluto's restart of the pilot pair (macula-io/martha#102).
venus closed this issue 2026-11-24 07:30:25 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha#129
No description provided.