Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

[bug] Statusline money row shows "⚡ Paying · Anthropic API key" and an "API SESSION…

Open IvanLeontev-stack opened this issue 1 month ago • 1 comments

What happened

Statusline money row shows "⚡ Paying · Anthropic API key" and an "API SESSION $N" header on a subscription session, which made me think my session was billing the API. It happens when ANTHROPIC_API_KEY is in [removed]/.env, where OverageSystem.md says to put it for the emergency lane.

Summary

On a plain subscription login (OAuth), the status line's money row reads "⚡ Paying · Anthropic API key · $N this session" and the band shows "API SESSION $N" as soon as ANTHROPIC_API_KEY is present in [removed]/.env, which is where LIFEOS/DOCUMENTATION/Overage/OverageSystem.md (§ Current state) says to add the Console key for the emergency API lane.

Cause, as far as I can trace it:

  1. Bun loads .env from the working directory automatically. The status line runs with the session's cwd, and lifeos starts sessions at the install root, so the status line process sees ANTHROPIC_API_KEY even though Claude Code itself does not have it (checked with ps eww on every claude process: no key; no apiKeyHelper, no primaryApiKey; the session bills the subscription, and the Console shows $0 spent).
  2. Without the private LIFEOS/TOOLS/StatusLinePrivate.ts (which the release does not ship, per LIFEOS/STATUSLINE/Private.ts), the public fallback decides the pay mode from the key's presence alone: LIFEOS/STATUSLINE/producers/UsageView.ts:20 and genericPay in LIFEOS/TOOLS/StatusLineMoney.ts:432.
  3. The "$N this session" figure is Claude Code's estimated session cost from stdin, which it reports on subscription sessions too, so it reads as real spend.

Expected: on a public install, a key that only the emergency lane uses should not flip the session to "Paying". Possible directions: decide pay mode from what Claude Code reports about its own auth rather than from process.env, or run the status line's bun with --no-env-file, or read the key only inside the lane tools.

Version: LifeOS 8.761.0, Algorithm v8.45.0, macOS.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

IvanLeontev-stack avatar Oct 29 '26 16:10 IvanLeontev-stack

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @IvanLeontev-stack for the trace. When Claude Code reports subscription rate limits on stdin, the status line now drops ANTHROPIC_API_KEY from the environment it reads, so a key kept in .env no longer flips the money row to "Paying · Anthropic API key". A session with no rate limits, which means an API session, still reads the key as before. This lands in the next release.

danielmiessler avatar Nov 06 '26 13:11 danielmiessler