feat: add TUI provider/model picker panel and session quick-switching
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 22/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- cli
Direzione di ricerca
Start in src/tui/panels.js and src/tui/skillsPanel.js to see how panels are registered and rendered, then src/tui/commandParser.js and src/session/stateManager.js for the command and state paths. Done would mean a provider picker panel and a /session <name> command, each with tests, but the issue asks for an OpenSpec proposal and maintainer approval before any code, and recommends splitting it first.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Add a provider/model picker panel to the TUI (arrow-select, matching the skills/memories/settings panel pattern) and a /session <name> quick-switch command that resumes a session in place.
Motivation
The current /provider set command is not discoverable — users must know the exact command syntax to switch providers/models. A picker panel listing providers/models with arrow-select would make this capability visible and consistent with the existing skills/memories/settings panels. Separately, switching sessions currently requires a panel round-trip; a /session <name> command or quick-switcher would resume a session in place, reducing friction.
Proposed Solution
- Provider/model picker panel — A picker panel listing providers/models with arrow-select, matching the skills/memories/settings panel pattern, more discoverable than
/provider set. - Session quick-switching — A
/session <name>command or quick-switcher that resumes a session in place, avoiding the panel round-trip.
Alternatives Considered
Unknown — user to confirm.
Dependencies
- None new — reuses the existing TUI panel infrastructure (skills/memories/settings panels) and the existing session/provider modules.
Testing Strategy
- Unit tests: Verify provider/model picker selection logic and the
/session <name>command parsing/resume behavior. - Integration test: Exercise the panel end-to-end (open, arrow-select, confirm) and the session quick-switch command.
- Edge cases: Empty provider/model list, invalid or nonexistent session name, session resume when no session is active.
Security Considerations
- Credential storage: No new credentials introduced — reuses existing provider/session config.
- Input validation: Validate session names and provider/model identifiers to prevent path traversal or injection.
- OWASP: Sanitize any user-supplied session/provider names before use in file paths or shell commands.
OpenSpec Note
This project uses OpenSpec for feature development. If this request is approved, I will:
- Run
/opsx:proposeto generate a full proposal with specs and tasks - Iterate on the design before any code is written
- Follow the task-driven implementation workflow
Additional Context
Split out from issue #1339.
Split Recommendation
This issue bundles multiple distinct capabilities. Consider splitting into separate issues:
- Provider/model picker panel — UI panel for selecting providers/models; a discoverability improvement over
/provider set. - Session quick-switching —
/session <name>command or quick-switcher; a session-resume behavior change.
MVP recommendation: Start with the provider/model picker panel as it has the least dependencies and highest immediate value.
Audit Findings (for Issue #1358)
- src/tui/panels.js — Defines the
PANELSenum andgetPanelOrder(). NoPROVIDERentry exists yet; addPROVIDER: "provider"and include it ingetPanelOrder()to enable tab navigation to the new picker panel. - src/tui/skillsPanel.js — Reference pattern for the picker panel: uses ink
SelectInputwith a customCyanIndicator/cyan item renderer,useInputfor Escape-to-return, anduseWindowSizeto bound the list. The provider/model picker should mirror this structure. - src/tui/settingsPanel.js — Reference for a custom selectable list that preserves selection across item rebuilds (
SettingsSelectList+clampOffset). Useful if the provider/model list is nested (provider → model) or rebuilt on selection. - src/tui/app.js:495-527 — Panel wiring. Add a
PANELS.PROVIDERbranch here to render the new picker panel, passingconfig(for providers) and anonSelectProvider/model callback. - src/provider/index.js — Exposes
getActiveProviderName(config),getActiveProviderConfig(config), andgetActiveModelName(config). These are the helpers to list the active provider/model and to drive the picker's current selection. - src/config/schemas/providers.js —
ProvidersSchemaisz.object({}).passthrough(); each provider config hasenabledandmodelfields. Iterateconfig.providersto enumerate providers and their configured models for the picker. - src/tui/commandParser.js:111-118 — Registers view-switching commands (
sessions,memories,skills,settings) returning{ action: "view", value }. Add a/session <name>command here (or extend thesessionshandler) to resume a session in place. - src/tui/sessionsPanel.js:143-165 — Existing resume logic:
loadSession(sessionsDir, 20, sessionId, cwd)thensessionState.createNewSession(sessionId),loadConversation(loaded.conversation),setSessionId(sessionId). Reuse this exact sequence for the/session <name>quick-switch. - src/session/loader.js —
loadSession(sessionsDir, windowSize, sessionId, cwd)loads a session by ID. The/session <name>command should call this with the user-supplied name. - src/session/stateManager.js —
SessionStateManagerexposescreateNewSession,loadConversation,setSessionId,setProvider,getProvider. These are the state transitions needed for both the picker (setProvider) and session quick-switch (resume). - src/tui/conversationArea.js:247 —
handleCommanddispatches parsed commands. Add handling for a/sessionaction (resume in place) and for the provider picker's selection callback here.
Fix Steps
- Add the provider panel type — In
src/tui/panels.js, addPROVIDER: "provider"toPANELSand append it togetPanelOrder(). - Create the picker panel — Add
src/tui/providerPanel.jsmodeled onskillsPanel.js: enumerateconfig.providers(fromsrc/config/schemas/providers.js) into items, render with inkSelectInput+ cyan indicator/item, and call anonSelectProvider/model callback on Enter. Escape returns to conversation. - Wire the panel — In
src/tui/app.js, add aPANELS.PROVIDERbranch that rendersProviderPanelwithconfigand anonSelecthandler that callssessionState.setProvider(...)and updates the model. - Add the
/session <name>command — Insrc/tui/commandParser.js, register asessioncommand that takes a name argument and returns{ action: "session", value: name }. - Handle the session action — In
src/tui/conversationArea.jshandleCommand, onresult.action === "session", callloadSession(sessionsDir, 20, name, cwd)and replay the resume sequence fromsessionsPanel.js(createNewSession→loadConversation→setSessionId). - Update command help — In
src/tui/commandHelp.js, add/session <name> - resume a session in placeand a/providerpanel entry to the Command group. - Verify — Run
npm run test,npm run lint, andnpm run coverageto confirm no regressions.
- Lingua principale
- JavaScript
- Stelle
- 2
- Fork
- 0
- Merge medio
- 1h 6m
- PR unite (30g)
- 234
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di avoidwork/madz
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
avoidwork/madz#1355 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di avoidwork/madz
Issue simili
-
Awaiting Maintainer Approval Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
processing/p5.js-web-editor#4364 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
woocommerce/woocommerce-google-analytics-integration#699 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 74/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
JsCommunity/app-conf#22 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno