Repository navigation
fix: keep AI usage working when only Claude Code or Codex is signed in - #29
Merged
Merged
Conversation
This was referenced Nov 1, 2026
The widget runs edge to edge in the 523 × 144 preview, so it's resized (0.6% narrower) rather than cropped, which would cut the ends of the pill.
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.
Package
AI usage 1.2.6. With the default Providers: both, the widget failed when only one of Claude Code and Codex was signed in on the Mac. On a Mac with only Claude Code it stopped at
cat ~/.codex/auth.json, on one with only Codex at the Keychain read, and the bar showed an error instead of the provider that works. #28 lists this package for StableBar's setup to suggest to anyone withclaudeorcodex(stablebox/StableBar#405), so it has to work for people who use just one.Changes
usage.sh: withboth, a provider that isn't signed in is skipped and the widget shows the other. The bar and the popup already hide a provider without data (hideWhenEmptyonclaudePlanandcodexPlan), soconfig.jsondoesn't change. With neither signed in, it fails with "Neither Claude Code nor Codex is signed in on this Mac."claudeorcodex) still fails without its sign-in, now with a sentence that says so instead of the error fromsecurityorcat.securityexit status 44, item not found. Any other failure, such as denied Keychain access, still fails, with "StableBar couldn't read Claude Code's sign-in from the Keychain.", so a denied prompt doesn't quietly hide Claude.Access
Unchanged: the same Keychain item (
Claude Code-credentials), the same~/.codex/auth.json, the same hosts (api.anthropic.com,chatgpt.com), nothing inrequiresand no permissions. The script reads the Keychain item once, as before, and adds a check that~/.codex/auth.jsonexists before reading it.Testing
STABLEBAR=…/StableBar.app/Contents/MacOS/StableBar ./scripts/check-package.sh packages/ai-usage, with StableBarmain(cdafc4b) built by its./scripts/build.sh: inspect, install into a scratch configuration and validate pass ("Valid configuration: 1 widgets in 5 files").The script offline, with fake
securityandcurlon the PATH and a scratchHOME:catsecurity(44)securitysecuritysecuritycatclaudeandcodexwith their sign-in still show that provider. When one provider is skipped, the output is valid JSON with only the other provider's fields and list.ShellCheck 0.11.0 passes, and
./scripts/update-readme.shleaves the README unchanged.Not checked: the real Keychain and APIs, or the widget on a bar. The fakes return the shapes the script parses, and the parsing code didn't change.
Claude Opus 5.5 via Claude Code