Skip to content

feat: surface backend-switch + fork on telegram and web#147

Merged
saucam merged 2 commits into
mainfrom
feat/fork-provider-ui
Jul 10, 2026
Merged

feat: surface backend-switch + fork on telegram and web#147
saucam merged 2 commits into
mainfrom
feat/fork-provider-ui

Conversation

@saucam

@saucam saucam commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What

Surfaces two already-shipped daemon capabilities on the remaining UIs so every client can drive them, not just the TUI:

The TUI's matching /fork command lands in a separate codeoid-ui PR (saucam/codeoid-ui#17), completing fork across all three UIs.

Telegram

  • /provider — no arg lists the available backends; /provider <id> switches the attached session's backend.
  • /fork [backend] — forks the attached session (optionally onto another backend) and auto-attaches to the fork (detach parent → attach fork), mirroring /attach.
  • Both registered in the bot command menu (setMyCommands).

Web

  • A ForkButton sits next to the provider picker in SessionControls:
    • single-backend daemon → a plain ⑃ fork button (branch, same backend).
    • multi-backend daemon → a ⑃ fork ▾ dropdown: fork (same backend) plus a continue on section listing the other backends.
    • on success it merges the returned session into the store and focuses it.
  • /fork added to the help modal.

Tests

  • web: ForkButton — plain fork sends no providerId; fork-onto-backend sends providerId; inline rejection surfaced. (9 SessionControls tests pass.)
  • telegram: handlers exercised via the existing frontend test harness.
  • Daemon tsc --noEmit clean; web tsc -b --noEmit clean.

Rebased onto main after #145/#146 merged, so this is a single UI-only commit.

🤖 Generated with Claude Code

Fills the UI gaps for the multi-backend + fork features:
- Telegram gained NEITHER provider-switch nor fork; add /provider (list
  backends / switch the attached session) and /fork ([backend] optional)
  which branches and auto-attaches to the fork so the next message goes
  to the branch. Both in the command menu + descriptions.
- Web had the ProviderPicker (backend switch) but no fork; add a
  ForkButton next to it — a plain fork on single-backend daemons, and a
  'fork onto <backend>' dropdown on multi-backend ones ('continue this
  conversation on codex'). Success merges the returned SessionInfo and
  focuses the fork, same as create. HelpModal gains /fork.

Web tests: ForkButton plain fork (no providerId), fork-onto-backend
(providerId sent), and inline rejection. Telegram handlers mirror the
existing /model + /attach patterns. Daemon suite unchanged.
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.17%. Comparing base (f253302) to head (3bb7630).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/frontends/telegram/index.ts 95.71% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
+ Coverage   83.11%   83.17%   +0.06%     
==========================================
  Files         104      104              
  Lines       17864    17932      +68     
==========================================
+ Hits        14847    14915      +68     
  Misses       3017     3017              
Flag Coverage Δ
daemon 83.17% <95.71%> (+0.06%) ⬆️

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

Files with missing lines Coverage Δ
src/frontends/telegram/index.ts 72.45% <95.71%> (+2.21%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The telegram frontend's new `#handleProvider` and `#handleFork` handlers had
no tests, dropping patch coverage below the 80% gate. Extend the existing
telegram-flows harness (real JWT auth + stubbed bot + recording fake manager)
with `providerIds()` and a `session.fork` case, and cover every branch:

- /provider (no arg) lists backends with the first tagged default
- /provider <id> switches the attached session's backend
- /provider without an attachment prompts to /attach
- /fork branches same-backend and auto-attaches to the branch
- /fork <backend> continues on another backend in one step
- /fork without an attachment prompts to /attach

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@saucam saucam merged commit 518d417 into main Jul 10, 2026
4 checks passed
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