xonecas.io
60255
Zn

Zoea-Nova / commit 022b8ee

fix: remove hardcoded provider validation in configure mode

Use dynamic config.Providers lookup instead of hardcoded switch.
Now supports any provider defined in config.toml.

xonecas2026-02-07 022b8ee95fbc74e54139f5dfb9985830b8a1e402 parent 8b122ee

1 file changed

internal/tui/app.go+10−7
@@ -712,16 +712,19 @@ func (m Model) handleInputKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
712712 }
713713
714714 case InputModeConfigProvider:
715- switch value {
716- case "ollama", "opencode_zen":
717- m.pendingProvider = value
718- m.input.SetMode(InputModeConfigModel, m.input.TargetID())
719- return m, m.input.Focus()
720- default:
721- m.err = fmt.Errorf("unknown provider: %s", value)
715+ // Validate provider exists in config
716+ if _, ok := m.config.Providers[value]; !ok {
717+ var available []string
718+ for p := range m.config.Providers {
719+ available = append(available, p)
720+ }
721+ m.err = fmt.Errorf("provider '%s' not found. Available: %v", value, available)
722722 m.input.Reset()
723723 return m, nil
724724 }
725+ m.pendingProvider = value
726+ m.input.SetMode(InputModeConfigModel, m.input.TargetID())
727+ return m, m.input.Focus()
725728
726729 case InputModeConfigModel:
727730 m.err = m.commander.ConfigureMysis(m.input.TargetID(), m.pendingProvider, value)