Skip to content

fix(codex): respect CODEX_HOME when reading auth for usage - #1138

Merged
ymichael merged 1 commit into
get-bb:mainfrom
AndrewSB:fix/codex-home-usage-respect-env
Aug 12, 2026
Merged

ymichael merged 1 commit into
get-bb:mainfrom
AndrewSB:fix/codex-home-usage-respect-env

Conversation

@AndrewSB

@AndrewSB AndrewSB commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Codex thread execution inherits CODEX_HOME, but the host-daemon auth reader used by Settings usage, structured inference, and voice transcription always read ~/.codex/auth.json.

With a second Codex account under a custom CODEX_HOME, threads therefore used the configured account while usage and other host-daemon auth consumers used the default account.

Fix

  • resolve Codex home from CODEX_HOME, falling back to <home>/.codex
  • keep one testable resolver in @bb/config/codex-home and reuse it from command/skill discovery and the archive script
  • read the explicitly named auth.json file from that resolved home
  • add a regression test with conflicting default and configured credentials, plus resolver and archive coverage

Verification

  • pnpm exec turbo run typecheck --filter=@bb/host-daemon
  • pnpm exec turbo run test --filter=@bb/host-daemon --force (533 tests)
  • pnpm exec turbo run typecheck test --filter=@bb/config --filter=@bb/scripts --force (193 tests)

Fixes #1324

Use one shared Codex home resolver for host-daemon state reads and the archive script, and cover custom auth roots with regression tests.

Fixes get-bb#1324
@ymichael
ymichael force-pushed the fix/codex-home-usage-respect-env branch from 20a378c to 27b7740 Compare August 12, 2026 02:24
@ymichael
ymichael merged commit 060d5e3 into get-bb:main Aug 12, 2026
9 checks passed
fahmiirsyadk pushed a commit to fahmiirsyadk/bb that referenced this pull request Aug 12, 2026
## Problem

Codex thread execution inherits `CODEX_HOME`, but the host-daemon auth
reader used by Settings usage, structured inference, and voice
transcription always read `~/.codex/auth.json`.

With a second Codex account under a custom `CODEX_HOME`, threads
therefore used the configured account while usage and other host-daemon
auth consumers used the default account.

## Fix

- resolve Codex home from `CODEX_HOME`, falling back to `<home>/.codex`
- keep one testable resolver in `@bb/config/codex-home` and reuse it
from command/skill discovery and the archive script
- read the explicitly named `auth.json` file from that resolved home
- add a regression test with conflicting default and configured
credentials, plus resolver and archive coverage

## Verification

- `pnpm exec turbo run typecheck --filter=@bb/host-daemon`
- `pnpm exec turbo run test --filter=@bb/host-daemon --force` (533
tests)
- `pnpm exec turbo run typecheck test --filter=@bb/config
--filter=@bb/scripts --force` (193 tests)

Fixes get-bb#1324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bb settings for model account usage don't respect CODEX_HOME

2 participants