Muse Code: manual Refresh never prompts for Keychain (0.84.0), and the Keychain Access fallback silently fails on the CLI's partition list

Open
#5,069 3 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
44/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
macos, swift

Research direction

Start by tracing the Muse credential read path in MuseCredentials.keychainAccessToken() and the .interactionRequired handling through KeychainPromptHandler; the issue says one of isInstalled, claimCredentialRead, or notifyIfHandled fails, but does not identify which. Also review docs/muse.md and the Muse card diagnostic for the partition list instructions. Done when manual Refresh reliably prompts for Keychain access and the documented fallback explains how to make the ACL change succeed.

Written by the indexing model from the issue text.

Description

clawsweeper:needs-security-review clawsweeper:no-new-fix-pr impact:auth-provider impact:security impact:ux-release-blocker issue-rating: 🦪 silver shellfish P0

Summary

Getting the Muse Code card to read a Keychain-backed muse login took me most of a day. Two things blocked it:

  1. The manual Refresh grant from #4489 never shows the explanation alert or the macOS prompt in 0.84.0. The card stays on "CodexBar is not allowed to read them".
  2. The fallback in docs/muse.md (Keychain Access → ai.meta.dev.credentials → Access Control → add CodexBar) silently does nothing: Save Changes has no effect and no password prompt appears. The Muse CLI creates the item with a partition list that only contains Meta's team ID, so Keychain Access cannot change its ACL.

Related: #4487 (closed by #4489).

Environment

  • CodexBar 0.84.0, Homebrew cask, app + bundled CLI
  • Muse Code CLI 1.4.14 (muse login, Keychain storage)
  • macOS 26 (Tahoe), Apple Silicon

1. Manual Refresh never prompts

Steps: enable Muse Code, open the menu on the Muse Code tab, click Refresh. Also tried with Codex and Claude disabled so Muse is the only provider, in case another provider consumed the single interactive allowance. No denial cooldown is stored (browserCookieAccessDeniedUntil absent).

Log during the Refresh (log stream --level debug --predicate 'process == "CodexBar"'):

[keychain-preflight] Keychain preflight requires interaction for the current process (service=ai.meta.dev.credentials)
[muse] Provider fetch failed (errorCategory=auth provider=muse sources=muse.oauth (oauth): failed: auth)

No KeychainPromptMessage.museToken alert, no SecurityAgent dialog. Reading MuseCredentials.keychainAccessToken(), the .interactionRequired branch needs KeychainPromptHandler.isInstalled, claimCredentialRead and notifyIfHandled to all succeed, so one of them returns false on this path. I did not dig further.

2. Keychain Access cannot save the ACL change

The item as created by the Muse CLI (security dump-keychain -a, secret not shown):

decrypt:      applications (1): .../muse-aarch64-macos   (identifier "muse-arm64", team V9WTTPBFK9)
partition_id: teamid:V9WTTPBFK9
change_acl:   applications (0)

Adding CodexBar.app in Keychain Access and clicking Save Changes does nothing (no prompt, ACL unchanged in dump-keychain). It worked once the partition list was widened first:

security set-generic-password-partition-list \
  -S "teamid:V9WTTPBFK9,teamid:Y5PE65HELJ,apple:,apple-tool:" \
  -s ai.meta.dev.credentials -a meta -k "<login keychain password>"

After that, Keychain Access Save Changes asked for the password and the ACL listed CodexBar and CodexBarCLI. The card now shows the 5 h and weekly windows, matching muse usage. Muse refreshes its token in place (creation date unchanged), so the grant has survived so far.

Suggestions

  • Fix or diagnose the manual Refresh grant for Muse Code (#4489 path).
  • In docs/muse.md and the card's diagnostic, mention the partition list: run the security set-generic-password-partition-list step above before Keychain Access, or Keychain Access fails silently.
  • Optionally, CodexBar could detect a partition list without its team ID and say so in the diagnostic.

Happy to test a build.

Dominant language
Swift
Stars
23.3k
Forks
2.2k
Avg merge
1d 18h
Merged PRs (30d)
231

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from steipete/CodexBar

All issues in steipete/CodexBar

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.