Skip to content

feat(chat-ui): backend picker in the chat composer (RFC Phase 2) - #27002

Closed
muhmuhkuh wants to merge 7 commits into
kirodotdev:mainfrom
muhmuhkuh:feat/chat-backend-composer-picker
Closed

muhmuhkuh wants to merge 7 commits into
kirodotdev:mainfrom
muhmuhkuh:feat/chat-backend-composer-picker

Conversation

@muhmuhkuh

Copy link
Copy Markdown

What this adds

Phase 2 of docs/request-for-change/rfc-chat-backend-selection.md (RFC merged in #19438): the visible per-chat backend picker in the chat composer.

Stacked on #19599 (Phase 1, switch_slot_backend + slot persistence). Merge this only after #19599 lands — until then the diff against main includes the base PR's commits; afterwards it shrinks to just the two commits below.

Changes (2 commits on top of #19599's head)

  • feat(chat-ui): backend picker in the chat composer (RFC Phase 2)
    • New owner-only route POST /api/chat/slots/{slot}/backend (chat_api/slot_backend.py) delegating to switch_slot_backend — the same verb the session-control MCP tool runs. Owner-only because a pick sends the chat's transcript to another provider.
    • Composer UI: a backend chip (server icon) in the context shelf next to the model chip, dropdown lists GET /api/acp-backends rows plus the gateway default. Applies from the next turn; chip stays enabled while a response runs, like the model chip.
    • slotSwitch.ts helper + wiring in ChatPage/ComposerDockView/sessionPicks; i18n keys in all locales.
  • fix(dashboard): ship the picked backend on every slot row
    • 3-line fix in slot_projection.py: serialize_slot now includes backend, so the WS rebroadcast no longer resets the chip to the gateway default after each pick.

Verification

  • tsc -p tsconfig.app.json clean on the branch.
  • pytest test/test_chat_slot_backend.py: 12 passed (the 69 errors are the pre-existing Windows conftest failure kiro_crew.sandbox has no attribute '_mount_source_candidate_roots', present on unmodified main too).
  • Manually verified on a local gateway: pick applies from the next turn, chip shows the picked backend across rebroadcasts, unknown/uninstalled backend refused up front.

No backend-selection semantics are changed here; precedence rules from the #19599 review (spawn_run > chat pick > member pin > member route > default) are untouched.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 1, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch 3 times, most recently from 4f1d41d to c0168cc Compare November 3, 2026 09:17
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 3, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from c0168cc to f922456 Compare November 3, 2026 12:07
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 3, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from f922456 to abab2a9 Compare November 4, 2026 12:22
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 4, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from abab2a9 to 5a02f07 Compare November 4, 2026 16:10
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 4, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from 57b533e to fda67da Compare November 4, 2026 16:16
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 4, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from fda67da to 632c7cc Compare November 4, 2026 20:12
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 4, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from 632c7cc to 30be1d7 Compare November 5, 2026 00:13
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 5, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from 30be1d7 to f0221dd Compare November 5, 2026 04:06
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 5, 2026
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from f0221dd to 685afd7 Compare November 5, 2026 08:06
A dashboard chat can carry an optional backend pick, set through the session_set_backend MCP tool (POST /api/session-control/set-backend). The pick is validated by the resolver spawn_run(backend=...) uses, persisted on the slot, and passed to session allocation as backend_override; a change ends the current session so the next turn starts on the new backend. An unpicked chat allocates exactly as before. Implements docs/request-for-change/rfc-chat-backend-selection.md Phase 1.
muhmuhkuh and others added 6 commits November 5, 2026 13:08
Adds POST /api/chat/slots/{slot}/backend (owner-only) delegating to
switch_slot_backend, and a backend chip + dropdown in the composer next to
the model chip, listing GET /api/acp-backends rows plus the gateway default.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
The composer's backend chip reads slot.backend, but serialize_slot's row
did not include it, so the WS rebroadcast reset the chip to the gateway
default after each pick.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@muhmuhkuh
muhmuhkuh force-pushed the feat/chat-backend-composer-picker branch from 685afd7 to aaffab3 Compare November 5, 2026 12:11
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 5, 2026
@muhmuhkuh muhmuhkuh closed this Nov 11, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 11, 2026
@muhmuhkuh
muhmuhkuh deleted the feat/chat-backend-composer-picker branch November 11, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants