feat: add TUI provider/model picker panel and session quick-switching
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- cli
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 3
- Forks
- 0
- Merge medio
- 1 h 27 min
- PR fusionados (30 d)
- 235
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de avoidwork/madz
-
approved feature
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
feat: add browser automation toolPosiblemente ocupada @avoidwork la tomó hoy. Abiertoapproved feature in progress
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de avoidwork/madz
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
vercel-labs/agent-skills#348 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
NanmiCoder/dsh-agent-teams#289 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
c1overzz/dsh-bili-scroll#124 ·
Los mantenedores suelen responder en 1 día