Retain Claude Desktop usage access across refreshes - #18
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d8263c43e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| private func readKeychainPassword(service: String, account: String?) -> String? { | ||
| private mutating func safeStorageKey(allowKeychainInteraction: Bool) -> Data? { | ||
| if let desktopKey { return desktopKey } |
There was a problem hiding this comment.
If Claude recreates or rotates its Safe Storage item while AgentDock remains open, this unconditional return keeps using the obsolete derived key even during an interactive manual refresh. The newly encrypted token caches then fail to decrypt, and allowKeychainInteraction: true never causes another Keychain read, so live usage remains unavailable until AgentDock is restarted. Retry the Keychain lookup when the retained key cannot decrypt the current profile state.
Useful? React with 👍 / 👎.
Claude usage refreshes recreated the credential reader and reread the shared Desktop Keychain item for every profile, causing repeated access prompts. Retain the derived Desktop decryption key in memory for the usage client's lifetime while rereading each profile's current token and account identity. Manual refresh still allows authorization, with guidance to choose Always Allow; background reads also suppress legacy Keychain dialogs.
Validation: full application tests, 98 vendored renderer tests, and the privacy audit pass locally. A real isolated Keychain test verifies reuse after the synthetic item is removed, fresh token/account reads across profiles, and that the key is not persisted. Existing identity and filesystem safety checks remain enforced.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.