Skip to content

feat: multi-provider sessions — /provider switch, /new --provider, backend tags#15

Merged
saucam merged 2 commits into
mainfrom
feat/provider-support
Jul 9, 2026
Merged

feat: multi-provider sessions — /provider switch, /new --provider, backend tags#15
saucam merged 2 commits into
mainfrom
feat/provider-support

Conversation

@saucam

@saucam saucam commented Jul 9, 2026

Copy link
Copy Markdown
Owner

What

The Rust TUI's half of multi-provider sessions (daemon side: codeoid #132 pi backend, #133 mid-session switching):

  • /provider <id> switches the focused session's backend mid-conversation. Sent as a correlated request so the daemon's fail-closed rejections (unknown provider, mid-turn switch) land in the error line with their real message; the switch announcement itself arrives as a normal info row.
  • /new <name> [workdir] --provider <id> creates a session on a specific backend. The flag can lead or trail the positionals, so workdirs with spaces keep working; ids are lowercased; a dangling --provider is a parse error.
  • Backend tags in the transcript header for non-default providers — a mixed claude/pi fleet is tellable apart at a glance.
  • Protocol crate: SessionCreate.providerId, the session.set_provider verb, SessionInfo.providerId, and AuthOkMsg.providers (default first). All additive with serde defaults, so older daemons keep working.

Tests

Parse coverage for /provider (lowercasing, missing-id error) and /new --provider (flag position independence, dangling flag, no-flag default); wire rename-audit samples for the new verb + create field; roundtrip tests for auth.ok.providers and session.set_provider camelCase serialization. 273 workspace tests green; cargo fmt --check clean.

🤖 Generated with Claude Code

…ckend tags

Pairs with the daemon's pi backend (#132) and mid-session switching
(#133):

- /provider <id> switches the focused session's backend; sent via
  request_ok so daemon rejections (mid-turn switch, unknown provider)
  surface with their real message in the error line
- /new grows a --provider <id> flag (positional name/workdir unchanged,
  flag can lead or trail so workdirs with spaces keep working)
- transcript header tags sessions on non-default backends
- protocol: SessionCreate.providerId, session.set_provider verb,
  SessionInfo.providerId, AuthOkMsg.providers (default first); wire
  rename-audit + roundtrip coverage extended; parse tests for the new
  commands
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@saucam, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 33f56a87-a674-40e7-baf8-ae51df1964a3

📥 Commits

Reviewing files that changed from the base of the PR and between 7eac0f0 and 515e977.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • crates/codeoid-client/src/connection.rs
  • crates/codeoid-protocol/src/client.rs
  • crates/codeoid-protocol/src/daemon.rs
  • crates/codeoid-protocol/src/session.rs
  • crates/codeoid-protocol/tests/roundtrip.rs
  • crates/codeoid-protocol/tests/wire_format.rs
  • crates/codeoid-tui/src/app.rs
  • crates/codeoid-tui/src/commands/mod.rs
  • crates/codeoid-tui/src/state/mod.rs
  • crates/codeoid-tui/src/state/sessions.rs
  • crates/codeoid-tui/src/ui/approval.rs
  • crates/codeoid-tui/src/ui/modal.rs
  • crates/codeoid-tui/src/ui/scrollback.rs
  • crates/codeoid-tui/src/ui/worker.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/provider-support

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.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.01878% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.96%. Comparing base (7eac0f0) to head (515e977).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/codeoid-tui/src/app.rs 85.21% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
+ Coverage   67.02%   67.96%   +0.93%     
==========================================
  Files          32       32              
  Lines        7632     7834     +202     
==========================================
+ Hits         5115     5324     +209     
+ Misses       2517     2510       -7     
Flag Coverage Δ
tui 67.96% <92.01%> (+0.93%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/codeoid-client/src/connection.rs 21.53% <100.00%> (+1.65%) ⬆️
crates/codeoid-protocol/src/client.rs 30.76% <100.00%> (+2.76%) ⬆️
crates/codeoid-protocol/src/session.rs 0.00% <ø> (ø)
crates/codeoid-tui/src/commands/mod.rs 95.65% <100.00%> (+0.91%) ⬆️
crates/codeoid-tui/src/state/mod.rs 84.94% <100.00%> (+0.04%) ⬆️
crates/codeoid-tui/src/state/sessions.rs 98.85% <100.00%> (+<0.01%) ⬆️
crates/codeoid-tui/src/ui/approval.rs 100.00% <100.00%> (ø)
crates/codeoid-tui/src/ui/modal.rs 30.31% <100.00%> (+0.12%) ⬆️
crates/codeoid-tui/src/ui/scrollback.rs 80.30% <100.00%> (+0.92%) ⬆️
crates/codeoid-tui/src/ui/worker.rs 66.32% <100.00%> (+0.23%) ⬆️
... and 1 more

- Extract pure session.create / session.set_provider frame builders from
  the async send paths and unit-test the wire shapes (providerId present/
  absent, camelCase fields)
- Guard-path tests: /provider without a focused session records a clear
  error; /provider and /new --provider route cleanly with no connection
- session_title test: non-default backends tagged, claude untagged
- connection kind-map covers session.set_provider
@saucam saucam merged commit a2d49d3 into main Jul 9, 2026
4 checks passed
This was referenced Jul 9, 2026
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