Skip to content

Retain Claude Desktop usage access across refreshes - #18

Merged
euforic merged 1 commit into
mainfrom
euforic/claude-keychain-retention
Sep 8, 2026
Merged

Retain Claude Desktop usage access across refreshes#18
euforic merged 1 commit into
mainfrom
euforic/claude-keychain-retention

Conversation

@euforic

@euforic euforic commented Sep 8, 2026

Copy link
Copy Markdown
Member

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.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Copilot AI lite review requested due to automatic review settings September 8, 2026 22:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T22:10:08.046500Z 5d8263c PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Re-read a rotated Desktop key

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 👍 / 👎.

@euforic
euforic merged commit 530c633 into main Sep 8, 2026
2 checks passed
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.

2 participants