Repository navigation
fix(codex): respect CODEX_HOME when reading auth for usage - #1138
Merged
Merged
Conversation
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
force-pushed
the
fix/codex-home-usage-respect-env
branch
from
August 12, 2026 02:24
20a378c to
27b7740
Compare
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
CODEX_HOME, falling back to<home>/.codex@bb/config/codex-homeand reuse it from command/skill discovery and the archive scriptauth.jsonfile from that resolved homeVerification
pnpm exec turbo run typecheck --filter=@bb/host-daemonpnpm 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