Skip to content

feat(claude): select optional cswap accounts for local sessions - #217

Draft
firstintent wants to merge 2 commits into
devfrom
feat/cswap-accounts
Draft

firstintent wants to merge 2 commits into
devfrom
feat/cswap-accounts

Conversation

@firstintent

@firstintent firstintent commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Local Claude sessions can select an authorized account from a preinstalled cswap in the new-session model menu's advanced options. Default login and other vendors work without cswap. Selecting the current default account allows cswap's native fallback; isolated accounts retain their identity and profile across resumes, role switches and delegated children. Explicit grants are checked independently of project access.

The launcher wraps the existing stream-json argv with cswap run, using pipes and a child-local exec relay. The relay preserves binary overrides, keeps auth probes off SDK stdin, verifies the effective profile, and selects fresh/resume in that profile. cswap and Claude retain credential/refresh ownership. Public DTOs expose no profile paths or raw email. Account discovery rejects cswap's optional model-based quota probe. Remote, terminal and non-Claude selection are unsupported.

Maps to local issue docs-local/issues/#229. Based on dev and targets dev. No version bump or deployment.

Validation:

  • make check, make test, real-PTY make test-web, fmt and diff checks passed.
  • SPA production build and make web-check: 871 tests passed; DSH plugin npm test: 287 passed.
  • Playwright: 3 passed for installed/absent cswap and the existing lazy-create flow.
  • make perf-gate passed without changing thresholds: session-list p95 41.51ms, status p95 31.32ms, gateway lock hold p99 0.196ms.
  • Strict auth-probe stdin regression failed before the fix and passed after; offline adapter/relay tests also cover multiple turns, profile-bound resume, slot drift, metadata loss, default fallback, uninstall and account grants.
  • Installed cswap 0.29.0 + Claude Code 2.1.318 completed initialize through the real relay in temporary homes using a fake token; native PID registration was verified. No real subscription inference, OAuth rotation or spend was tested.
  • Independent checker found no remaining blockers after fixes.
  • Final commit CI: https://github.com/firstintent/ccteam/actions/runs/41819942198 (fmt/clippy/deterministic baseline all passed).

@firstintent firstintent closed this Nov 4, 2026
@firstintent firstintent reopened this Nov 4, 2026
@firstintent
firstintent changed the base branch from main to dev November 4, 2026 11:26
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