Skip to content

Port upstream 0.65.0: respect read-only claude-swap adapters - #631

Draft
Finesssee wants to merge 1 commit into
port/upstream-0.65.0from
port/micro-0.65.0-claude-swap-read-only
Draft

Finesssee wants to merge 1 commit into
port/upstream-0.65.0from
port/micro-0.65.0-claude-swap-read-only

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

Respect read-only claude-swap account adapters. The cswap --list --json schema-v1 envelope may carry an optional top-level boolean supportsAccountSwitching (absent means true). When it is false, usage, account details and the active marker remain, but no Switch or Reauthenticate action is projected for any row, and the shell rejects switch/reauthenticate for that list. A present non-boolean value (including null, numbers, strings, arrays, objects) fails the whole payload with MalformedShape("supportsAccountSwitching is not a boolean").

Upstream reference

  • Release bullet (v0.65.0): "Claude: respect read-only account adapters, preserving usage and account details while hiding switching and re-authentication actions" (Support read-only Claude account adapters steipete/CodexBar#3658; f21dbeb37 / fix(claude): honor read-only account adapters steipete/CodexBar#3846).
  • Tag-pinned reads (v0.65.0): Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountList.swift (supportsAccountSwitching, default true, exact error text), ClaudeSwapAccountProjection.swift (canActivate: list.supportsAccountSwitching && ...), Tests/CodexBarTests/ClaudeSwapListParserTests.swift, ClaudeSwapAccountProjectionTests.swift, ClaudeSwapSwitchErrorTimingTests.swift, docs/claude-multi-account-and-status-items.md.

Ported / Deferred

Ported: parser field and validation, projection gating (action_for_account now takes the list), shell rejection in validate_claude_swap_operation, tests. The existing UI already renders no button when action is null, so no frontend change; a Vitest test pins it.
Deferred: none. The other hunks of the upstream commit (scoped-window parse refactor, projected-usage snapshot inlining) are behavior-preserving refactors and were not ported.

Validation

  • cargo +1.98.0 fmt --all; cargo +1.98.0 clippy --workspace --all-targets -- -D warnings: clean
  • cargo +1.98.0 test -p codexbar claude_swap: 40 passed, 0 failed
  • cargo +1.98.0 test -p codexbar-desktop-tauri claude_accounts: 7 passed, 0 failed
  • pnpm exec vitest run .../ClaudeSwapAccountsSection.test.tsx: 8 passed; pnpm run build: ok; pnpm run lint: only pre-existing warnings in untouched files

Affected areas

  • Rust backend (claude-swap parser/projection)
  • Tauri shell command validation
  • Settings UI (test only, no component change)

UI proof

Pending: coordinator will capture CUA proof on a fresh build.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant