Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat: add TUI provider/model picker panel and session quick-switching

Aperta
#1,358 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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

feature

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:

  1. Run /opsx:propose to generate a full proposal with specs and tasks
  2. Iterate on the design before any code is written
  3. 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 PANELS enum and getPanelOrder(). No PROVIDER entry exists yet; add PROVIDER: "provider" and include it in getPanelOrder() to enable tab navigation to the new picker panel.
  • src/tui/skillsPanel.js — Reference pattern for the picker panel: uses ink SelectInput with a custom CyanIndicator/cyan item renderer, useInput for Escape-to-return, and useWindowSize to 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.PROVIDER branch here to render the new picker panel, passing config (for providers) and an onSelectProvider/model callback.
  • src/provider/index.js — Exposes getActiveProviderName(config), getActiveProviderConfig(config), and getActiveModelName(config). These are the helpers to list the active provider/model and to drive the picker's current selection.
  • src/config/schemas/providers.js — ProvidersSchema is z.object({}).passthrough(); each provider config has enabled and model fields. Iterate config.providers to 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 the sessions handler) to resume a session in place.
  • src/tui/sessionsPanel.js:143-165 — Existing resume logic: loadSession(sessionsDir, 20, sessionId, cwd) then sessionState.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 — SessionStateManager exposes createNewSession, 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 — handleCommand dispatches parsed commands. Add handling for a /session action (resume in place) and for the provider picker's selection callback here.

Fix Steps

  1. Add the provider panel type — In src/tui/panels.js, add PROVIDER: "provider" to PANELS and append it to getPanelOrder().
  2. Create the picker panel — Add src/tui/providerPanel.js modeled on skillsPanel.js: enumerate config.providers (from src/config/schemas/providers.js) into items, render with ink SelectInput + cyan indicator/item, and call an onSelectProvider/model callback on Enter. Escape returns to conversation.
  3. Wire the panel — In src/tui/app.js, add a PANELS.PROVIDER branch that renders ProviderPanel with config and an onSelect handler that calls sessionState.setProvider(...) and updates the model.
  4. Add the /session <name> command — In src/tui/commandParser.js, register a session command that takes a name argument and returns { action: "session", value: name }.
  5. Handle the session action — In src/tui/conversationArea.js handleCommand, on result.action === "session", call loadSession(sessionsDir, 20, name, cwd) and replay the resume sequence from sessionsPanel.js (createNewSession → loadConversation → setSessionId).
  6. Update command help — In src/tui/commandHelp.js, add /session <name> - resume a session in place and a /provider panel entry to the Command group.
  7. Verify — Run npm run test, npm run lint, and npm run coverage to confirm no regressions.
Lingua principale
JavaScript
Stelle
2
Fork
0
Merge medio
1h 6m
PR unite (30g)
234

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di avoidwork/madz

Tutte le issue di avoidwork/madz

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.