Add opt-in Claude multi-account support through claude-swap - #481
Draft
Finesssee wants to merge 2 commits into
Draft
Add opt-in Claude multi-account support through claude-swap#481Finesssee wants to merge 2 commits into
Finesssee wants to merge 2 commits into
Conversation
Add a credential-free adapter over cswap --list --json and cswap --switch-to <slot> --json, with schemaVersion 1 validation, source-issued slot identities (claude-swap:<slot>), opt-in setting and executable path, display-only projection, and explicit activation. - rust/src/providers/claude/claude_swap.rs: bounded, no-shell subprocess runner; strict parsers; sanitized display-only mapping that never echoes raw stdout or unknown external strings to UI/logs. - CLI: wire usage --all-accounts for Claude through the adapter. - Tauri: settings snapshot/update, list/switch commands. - UI: ClaudeSwapAccountsSection with opt-in toggle, path field, status and explicit Switch action. - Tests: adapter parsing/limits/secret-safety, CLI payloads, frontend section behavior. Refs #477.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Add an opt-in claude-swap adapter under Claude provider settings, with an executable path, external account usage cards, and explicit account switching. Source-issued slot IDs preserve separate accounts sharing one email. The CLI expands Claude accounts for
usage --all-accountswhen the adapter is enabled and configured.The adapter invokes fixed cswap argument arrays without a shell, requires schema version 1, and projects display fields without importing credentials. Switching invalidates cached Claude usage and requests a refresh. Failed executable-path saves remain retryable.
Related issue
Refs #477.
Affected areas
Validation
UI / tray proof
Draft: fresh native desktop build and CUA/manual visual proof are still outstanding. The frontend build and jsdom checks do not establish native desktop behavior. Live cswap credential switching was not exercised.
Notes for reviewers
Implementation was developed through OpenCode using deepseek-v4.1-flash and reviewed locally. This adds external account cards in settings and CLI enumeration; it does not add simultaneous per-account tray cards. Activation delegates the credential transaction to cswap. Review Windows executable compatibility and subprocess lifecycle behavior before marking ready.