Public: anyone can read this; the crew can change it.

The vendor's own variables (ANTHROPIC_*, CLAUDE_CODE_*) are read only inside the Claude runner's module #16757

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Vendor variable names (ANTHROPIC, CLAUDECODE) are now spelled only in src/crew/runnerenv.ts, and a new test fails if one appears anywhere else in src/. tsc --noEmit is clean. I ran five related test files (the new one plus model-grant, packs-up, subscriptions and run-secrets), and all 48 tests pass.

Notes

opened this

Vendor variable names (ANTHROPIC_*, CLAUDE_CODE_*) are now spelled only in src/crew/runner_env.ts, and a new test fails if one appears anywhere else in src/. tsc --noEmit is clean. I ran five related test files (the new one plus model-grant, packs-up, subscriptions and run-secrets), and all 48 tests pass. I did not run the full bun test, since the forge's check runs it on push. gate.ts --fix ran and produced nothing to commit.

What moved

  • src/crew/grant.ts: the reserved-name pattern no longer lists CLAUDE_ or ANTHROPIC_. It asks a new isVendorVariable(name) in runner_env.ts, next to the existing isModelCredential. Both prefixes are still refused as secret names.
  • src/packs/up.ts: the "crew is off" message prints the key's name from a new API_KEY_VAR export in runner_env.ts. The text is unchanged.
  • Comments: the names in src/core/subscriptions.ts, src/crew/sandbox.ts, src/crew/gateway_door.ts and src/crew/runner.ts are now described in words. gateway_door.ts wasn't on the issue's list, but it had the names too.

The test: test/vendor-names.test.ts scans src/*/.ts for those names and skips runner_env.ts. It ignores DEEPSEC_ANTHROPIC_KEY in src/checks/deepsec_key.ts, which is a different variable.

What I left alone: the many test/ files that spell these names, since the issue only asks about src/. I added no dependencies and reused isModelCredential and the existing runner_env.ts module rather than a new one.

To try it: bun test test/vendor-names.test.ts.

🤖 Generated with Claude Code

Closes #12387

commented

Vendor variable names (ANTHROPIC_*, CLAUDE_CODE_*) are now spelled only in src/crew/runner_env.ts, and a new test fails if one appears anywhere else in src/. tsc --noEmit is clean. I ran five related test files (the new one plus model-grant, packs-up, subscriptions and run-secrets), and all 48 tests pass. I did not run the full bun test, since the forge's check runs it on push. gate.ts --fix ran and produced nothing to commit.

What moved

  • src/crew/grant.ts: the reserved-name pattern no longer lists CLAUDE_ or ANTHROPIC_. It asks a new isVendorVariable(name) in runner_env.ts, next to the existing isModelCredential. Both prefixes are still refused as secret names.
  • src/packs/up.ts: the "crew is off" message prints the key's name from a new API_KEY_VAR export in runner_env.ts. The text is unchanged.
  • Comments: the names in src/core/subscriptions.ts, src/crew/sandbox.ts, src/crew/gateway_door.ts and src/crew/runner.ts are now described in words. gateway_door.ts wasn't on the issue's list, but it had the names too.

The test: test/vendor-names.test.ts scans src/*/.ts for those names and skips runner_env.ts. It ignores DEEPSEC_ANTHROPIC_KEY in src/checks/deepsec_key.ts, which is a different variable.

What I left alone: the many test/ files that spell these names, since the issue only asks about src/. I added no dependencies and reused isModelCredential and the existing runner_env.ts module rather than a new one.

To try it: bun test test/vendor-names.test.ts.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs