Skip to content

chore(upstream): update cswap to b83b910 (v1.1.0) - #22

Merged
BlackHole1 merged 1 commit into
mainfrom
claude/upstream-sync-patches-d1cb8f
Nov 13, 2026
Merged

BlackHole1 merged 1 commit into
mainfrom
claude/upstream-sync-patches-d1cb8f

Conversation

@BlackHole1

Copy link
Copy Markdown
Owner

Moves the pinned cswap from v1.0.0 to v1.1.0. The patch series stays at six: upstream fixed things near three of them but covers none in full, so nothing is dropped and three are adjusted where they meet the new code.

The live-owner patch and realiti4/claude-swap#523 share a root cause, ~/.claude.json naming one slot while the live credential belongs to another. Upstream repairs it at switch time, the patch on every collect pass, so both are needed. Upstream's repair writes only a strictly later generation, and the patch's heal wrote on ownership alone, so the heal now follows the same ordering: a stored login is replaced only by a later expiresAt, and a login with no expiry (a setup token), a backup that cannot be read and an API-key slot are left alone. Four new tests fail without the guard. A backup the heal already advanced reads as foreign-synced at the switch, so the two never write twice. This guard is a hardening on top of the sync and can be dropped on its own.

realiti4/claude-swap#581 lists the settings.json keys nothing reads in cswap config and the auto-switch log. It knows only upstream's sections, so it reported session.shareHistory as having no effect while the share-history patch still reads it. The key is now left out of that list while it decides, and is listed, pointing at run.shareHistory, once the new key answers.

cswap refresh goes through upstream's shared collector, so it picks up the read-only rule for a default login polled from another profile (realiti4/claude-swap#433), the Fable probe pause (realiti4/claude-swap#583) and the new error texts without changes. Only its test double needed the extra argument upstream now passes to _fetch_account_usage.

The desktop and chrome patches conflicted in text only, against the new usage.fableProbe setting. The distribution patch is unchanged apart from line numbers.

The base stops at the v1.1.0 tag, with origin/main three commits ahead at 1.2.0b1 (ui.orgTag, realiti4/claude-swap#426). bun run patches export --check, bun run patches verify and bun run test (4021 passed, 10 skipped, macOS) pass. Not run: bun run build, a local install, other platforms.

All six patches stay: upstream covers none of them in full. Three are
adjusted where they meet new upstream code.

- live owner: upstream now repairs the same stale-config state at switch
  time (realiti4/claude-swap#523) and writes only a strictly later
  generation. The collect-time heal follows the same ordering, and leaves
  an unreadable backup, a login with no expiry and an API-key slot alone.
- share history: upstream lists settings.json keys nothing reads
  (realiti4/claude-swap#581). `session.shareHistory` is left out of that
  list while it still decides.
- refresh: the test double takes the stored reading upstream now passes
  to `_fetch_account_usage`.

The desktop and chrome patches only conflicted in text with upstream's
new `usage.fableProbe` setting.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary by CodeRabbit

  • New Features
    • Added commands to refresh usage sequentially and manage separate Chrome and Claude Desktop profiles for stored accounts.
    • Chrome profiles can follow account switches when enabled; desktop profiles can share session state where supported.
  • Bug Fixes
    • Improved active-account detection when live credentials differ from the configured slot.
    • Preserved legacy session-sharing choices when newer settings are unavailable.
  • Improvements
    • Update checks, version reporting, and upgrade guidance now reflect the installed distribution.
    • Refresh failures retain the last recorded usage and report retry deadlines when available.

Walkthrough

This patch series adds serial usage refresh, stored Chrome and Claude Desktop profiles, and distribution-aware version and installation reporting. It also changes live credential owner resolution, adds a legacy share-history fallback, and updates the tracked upstream revision.

Changes

Usage refresh

Layer / File(s) Summary
Serial usage refresh
patches/feat_add_a_refresh_command_that_fetches_usage_now_one_account_at_a_time.patch
Adds cswap refresh [num|email ...]. The command resolves selected accounts, refreshes them one at a time, reports outcomes, and returns a failure status when required. Forced reservation bypasses the specified checks but still rejects dead refresh tokens and live claims. Tests cover command handling and fetch ordering.

Chrome account profiles

Layer / File(s) Summary
Chrome command and settings
patches/feat_open_chrome_as_a_stored_account_so_claude_in_chrome_follows_it.patch
Adds the chrome command and its settings. Interactive switches can trigger an existing Chrome profile when follow-switch is enabled.
Chrome profile lifecycle
patches/feat_open_chrome_as_a_stored_account_so_claude_in_chrome_follows_it.patch
Integrates Chrome profiles with account deletion and purge. The switcher checks for open browsers and reports profiles included in purge.

Claude Desktop account profiles

Layer / File(s) Summary
Desktop command and settings
patches/feat_open_claude_desktop_as_a_stored_account_one_window_per_account.patch
Adds the desktop command and settings for app selection and session sharing. Settings loading and configuration tests are updated.
Desktop profile lifecycle
patches/feat_open_claude_desktop_as_a_stored_account_one_window_per_account.patch
Checks profile process state during deletion, swap, move, and purge operations. Profile relocation attempts restore moved profiles when an operation fails.

Distribution-aware reporting

Layer / File(s) Summary
Distribution identity in installation hints
patches/feat_report_check_and_upgrade_the_distribution_this_install_came_from.patch
Menu-bar installation hints use the installed distribution name and its [menubar] extra. The patch summary also reports distribution-aware version, update, cache, build identity, and upgrade behavior.

Live credential ownership

Layer / File(s) Summary
Owner resolution and backup healing
patches/fix_follow_the_live_credentials_owner_when_the_config_names_another_slot.patch
The switcher resolves the active slot from live credential ownership and applies guarded backup updates. Tests cover ownership resolution, expiry comparisons, unreadable backups, and API-key slots.

Share-history compatibility

Layer / File(s) Summary
Legacy share-history fallback
patches/fix_keep_the_share_history_choice_an_earlier_aswap_release_stored.patch
explicit_share_history checks run.shareHistory first and uses session.shareHistory when the run value is absent or not boolean. Tests cover precedence and legacy-key reporting.

Tracked upstream revision

Layer / File(s) Summary
Update upstream revision
upstream.json
Changes the tracked upstream commit from 56d7c2a to b83b910.

Estimated code review effort: 5 (Critical) | ~120 minutes

Change: Other

Possibly related PRs

  • BlackHole1/aswap#18: Adds run.shareHistory with a legacy fallback, which this change continues to handle.
  • BlackHole1/aswap#21: Sets the prior upstream pin and provides the patch state that this change updates.
Merge Risk: Minimal · up to d739f

This updates the pinned upstream version and adjusts three patches to match it. No concrete merge-blocking defect was found. Cross-platform behavior and the build were not exercised, which is normal pre-merge validation.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "chore(upstream): update cswap to b83b910 (v1.1.0)" follows the required (): format, uses English, and matches the main change: the pinned upstream revision is moved f…
Description check Passed The description states the change clearly: the pinned cswap moves from v1.0.0 to v1.1.0, and it explains the six patches, the three adjusted patches (live-owner heal guard, share-history settings list…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "chore(upstream): update cswap to b83b910 (v1.1.0)" follows the required <type>(<scope>): <subject> format, uses English, and matches the main change: the pinned upstream revision is moved from v1.0.0 to b83b910 (v1.1.0), as recorded in upstream.json.

Full details: Description check

Explanation

The description states the change clearly: the pinned cswap moves from v1.0.0 to v1.1.0, and it explains the six patches, the three adjusted patches (live-owner heal guard, share-history settings listing, refresh test double), the conflict resolutions, and the verification commands run. This matches the raw summary and the objectives.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 78f03c05-d09e-4ed5-ab03-c35d35b433a2
Commits

Reviewing files that changed from the base of the PR and between 301f142 and d739fc5.

Files selected for processing: 7

  • patches/feat_add_a_refresh_command_that_fetches_usage_now_one_account_at_a_time.patch
  • patches/feat_open_chrome_as_a_stored_account_so_claude_in_chrome_follows_it.patch
  • patches/feat_open_claude_desktop_as_a_stored_account_one_window_per_account.patch
  • patches/feat_report_check_and_upgrade_the_distribution_this_install_came_from.patch
  • patches/fix_follow_the_live_credentials_owner_when_the_config_names_another_slot.patch
  • patches/fix_keep_the_share_history_choice_an_earlier_aswap_release_stored.patch
  • upstream.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@BlackHole1
BlackHole1 merged commit 408298c into main Nov 13, 2026
4 checks passed
@BlackHole1
BlackHole1 deleted the claude/upstream-sync-patches-d1cb8f branch November 13, 2026 04:52
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