xonecas.io
60255
Zn

Zoea-Nova / commit 6b990f8

refactor: improve provider configuration and credential management

- Remove unused default_model field from SwarmConfig
- Add api_key_name field to ProviderConfig for explicit credential mapping
- Remove generic ollama and opencode_zen provider entries
- Set default_provider to ollama-qwen
- Update initProviders to use api_key_name for credential lookup
- Remove hardcoded opencode_zen fallback in favor of explicit mapping
- Fix hardcoded provider log strings to use actual provider name
- Update all tests to use ollama-qwen instead of ollama
- Update golden files for TUI tests
- Simplify env override logic (remove provider-specific overrides)
- Add gpt-5-nano endpoint workaround (use /chat/completions)
- Document OpenCode Zen endpoint issue in KNOWN_ISSUES.md
- Add TODO item for intelligent endpoint selection refactor

Benefits:
- Explicit credential mapping prevents confusion
- Multiple providers can share same API key
- Cleaner configuration with named providers
- Better logging with actual provider names
- Backward compatible (api_key_name optional)

xonecas2026-02-08 6b990f8d9ee8326cb5c3e791f6d83ff4101986bf parent ce9014f

126 files changed

This diff is too big to show in full. The first 1000 lines are below, and every file is listed with its counts.

cmd/zoea/main.go+5−4
@@ -241,11 +241,12 @@ func initProviders(cfg *config.Config, creds *config.Credentials) *provider.Regi
241241 registry.RegisterFactory(name, factory)
242242 } else if strings.Contains(provCfg.Endpoint, "opencode.ai") {
243243 // OpenCode-based provider
244- // Try provider-specific key first, fallback to default "opencode_zen"
245- apiKey := creds.GetAPIKey(name)
246- if apiKey == "" {
247- apiKey = creds.GetAPIKey("opencode_zen")
244+ // Use explicit api_key_name if provided, otherwise use provider config name
245+ keyName := provCfg.APIKeyName
246+ if keyName == "" {
247+ keyName = name
248248 }
249+ apiKey := creds.GetAPIKey(keyName)
249250 if apiKey != "" {
250251 factory := provider.NewOpenCodeFactory(name, provCfg.Endpoint, apiKey, provCfg.RateLimit, provCfg.RateBurst)
251252 registry.RegisterFactory(name, factory)
config.toml+3−16
@@ -1,16 +1,8 @@
11 [swarm]
22 max_myses = 16
3-default_provider = "opencode_zen"
4-default_model = "gpt-5-nano"
3+default_provider = "ollama-qwen"
54
65 # Ollama providers (local)
7-[providers.ollama]
8-endpoint = "http://localhost:11434"
9-model = "qwen3:8b"
10-temperature = 0.7
11-rate_limit = 2.0
12-rate_burst = 3
13-
146 [providers.ollama-qwen]
157 endpoint = "http://localhost:11434"
168 model = "qwen3:8b"
@@ -33,16 +25,10 @@ rate_limit = 2.0
3325 rate_burst = 3
3426
3527 # OpenCode Zen providers (cloud)
36-[providers.opencode_zen]
37-endpoint = "https://opencode.ai/zen/v1"
38-model = "gpt-5-nano"
39-temperature = 0.7
40-rate_limit = 1.0
41-rate_burst = 2
42-
4328 [providers.zen-nano]
4429 endpoint = "https://opencode.ai/zen/v1"
4530 model = "gpt-5-nano"
31+api_key_name = "opencode_zen"
4632 temperature = 0.7
4733 rate_limit = 1.0
4834 rate_burst = 2
@@ -50,6 +36,7 @@ rate_burst = 2
5036 [providers.zen-pickle]
5137 endpoint = "https://opencode.ai/zen/v1"
5238 model = "big-pickle"
39+api_key_name = "opencode_zen"
5340 temperature = 0.7
5441 rate_limit = 1.0
5542 rate_burst = 2
documentation/current/KNOWN_ISSUES.md+9−0
@@ -36,6 +36,15 @@ Active todo list of known issues, bugs, and planned improvements for Zoea Nova.
3636
3737 ### Provider Reliability
3838
39+- [ ] **OpenCode Zen endpoint workaround for gpt-5-nano** - Using `/chat/completions` instead of documented `/responses` endpoint
40+ - **Issue:** Official docs specify `gpt-5-nano` uses `/v1/responses` endpoint, but this returns HTTP 500 errors
41+ - **Error:** `request failed after 3 retries: chat completion status 500` with server error mentioning `input_tokens` (Anthropic field)
42+ - **Root cause:** `/responses` endpoint appears to expect non-OpenAI request format; our code uses OpenAI SDK with Chat Completions format
43+ - **Workaround:** Hardcoded `gpt-5-nano` to use `/chat/completions` endpoint (works but contradicts official docs)
44+ - **Location:** `internal/provider/opencode.go` line 53
45+ - **Action needed:** Contact OpenCode support to clarify `/responses` endpoint format or confirm `/chat/completions` is acceptable
46+ - **Reference:** https://opencode.ai/docs/zen/#models
47+
3948 - [ ] **Investigate Ollama timeout errors** - Occasional "context deadline exceeded" errors when calling Ollama chat completions
4049 - **Error:** `Post "http://localhost:11434/v1/chat/completions": context deadline exceeded`
4150 - **Needs:** Root cause analysis (model size, request timeout configuration, rate limiting interaction)
documentation/current/TODO.md+17−0
@@ -13,6 +13,23 @@
1313
1414 ---
1515
16+Recommendations
17+
18+1. Fix rate limiter: Share rate.Limiter instances across provider entries with same endpoint/API key
19+2. Cargo management: Add logic to check cargo capacity before mining, trigger dock/sell when full
20+3. POI validation: Require get_poi before mine, use get_system for travel targets (stop hallucinating names)
21+4. Docking sequence: Ensure dock succeeds before calling station services (buy, sell, missions)
22+5. Increase iteration limit: From 10 to 15-20 to reduce turn overhead for complex tasks
23+6. Add jitter to login: Prevent simultaneous requests from multiple Myses hitting rate limits
24+ The system is stable and efficient, but the rate limiting bug and low mining success rate (4.3%) are the primary blockers to swarm effectiveness.
25+
26+7. Refactor OpenCode Zen provider factory: Make endpoint selection intelligent based on model type
27+ - Reference: https://opencode.ai/docs/zen/#models
28+ - Current: Hardcoded model→endpoint mapping in opencodeModelEndpoints map
29+ - Goal: Automatically route to correct endpoint (/chat/completions, /messages, /responses, /models/*) based on model prefix/type
30+ - Benefits: Support new models without code changes, align with official OpenCode Zen API structure
31+ - Note: /responses endpoint format is currently undocumented and incompatible with our OpenAI SDK usage
32+
1633 - network activity indicator revision
1734
1835 - remove zoea_list_mysis()
documentation/guides/OPENCODE_ZEN_MODELS.md+1−1
@@ -12,7 +12,7 @@ These models are free during their beta period:
1212 | Kimi K2.5 Free | `kimi-k2.5-free` | `/v1/chat/completions` | Yes |
1313 | MiniMax M2.1 Free | `minimax-m2.1-free` | `/v1/messages` | Yes |
1414 | Big Pickle | `big-pickle` | `/v1/chat/completions` | Yes |
15-| GPT 5 Nano | `gpt-5-nano` | `/v1/responses` | Yes |
15+| GPT 5 Nano | `gpt-5-nano` | `/v1/chat/completions` | Yes |
1616
1717 ## Configuration
1818
internal/config/config.go+1−68
@@ -23,13 +23,13 @@ type Config struct {
2323 type SwarmConfig struct {
2424 MaxMyses int `toml:"max_myses"`
2525 DefaultProvider string `toml:"default_provider"`
26- DefaultModel string `toml:"default_model"`
2726 }
2827
2928 // ProviderConfig holds LLM provider settings.
3029 type ProviderConfig struct {
3130 Endpoint string `toml:"endpoint"`
3231 Model string `toml:"model"`
32+ APIKeyName string `toml:"api_key_name"`
3333 Temperature float64 `toml:"temperature"`
3434 RateLimit float64 `toml:"rate_limit"`
3535 RateBurst int `toml:"rate_burst"`
@@ -134,14 +134,6 @@ func validateEndpoint(value string) error {
134134
135135 // applyEnvOverrides applies environment variable overrides to the configuration.
136136 func applyEnvOverrides(cfg *Config) {
137- updateProvider := func(name string, update func(ProviderConfig) ProviderConfig) {
138- providerCfg, ok := cfg.Providers[name]
139- if !ok {
140- return
141- }
142- cfg.Providers[name] = update(providerCfg)
143- }
144-
145137 applyInt := func(value string, set func(int)) {
146138 if value == "" {
147139 return
@@ -151,15 +143,6 @@ func applyEnvOverrides(cfg *Config) {
151143 }
152144 }
153145
154- applyFloat := func(value string, set func(float64)) {
155- if value == "" {
156- return
157- }
158- if f, err := strconv.ParseFloat(value, 64); err == nil {
159- set(f)
160- }
161- }
162-
163146 for _, setter := range []struct {
164147 env string
165148 apply func(string)
@@ -170,56 +153,6 @@ func applyEnvOverrides(cfg *Config) {
170153 cfg.MCP.Upstream = v
171154 }
172155 }},
173- {"ZOEA_OLLAMA_ENDPOINT", func(v string) {
174- if v != "" {
175- updateProvider("ollama", func(p ProviderConfig) ProviderConfig { p.Endpoint = v; return p })
176- }
177- }},
178- {"ZOEA_OLLAMA_MODEL", func(v string) {
179- if v != "" {
180- updateProvider("ollama", func(p ProviderConfig) ProviderConfig { p.Model = v; return p })
181- }
182- }},
183- {"ZOEA_OLLAMA_TEMPERATURE", func(v string) {
184- applyFloat(v, func(f float64) {
185- updateProvider("ollama", func(p ProviderConfig) ProviderConfig { p.Temperature = f; return p })
186- })
187- }},
188- {"ZOEA_OLLAMA_RATE_LIMIT", func(v string) {
189- applyFloat(v, func(f float64) {
190- updateProvider("ollama", func(p ProviderConfig) ProviderConfig { p.RateLimit = f; return p })
191- })
192- }},
193- {"ZOEA_OLLAMA_RATE_BURST", func(v string) {
194- applyInt(v, func(n int) {
195- updateProvider("ollama", func(p ProviderConfig) ProviderConfig { p.RateBurst = n; return p })
196- })
197- }},
198- {"ZOEA_OPENCODE_ENDPOINT", func(v string) {
199- if v != "" {
200- updateProvider("opencode_zen", func(p ProviderConfig) ProviderConfig { p.Endpoint = v; return p })
201- }
202- }},
203- {"ZOEA_OPENCODE_MODEL", func(v string) {
204- if v != "" {
205- updateProvider("opencode_zen", func(p ProviderConfig) ProviderConfig { p.Model = v; return p })
206- }
207- }},
208- {"ZOEA_OPENCODE_TEMPERATURE", func(v string) {
209- applyFloat(v, func(f float64) {
210- updateProvider("opencode_zen", func(p ProviderConfig) ProviderConfig { p.Temperature = f; return p })
211- })
212- }},
213- {"ZOEA_OPENCODE_RATE_LIMIT", func(v string) {
214- applyFloat(v, func(f float64) {
215- updateProvider("opencode_zen", func(p ProviderConfig) ProviderConfig { p.RateLimit = f; return p })
216- })
217- }},
218- {"ZOEA_OPENCODE_RATE_BURST", func(v string) {
219- applyInt(v, func(n int) {
220- updateProvider("opencode_zen", func(p ProviderConfig) ProviderConfig { p.RateBurst = n; return p })
221- })
222- }},
223156 } {
224157 setter.apply(os.Getenv(setter.env))
225158 }
internal/config/config_test.go+33−113
@@ -286,7 +286,7 @@ func TestLoadEnvOverridePrecedence(t *testing.T) {
286286 [swarm]
287287 max_myses = 16
288288
289-[providers.ollama]
289+[providers.ollama-qwen]
290290 endpoint = "http://file-endpoint"
291291 model = "file-model"
292292 temperature = 0.7
@@ -297,11 +297,9 @@ rate_burst = 3
297297 t.Fatalf("failed to write test config: %v", err)
298298 }
299299
300- os.Setenv("ZOEA_OLLAMA_MODEL", "env-model")
301- os.Setenv("ZOEA_OLLAMA_ENDPOINT", "http://env-endpoint")
300+ os.Setenv("ZOEA_MAX_MYSES", "32")
302301 defer func() {
303- os.Unsetenv("ZOEA_OLLAMA_MODEL")
304- os.Unsetenv("ZOEA_OLLAMA_ENDPOINT")
302+ os.Unsetenv("ZOEA_MAX_MYSES")
305303 }()
306304
307305 cfg, err := Load(configPath)
@@ -309,11 +307,12 @@ rate_burst = 3
309307 t.Fatalf("Load() error: %v", err)
310308 }
311309
312- if cfg.Providers["ollama"].Model != "env-model" {
313- t.Errorf("expected env model override, got %s", cfg.Providers["ollama"].Model)
310+ if cfg.Swarm.MaxMyses != 32 {
311+ t.Errorf("expected env max_myses override=32, got %d", cfg.Swarm.MaxMyses)
314312 }
315- if cfg.Providers["ollama"].Endpoint != "http://env-endpoint" {
316- t.Errorf("expected env endpoint override, got %s", cfg.Providers["ollama"].Endpoint)
313+ // Verify file values remain unchanged
314+ if cfg.Providers["ollama-qwen"].Model != "file-model" {
315+ t.Errorf("expected file model, got %s", cfg.Providers["ollama-qwen"].Model)
317316 }
318317 }
319318
@@ -325,9 +324,9 @@ func TestLoadIgnoresInvalidEnvOverrides(t *testing.T) {
325324 [swarm]
326325 max_myses = 16
327326
328-[providers.ollama]
327+[providers.ollama-qwen]
329328 endpoint = "http://localhost:11434"
330-model = "qwen3:4b"
329+model = "qwen3:8b"
331330 temperature = 0.7
332331 rate_limit = 2.0
333332 rate_burst = 3
@@ -337,14 +336,8 @@ rate_burst = 3
337336 }
338337
339338 os.Setenv("ZOEA_MAX_MYSES", "not-a-number")
340- os.Setenv("ZOEA_OLLAMA_TEMPERATURE", "bad")
341- os.Setenv("ZOEA_OLLAMA_RATE_LIMIT", "bad")
342- os.Setenv("ZOEA_OLLAMA_RATE_BURST", "bad")
343339 defer func() {
344340 os.Unsetenv("ZOEA_MAX_MYSES")
345- os.Unsetenv("ZOEA_OLLAMA_TEMPERATURE")
346- os.Unsetenv("ZOEA_OLLAMA_RATE_LIMIT")
347- os.Unsetenv("ZOEA_OLLAMA_RATE_BURST")
348341 }()
349342
350343 cfg, err := Load(configPath)
@@ -356,14 +349,8 @@ rate_burst = 3
356349 if cfg.Swarm.MaxMyses != 16 {
357350 t.Errorf("expected max_myses=16, got %d", cfg.Swarm.MaxMyses)
358351 }
359- if cfg.Providers["ollama"].Temperature != 0.7 {
360- t.Errorf("expected temperature=0.7, got %v", cfg.Providers["ollama"].Temperature)
361- }
362- if cfg.Providers["ollama"].RateLimit != 2.0 {
363- t.Errorf("expected rate_limit=2.0, got %v", cfg.Providers["ollama"].RateLimit)
364- }
365- if cfg.Providers["ollama"].RateBurst != 3 {
366- t.Errorf("expected rate_burst=3, got %d", cfg.Providers["ollama"].RateBurst)
352+ if cfg.Providers["ollama-qwen"].Temperature != 0.7 {
353+ t.Errorf("expected temperature=0.7, got %v", cfg.Providers["ollama-qwen"].Temperature)
367354 }
368355 }
369356
@@ -543,17 +530,16 @@ rate_burst = %d
543530 }
544531 }
545532
546-func TestLoadDefaultProviderModel(t *testing.T) {
533+func TestLoadDefaultProvider(t *testing.T) {
547534 tmpDir := t.TempDir()
548535 configPath := filepath.Join(tmpDir, "config.toml")
549536
550537 configContent := `
551538 [swarm]
552539 max_myses = 16
553-default_provider = "ollama"
554-default_model = "qwen3:8b"
540+default_provider = "ollama-qwen"
555541
556-[providers.ollama]
542+[providers.ollama-qwen]
557543 endpoint = "http://localhost:11434"
558544 model = "qwen3:8b"
559545 temperature = 0.7
@@ -569,12 +555,8 @@ rate_burst = 3
569555 t.Fatalf("Load failed: %v", err)
570556 }
571557
572- if cfg.Swarm.DefaultProvider != "ollama" {
573- t.Errorf("expected default_provider=ollama, got %s", cfg.Swarm.DefaultProvider)
574- }
575-
576- if cfg.Swarm.DefaultModel != "qwen3:8b" {
577- t.Errorf("expected default_model=qwen3:8b, got %s", cfg.Swarm.DefaultModel)
558+ if cfg.Swarm.DefaultProvider != "ollama-qwen" {
559+ t.Errorf("expected default_provider=ollama-qwen, got %s", cfg.Swarm.DefaultProvider)
578560 }
579561 }
580562
@@ -586,20 +568,13 @@ func TestLoadAllEnvOverrides(t *testing.T) {
586568 [swarm]
587569 max_myses = 16
588570
589-[providers.ollama]
571+[providers.ollama-qwen]
590572 endpoint = "http://localhost:11434"
591-model = "qwen3:4b"
573+model = "qwen3:8b"
592574 temperature = 0.7
593575 rate_limit = 2.0
594576 rate_burst = 3
595577
596-[providers.opencode_zen]
597-endpoint = "https://zen.example.com"
598-model = "gpt-5-nano"
599-temperature = 0.8
600-rate_limit = 3.0
601-rate_burst = 4
602-
603578 [mcp]
604579 upstream = "https://mcp.example.com"
605580 `
@@ -607,32 +582,12 @@ upstream = "https://mcp.example.com"
607582 t.Fatalf("failed to write test config: %v", err)
608583 }
609584
610- // Set all env vars
585+ // Set env vars
611586 os.Setenv("ZOEA_MAX_MYSES", "32")
612587 os.Setenv("ZOEA_MCP_ENDPOINT", "https://env-mcp.example.com")
613- os.Setenv("ZOEA_OLLAMA_ENDPOINT", "http://env-ollama:11434")
614- os.Setenv("ZOEA_OLLAMA_MODEL", "env-model")
615- os.Setenv("ZOEA_OLLAMA_TEMPERATURE", "0.5")
616- os.Setenv("ZOEA_OLLAMA_RATE_LIMIT", "5.0")
617- os.Setenv("ZOEA_OLLAMA_RATE_BURST", "10")
618- os.Setenv("ZOEA_OPENCODE_ENDPOINT", "https://env-zen.example.com")
619- os.Setenv("ZOEA_OPENCODE_MODEL", "env-zen-model")
620- os.Setenv("ZOEA_OPENCODE_TEMPERATURE", "0.6")
621- os.Setenv("ZOEA_OPENCODE_RATE_LIMIT", "6.0")
622- os.Setenv("ZOEA_OPENCODE_RATE_BURST", "12")
623588 defer func() {
624589 os.Unsetenv("ZOEA_MAX_MYSES")
625590 os.Unsetenv("ZOEA_MCP_ENDPOINT")
626- os.Unsetenv("ZOEA_OLLAMA_ENDPOINT")
627- os.Unsetenv("ZOEA_OLLAMA_MODEL")
628- os.Unsetenv("ZOEA_OLLAMA_TEMPERATURE")
629- os.Unsetenv("ZOEA_OLLAMA_RATE_LIMIT")
630- os.Unsetenv("ZOEA_OLLAMA_RATE_BURST")
631- os.Unsetenv("ZOEA_OPENCODE_ENDPOINT")
632- os.Unsetenv("ZOEA_OPENCODE_MODEL")
633- os.Unsetenv("ZOEA_OPENCODE_TEMPERATURE")
634- os.Unsetenv("ZOEA_OPENCODE_RATE_LIMIT")
635- os.Unsetenv("ZOEA_OPENCODE_RATE_BURST")
636591 }()
637592
638593 cfg, err := Load(configPath)
@@ -640,43 +595,13 @@ upstream = "https://mcp.example.com"
640595 t.Fatalf("Load() error: %v", err)
641596 }
642597
643- // Verify all overrides
598+ // Verify overrides
644599 if cfg.Swarm.MaxMyses != 32 {
645600 t.Errorf("expected max_myses=32, got %d", cfg.Swarm.MaxMyses)
646601 }
647602 if cfg.MCP.Upstream != "https://env-mcp.example.com" {
648603 t.Errorf("expected env mcp endpoint, got %s", cfg.MCP.Upstream)
649604 }
650- if cfg.Providers["ollama"].Endpoint != "http://env-ollama:11434" {
651- t.Errorf("expected env ollama endpoint, got %s", cfg.Providers["ollama"].Endpoint)
652- }
653- if cfg.Providers["ollama"].Model != "env-model" {
654- t.Errorf("expected env ollama model, got %s", cfg.Providers["ollama"].Model)
655- }
656- if cfg.Providers["ollama"].Temperature != 0.5 {
657- t.Errorf("expected env ollama temperature=0.5, got %v", cfg.Providers["ollama"].Temperature)
658- }
659- if cfg.Providers["ollama"].RateLimit != 5.0 {
660- t.Errorf("expected env ollama rate_limit=5.0, got %v", cfg.Providers["ollama"].RateLimit)
661- }
662- if cfg.Providers["ollama"].RateBurst != 10 {
663- t.Errorf("expected env ollama rate_burst=10, got %d", cfg.Providers["ollama"].RateBurst)
664- }
665- if cfg.Providers["opencode_zen"].Endpoint != "https://env-zen.example.com" {
666- t.Errorf("expected env zen endpoint, got %s", cfg.Providers["opencode_zen"].Endpoint)
667- }
668- if cfg.Providers["opencode_zen"].Model != "env-zen-model" {
669- t.Errorf("expected env zen model, got %s", cfg.Providers["opencode_zen"].Model)
670- }
671- if cfg.Providers["opencode_zen"].Temperature != 0.6 {
672- t.Errorf("expected env zen temperature=0.6, got %v", cfg.Providers["opencode_zen"].Temperature)
673- }
674- if cfg.Providers["opencode_zen"].RateLimit != 6.0 {
675- t.Errorf("expected env zen rate_limit=6.0, got %v", cfg.Providers["opencode_zen"].RateLimit)
676- }
677- if cfg.Providers["opencode_zen"].RateBurst != 12 {
678- t.Errorf("expected env zen rate_burst=12, got %d", cfg.Providers["opencode_zen"].RateBurst)
679- }
680605 }
681606
682607 func TestLoadPartialEnvOverrides(t *testing.T) {
@@ -687,9 +612,9 @@ func TestLoadPartialEnvOverrides(t *testing.T) {
687612 [swarm]
688613 max_myses = 16
689614
690-[providers.ollama]
615+[providers.ollama-qwen]
691616 endpoint = "http://localhost:11434"
692-model = "qwen3:4b"
617+model = "qwen3:8b"
693618 temperature = 0.7
694619 rate_limit = 2.0
695620 rate_burst = 3
@@ -698,12 +623,10 @@ rate_burst = 3
698623 t.Fatalf("failed to write test config: %v", err)
699624 }
700625
701- // Override only model and temperature
702- os.Setenv("ZOEA_OLLAMA_MODEL", "partial-model")
703- os.Setenv("ZOEA_OLLAMA_TEMPERATURE", "0.9")
626+ // Override only max_myses
627+ os.Setenv("ZOEA_MAX_MYSES", "8")
704628 defer func() {
705- os.Unsetenv("ZOEA_OLLAMA_MODEL")
706- os.Unsetenv("ZOEA_OLLAMA_TEMPERATURE")
629+ os.Unsetenv("ZOEA_MAX_MYSES")
707630 }()
708631
709632 cfg, err := Load(configPath)
@@ -711,19 +634,16 @@ rate_burst = 3
711634 t.Fatalf("Load() error: %v", err)
712635 }
713636
714- // Verify partial overrides
715- if cfg.Providers["ollama"].Model != "partial-model" {
716- t.Errorf("expected partial model override, got %s", cfg.Providers["ollama"].Model)
717- }
718- if cfg.Providers["ollama"].Temperature != 0.9 {
719- t.Errorf("expected partial temperature override=0.9, got %v", cfg.Providers["ollama"].Temperature)
637+ // Verify partial override
638+ if cfg.Swarm.MaxMyses != 8 {
639+ t.Errorf("expected max_myses override=8, got %d", cfg.Swarm.MaxMyses)
720640 }
721641 // Verify file values remain
722- if cfg.Providers["ollama"].Endpoint != "http://localhost:11434" {
723- t.Errorf("expected file endpoint, got %s", cfg.Providers["ollama"].Endpoint)
642+ if cfg.Providers["ollama-qwen"].Endpoint != "http://localhost:11434" {
643+ t.Errorf("expected file endpoint, got %s", cfg.Providers["ollama-qwen"].Endpoint)
724644 }
725- if cfg.Providers["ollama"].RateLimit != 2.0 {
726- t.Errorf("expected file rate_limit=2.0, got %v", cfg.Providers["ollama"].RateLimit)
645+ if cfg.Providers["ollama-qwen"].Model != "qwen3:8b" {
646+ t.Errorf("expected file model, got %s", cfg.Providers["ollama-qwen"].Model)
727647 }
728648 }
729649
internal/provider/opencode.go+13−13
@@ -51,7 +51,7 @@ var opencodeModelEndpoints = map[string]string{
5151 "gemini-3-pro": "/models/gemini-3-pro",
5252 "gemini-3-flash": "/models/gemini-3-flash",
5353 "glm-4.7-free": opencodeChatCompletionsEndpoint,
54- "gpt-5-nano": opencodeResponsesEndpoint,
54+ "gpt-5-nano": opencodeChatCompletionsEndpoint, // Using chat/completions despite docs saying /responses (500 errors)
5555 "kimi-k2.5-free": opencodeChatCompletionsEndpoint,
5656 "minimax-m2.1-free": opencodeMessagesEndpoint,
5757 "trinity-large-preview-free": opencodeChatCompletionsEndpoint,
@@ -124,7 +124,7 @@ func (p *OpenCodeProvider) ChatWithTools(ctx context.Context, messages []Message
124124
125125 if len(resp.Choices) == 0 {
126126 log.Error().
127- Str("provider", "opencode_zen").
127+ Str("provider", p.name).
128128 Msg("OpenCode returned empty choices array")
129129 return nil, errors.New("no response choices")
130130 }
@@ -136,7 +136,7 @@ func (p *OpenCodeProvider) ChatWithTools(ctx context.Context, messages []Message
136136 }
137137
138138 log.Debug().
139- Str("provider", "opencode_zen").
139+ Str("provider", p.name).
140140 Str("content", choice.Message.Content).
141141 Int("tool_call_count", len(choice.Message.ToolCalls)).
142142 Msg("OpenCode ChatWithTools result")
@@ -151,7 +151,7 @@ func (p *OpenCodeProvider) ChatWithTools(ctx context.Context, messages []Message
151151 Arguments: json.RawMessage(tc.Function.Arguments),
152152 }
153153 log.Debug().
154- Str("provider", "opencode_zen").
154+ Str("provider", p.name).
155155 Str("tool_call_id", tc.ID).
156156 Str("tool_name", tc.Function.Name).
157157 Str("arguments", tc.Function.Arguments).
@@ -186,7 +186,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
186186 if attempt > 0 {
187187 delay := opencodeRetryDelays[attempt-1]
188188 log.Warn().
189- Str("provider", "opencode_zen").
189+ Str("provider", p.name).
190190 Int("attempt", attempt).
191191 Dur("delay", delay).
192192 Msg("Retrying OpenCode request after transient error")
@@ -205,7 +205,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
205205 }
206206
207207 log.Debug().
208- Str("provider", "opencode_zen").
208+ Str("provider", p.name).
209209 Str("url", url).
210210 Str("model", req.Model).
211211 Bool("has_api_key", p.apiKey != "").
@@ -232,7 +232,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
232232 defer resp.Body.Close()
233233
234234 log.Debug().
235- Str("provider", "opencode_zen").
235+ Str("provider", p.name).
236236 Str("url", url).
237237 Int("status", resp.StatusCode).
238238 Int("attempt", attempt+1).
@@ -245,7 +245,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
245245 lastErr = fmt.Errorf("chat completion status %d: %s", resp.StatusCode, strings.TrimSpace(string(payload)))
246246
247247 log.Warn().
248- Str("provider", "opencode_zen").
248+ Str("provider", p.name).
249249 Int("status", resp.StatusCode).
250250 Int("attempt", attempt+1).
251251 Str("body", string(payload)).
@@ -259,7 +259,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
259259 if resp.StatusCode < 200 || resp.StatusCode >= 300 {
260260 payload, _ := io.ReadAll(resp.Body)
261261 log.Error().
262- Str("provider", "opencode_zen").
262+ Str("provider", p.name).
263263 Int("status", resp.StatusCode).
264264 Str("body", string(payload)).
265265 Msg("OpenCode non-2xx response")
@@ -270,7 +270,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
270270 bodyBytes, err := io.ReadAll(resp.Body)
271271 if err != nil {
272272 log.Error().
273- Str("provider", "opencode_zen").
273+ Str("provider", p.name).
274274 Err(err).
275275 Msg("OpenCode failed to read response body")
276276 return nil, fmt.Errorf("read response body: %w", err)
@@ -279,7 +279,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
279279 var decoded openaiChatResponse
280280 if err := json.Unmarshal(bodyBytes, &decoded); err != nil {
281281 log.Error().
282- Str("provider", "opencode_zen").
282+ Str("provider", p.name).
283283 Err(err).
284284 Str("body", string(bodyBytes)).
285285 Msg("OpenCode JSON decode failed")
@@ -287,7 +287,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
287287 }
288288
289289 log.Debug().
290- Str("provider", "opencode_zen").
290+ Str("provider", p.name).
291291 Int("choice_count", len(decoded.Choices)).
292292 Msg("OpenCode response decoded")
293293
@@ -296,7 +296,7 @@ func (p *OpenCodeProvider) createChatCompletion(ctx context.Context, req openai.
296296
297297 // All retries exhausted
298298 log.Error().
299- Str("provider", "opencode_zen").
299+ Str("provider", p.name).
300300 Int("max_retries", maxRetries).
301301 Err(lastErr).
302302 Msg("OpenCode request failed after all retries")
internal/provider/registry_bug_test.go+8−3
@@ -15,12 +15,12 @@ func TestZenNanoRegistration(t *testing.T) {
1515 Swarm: config.SwarmConfig{
1616 MaxMyses: 16,
1717 DefaultProvider: "zen-nano",
18- DefaultModel: "gpt-5-nano",
1918 },
2019 Providers: map[string]config.ProviderConfig{
2120 "zen-nano": {
2221 Endpoint: "https://opencode.ai/zen/v1",
2322 Model: "gpt-5-nano",
23+ APIKeyName: "opencode_zen",
2424 Temperature: 0.7,
2525 RateLimit: 1.0,
2626 RateBurst: 2,
@@ -40,11 +40,16 @@ func TestZenNanoRegistration(t *testing.T) {
4040 registry.RegisterFactory(name, factory)
4141 t.Logf("Registered Ollama provider: %s", name)
4242 } else if strings.Contains(provCfg.Endpoint, "opencode.ai") {
43- apiKey := creds.GetAPIKey("opencode_zen")
43+ // Use explicit api_key_name if provided, otherwise use provider config name
44+ keyName := provCfg.APIKeyName
45+ if keyName == "" {
46+ keyName = name
47+ }
48+ apiKey := creds.GetAPIKey(keyName)
4449 if apiKey != "" {
4550 factory := NewOpenCodeFactory(name, provCfg.Endpoint, apiKey, provCfg.RateLimit, provCfg.RateBurst)
4651 registry.RegisterFactory(name, factory)
47- t.Logf("Registered OpenCode provider: %s", name)
52+ t.Logf("Registered OpenCode provider: %s (using key: %s)", name, keyName)
4853 }
4954 }
5055 }
internal/tui/focus_header_test.go+1−1
@@ -43,7 +43,7 @@ func TestFocusViewHeaderPresence(t *testing.T) {
4343 ID: "test-id",
4444 Name: tt.mysisName,
4545 State: "running",
46- Provider: "ollama",
46+ Provider: "ollama-qwen",
4747 AccountUsername: "test_account",
4848 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
4949 }
internal/tui/focus_test.go+1−1
@@ -260,7 +260,7 @@ func TestRenderFocusViewWithScrollbar(t *testing.T) {
260260 ID: "test-id",
261261 Name: "test-mysis",
262262 State: "running",
263- Provider: "ollama",
263+ Provider: "ollama-qwen",
264264 }
265265
266266 width := 100
internal/tui/golden_edge_cases_test.go+14−14
@@ -191,7 +191,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
191191 ID: "empty-mysis",
192192 Name: "empty-test",
193193 State: "idle",
194- Provider: "ollama",
194+ Provider: "ollama-qwen",
195195 AccountUsername: "",
196196 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
197197 },
@@ -205,7 +205,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
205205 ID: "long-mysis",
206206 Name: "long-test",
207207 State: "running",
208- Provider: "ollama",
208+ Provider: "ollama-qwen",
209209 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
210210 },
211211 logs: []LogEntry{
@@ -225,7 +225,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
225225 ID: "reasoning-mysis",
226226 Name: "reasoning-test",
227227 State: "running",
228- Provider: "ollama",
228+ Provider: "ollama-qwen",
229229 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
230230 },
231231 logs: []LogEntry{
@@ -246,7 +246,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
246246 ID: "emoji-mysis",
247247 Name: "emoji-test",
248248 State: "running",
249- Provider: "ollama",
249+ Provider: "ollama-qwen",
250250 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
251251 },
252252 logs: []LogEntry{
@@ -272,7 +272,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
272272 ID: "cjk-mysis",
273273 Name: "cjk-test",
274274 State: "running",
275- Provider: "ollama",
275+ Provider: "ollama-qwen",
276276 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
277277 },
278278 logs: []LogEntry{
@@ -298,7 +298,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
298298 ID: "json-mysis",
299299 Name: "json-test",
300300 State: "running",
301- Provider: "ollama",
301+ Provider: "ollama-qwen",
302302 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
303303 },
304304 logs: []LogEntry{
@@ -318,7 +318,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
318318 ID: "many-logs-mysis",
319319 Name: "many-logs-test",
320320 State: "running",
321- Provider: "ollama",
321+ Provider: "ollama-qwen",
322322 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
323323 },
324324 logs: generateManyLogs(100),
@@ -331,7 +331,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
331331 ID: "narrow-focus-mysis",
332332 Name: "narrow-focus",
333333 State: "running",
334- Provider: "ollama",
334+ Provider: "ollama-qwen",
335335 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
336336 },
337337 logs: []LogEntry{
@@ -351,7 +351,7 @@ func TestFocusViewEdgeCases(t *testing.T) {
351351 ID: "roles-mysis",
352352 Name: "roles-test",
353353 State: "running",
354- Provider: "ollama",
354+ Provider: "ollama-qwen",
355355 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
356356 },
357357 logs: []LogEntry{
@@ -518,10 +518,10 @@ func generateMyses(count int, state string) []MysisInfo {
518518
519519 func generateMixedStates() []MysisInfo {
520520 return []MysisInfo{
521- {ID: "mysis-1", Name: "alpha", State: "running", Provider: "ollama", AccountUsername: "crab_1", LastMessage: "Running", LastMessageAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC), CreatedAt: time.Date(2026, 1, 15, 9, 0, 0, 0, time.UTC)},
522- {ID: "mysis-2", Name: "beta", State: "idle", Provider: "ollama", AccountUsername: "crab_2", LastMessage: "", CreatedAt: time.Date(2026, 1, 15, 9, 0, 0, 0, time.UTC)},
521+ {ID: "mysis-1", Name: "alpha", State: "running", Provider: "ollama-qwen", AccountUsername: "crab_1", LastMessage: "Running", LastMessageAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC), CreatedAt: time.Date(2026, 1, 15, 9, 0, 0, 0, time.UTC)},
522+ {ID: "mysis-2", Name: "beta", State: "idle", Provider: "ollama-qwen", AccountUsername: "crab_2", LastMessage: "", CreatedAt: time.Date(2026, 1, 15, 9, 0, 0, 0, time.UTC)},
523523 {ID: "mysis-3", Name: "gamma", State: "stopped", Provider: "opencode_zen", AccountUsername: "crab_3", LastMessage: "", CreatedAt: time.Date(2026, 1, 15, 9, 0, 0, 0, time.UTC)},
524- {ID: "mysis-4", Name: "delta", State: "errored", Provider: "ollama", AccountUsername: "crab_4", LastError: "Network error", CreatedAt: time.Date(2026, 1, 15, 9, 0, 0, 0, time.UTC)},
524+ {ID: "mysis-4", Name: "delta", State: "errored", Provider: "ollama-qwen", AccountUsername: "crab_4", LastError: "Network error", CreatedAt: time.Date(2026, 1, 15, 9, 0, 0, 0, time.UTC)},
525525 {ID: "mysis-5", Name: "epsilon", State: "running", Provider: "opencode_zen", AccountUsername: "", LastMessage: "No account", LastMessageAt: time.Date(2026, 1, 15, 10, 5, 0, 0, time.UTC), CreatedAt: time.Date(2026, 1, 15, 9, 0, 0, 0, time.UTC)},
526526 }
527527 }
@@ -590,7 +590,7 @@ func generateCJKMyses() []MysisInfo {
590590 ID: "mysis-1",
591591 Name: "探索者",
592592 State: "running",
593- Provider: "ollama",
593+ Provider: "ollama-qwen",
594594 AccountUsername: "crab_explorer",
595595 LastMessage: "探索中",
596596 LastMessageAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
@@ -664,7 +664,7 @@ func generateName(i int) string {
664664
665665 func getProvider(i int) string {
666666 if i%2 == 0 {
667- return "ollama"
667+ return "ollama-qwen"
668668 }
669669 return "opencode_zen"
670670 }
internal/tui/golden_test.go+13−13
@@ -40,7 +40,7 @@ func TestDashboard(t *testing.T) {
4040 ID: "mysis-1",
4141 Name: "alpha",
4242 State: "running",
43- Provider: "ollama",
43+ Provider: "ollama-qwen",
4444 AccountUsername: "crab_warrior",
4545 LastMessage: "Mining asteroid belt",
4646 LastMessageAt: time.Date(2026, 1, 15, 10, 45, 0, 0, time.UTC),
@@ -73,7 +73,7 @@ func TestDashboard(t *testing.T) {
7373 ID: "mysis-3",
7474 Name: "gamma",
7575 State: "idle",
76- Provider: "ollama",
76+ Provider: "ollama-qwen",
7777 AccountUsername: "crab_cartographer",
7878 LastMessage: "Standing by",
7979 LastMessageAt: time.Date(2026, 1, 15, 12, 0, 0, 0, time.UTC),
@@ -95,7 +95,7 @@ func TestDashboard(t *testing.T) {
9595 ID: "mysis-4",
9696 Name: "delta",
9797 State: "running",
98- Provider: "ollama",
98+ Provider: "ollama-qwen",
9999 AccountUsername: "crab_runner",
100100 LastMessage: "Processing",
101101 LastMessageAt: time.Date(2026, 1, 15, 12, 5, 0, 0, time.UTC),
@@ -115,7 +115,7 @@ func TestDashboard(t *testing.T) {
115115 ID: "mysis-5",
116116 Name: "epsilon",
117117 State: "idle",
118- Provider: "ollama",
118+ Provider: "ollama-qwen",
119119 AccountUsername: "crab_navigator",
120120 LastMessage: "Holding position",
121121 LastMessageAt: time.Date(2026, 1, 15, 12, 10, 0, 0, time.UTC),
@@ -183,7 +183,7 @@ func TestFocusView(t *testing.T) {
183183 ID: "test-mysis",
184184 Name: "alpha",
185185 State: "running",
186- Provider: "ollama",
186+ Provider: "ollama-qwen",
187187 AccountUsername: "crab_explorer",
188188 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
189189 },
@@ -223,7 +223,7 @@ func TestFocusView(t *testing.T) {
223223 ID: "test-mysis",
224224 Name: "beta",
225225 State: "running",
226- Provider: "ollama",
226+ Provider: "ollama-qwen",
227227 CreatedAt: time.Date(2026, 1, 15, 9, 30, 0, 0, time.UTC),
228228 },
229229 logs: func() []LogEntry {
@@ -413,7 +413,7 @@ func TestFocusViewWithViewport(t *testing.T) {
413413 ID: "test-id",
414414 Name: "test-mysis",
415415 State: "running",
416- Provider: "ollama",
416+ Provider: "ollama-qwen",
417417 AccountUsername: "crab_pilot",
418418 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
419419 },
@@ -439,7 +439,7 @@ func TestFocusViewWithViewport(t *testing.T) {
439439 ID: "test-id",
440440 Name: "test-mysis",
441441 State: "running",
442- Provider: "ollama",
442+ Provider: "ollama-qwen",
443443 AccountUsername: "crab_pilot",
444444 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
445445 },
@@ -604,7 +604,7 @@ func TestMysisLine(t *testing.T) {
604604 ID: "abc123",
605605 Name: "test-mysis",
606606 State: "running",
607- Provider: "ollama",
607+ Provider: "ollama-qwen",
608608 AccountUsername: "crab_miner",
609609 LastMessage: "Mining asteroid",
610610 LastMessageAt: time.Date(2026, 1, 15, 10, 5, 0, 0, time.UTC),
@@ -618,7 +618,7 @@ func TestMysisLine(t *testing.T) {
618618 ID: "abc123",
619619 Name: "test-mysis",
620620 State: "idle",
621- Provider: "ollama",
621+ Provider: "ollama-qwen",
622622 AccountUsername: "",
623623 LastMessage: "",
624624 CreatedAt: time.Date(2026, 1, 15, 10, 0, 0, 0, time.UTC),
@@ -631,7 +631,7 @@ func TestMysisLine(t *testing.T) {
631631 ID: "abc123",
632632 Name: "mysis-with-a-very-long-name",
633633 State: "running",
634- Provider: "ollama",
634+ Provider: "ollama-qwen",
635635 AccountUsername: "crab_miner",
636636 LastMessage: "Holding",
637637 LastMessageAt: time.Date(2026, 1, 15, 10, 10, 0, 0, time.UTC),
@@ -645,7 +645,7 @@ func TestMysisLine(t *testing.T) {
645645 ID: "abc123",
646646 Name: "test-mysis",
647647 State: "errored",
648- Provider: "ollama",
648+ Provider: "ollama-qwen",
649649 AccountUsername: "crab_miner",
650650 LastMessage: "",
651651 LastError: "connection lost",
@@ -659,7 +659,7 @@ func TestMysisLine(t *testing.T) {
659659 ID: "abc123",
660660 Name: "test-mysis",
661661 State: "running",
662- Provider: "ollama",
662+ Provider: "ollama-qwen",
663663 AccountUsername: "crab_miner",
664664 LastMessage: "Processing",
665665 LastMessageAt: time.Date(2026, 1, 15, 10, 15, 0, 0, time.UTC),
internal/tui/input.go+1−1
@@ -64,7 +64,7 @@ func (m *InputModel) SetMode(mode InputMode, targetID string) {
6464 m.textInput.Placeholder = "Enter mysis name..."
6565 m.textInput.Prompt = inputPromptStyle.Render("⬡") + " "
6666 case InputModeConfigProvider:
67- m.textInput.Placeholder = "Enter provider (ollama/opencode_zen)..."
67+ m.textInput.Placeholder = "Enter provider (ollama-qwen/zen-nano/zen-pickle)..."
6868 m.textInput.Prompt = inputPromptStyle.Render("⚙") + " "
6969 case InputModeConfigModel:
7070 m.textInput.Placeholder = "Enter model name..."
internal/tui/input_reset_test.go+12−13
@@ -19,7 +19,7 @@ func TestInputReset_DirectMessage(t *testing.T) {
1919 defer cleanup()
2020
2121 // Create a mysis to message
22- mysis, _ := m.commander.CreateMysis("test-mysis", "ollama")
22+ mysis, _ := m.commander.CreateMysis("test-mysis", "ollama-qwen")
2323 m.commander.StartMysis(mysis.ID())
2424 m.refreshMysisList()
2525 m.selectedIdx = 0
@@ -96,7 +96,7 @@ func TestInputReset_DirectMessage(t *testing.T) {
9696 defer cleanup()
9797
9898 // Create a mysis to message
99- mysis, _ := m.commander.CreateMysis("test-mysis", "ollama")
99+ mysis, _ := m.commander.CreateMysis("test-mysis", "ollama-qwen")
100100 m.commander.StartMysis(mysis.ID())
101101 m.refreshMysisList()
102102 m.selectedIdx = 0
@@ -144,8 +144,8 @@ func TestInputReset_Broadcast(t *testing.T) {
144144 defer cleanup()
145145
146146 // Create myses to broadcast to
147- m.commander.CreateMysis("mysis-1", "ollama")
148- m.commander.CreateMysis("mysis-2", "ollama")
147+ m.commander.CreateMysis("mysis-1", "ollama-qwen")
148+ m.commander.CreateMysis("mysis-2", "ollama-qwen")
149149 m.refreshMysisList()
150150
151151 // Press 'b' to open broadcast input
@@ -232,7 +232,7 @@ func TestInputReset_Integration(t *testing.T) {
232232 defer cleanup()
233233
234234 // Create a mysis
235- mysis, _ := m.commander.CreateMysis("test-mysis", "ollama")
235+ mysis, _ := m.commander.CreateMysis("test-mysis", "ollama-qwen")
236236 m.commander.StartMysis(mysis.ID())
237237 m.refreshMysisList()
238238 m.selectedIdx = 0
@@ -318,23 +318,22 @@ func setupTestModelWithSlowProvider(t *testing.T) (Model, func()) {
318318
319319 // Create a mock factory that returns a provider with a 5-second delay
320320 slowFactory := &slowMockFactory{
321- name: "ollama",
321+ name: "ollama-qwen",
322322 response: "mock response",
323323 limiter: limiter,
324324 delay: 5 * time.Second,
325325 }
326- reg.RegisterFactory("ollama", slowFactory)
327- reg.RegisterFactory("opencode_zen", provider.NewMockFactoryWithLimiter("opencode_zen", "mock response", limiter))
326+ reg.RegisterFactory("ollama-qwen", slowFactory)
327+ reg.RegisterFactory("zen-nano", provider.NewMockFactoryWithLimiter("zen-nano", "mock response", limiter))
328328
329329 cfg := &config.Config{
330330 Swarm: config.SwarmConfig{
331331 MaxMyses: 16,
332- DefaultProvider: "opencode_zen",
333- DefaultModel: "gpt-5-nano",
332+ DefaultProvider: "ollama-qwen",
334333 },
335334 Providers: map[string]config.ProviderConfig{
336- "ollama": {Endpoint: "http://mock", Model: "mock-model", Temperature: 0.7, RateLimit: 1000, RateBurst: 1000},
337- "opencode_zen": {Endpoint: "http://mock", Model: "gpt-5-nano", Temperature: 0.7, RateLimit: 1000, RateBurst: 1000},
335+ "ollama-qwen": {Endpoint: "http://mock", Model: "qwen3:8b", Temperature: 0.7, RateLimit: 1000, RateBurst: 1000},
336+ "zen-nano": {Endpoint: "http://mock", Model: "gpt-5-nano", Temperature: 0.7, RateLimit: 1000, RateBurst: 1000},
338337 },
339338 }
340339
@@ -383,7 +382,7 @@ func TestInputReset_SendingClearsImmediately(t *testing.T) {
383382 defer cleanup()
384383
385384 // Create a mysis with the slow mock provider (5 second delay)
386- mysis, _ := m.commander.CreateMysis("slow-mysis", "ollama")
385+ mysis, _ := m.commander.CreateMysis("slow-mysis", "ollama-qwen")
387386 m.commander.StartMysis(mysis.ID())
388387 m.refreshMysisList()
389388 m.selectedIdx = 0
internal/tui/integration_test.go+34−34
@@ -49,8 +49,8 @@ func TestIntegration_DashboardNavigation(t *testing.T) {
4949 defer cleanup()
5050
5151 // Create two myses for navigation
52- m.commander.CreateMysis("mysis-1", "ollama")
53- m.commander.CreateMysis("mysis-2", "ollama")
52+ m.commander.CreateMysis("mysis-1", "ollama-qwen")
53+ m.commander.CreateMysis("mysis-2", "ollama-qwen")
5454 m.refreshMysisList()
5555
5656 // Initial state: selectedIdx should be 0
@@ -95,8 +95,8 @@ func TestIntegration_DashboardNavigationUp(t *testing.T) {
9595 defer cleanup()
9696
9797 // Create two myses
98- m.commander.CreateMysis("mysis-1", "ollama")
99- m.commander.CreateMysis("mysis-2", "ollama")
98+ m.commander.CreateMysis("mysis-1", "ollama-qwen")
99+ m.commander.CreateMysis("mysis-2", "ollama-qwen")
100100 m.refreshMysisList()
101101 m.selectedIdx = 1 // Start at second mysis
102102
@@ -126,7 +126,7 @@ func TestIntegration_FocusViewTransition(t *testing.T) {
126126 defer cleanup()
127127
128128 // Create a mysis
Cut short: this commit's diff is over 1000 lines.
internal/tui/layout_test.go+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/spinner_test.go+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboard/narrow_terminal/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboard/narrow_terminal/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboard/with_loading_mysis/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboard/with_loading_mysis/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboard/with_multiline_broadcast/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboard/with_multiline_broadcast/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboard/with_swarm_messages/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboard/with_swarm_messages/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/all_loading/ANSI.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/all_loading/Stripped.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/all_myses_errored/ANSI.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/all_myses_errored/Stripped.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/all_myses_idle/ANSI.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/all_myses_idle/Stripped.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/all_myses_stopped/ANSI.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/all_myses_stopped/Stripped.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/cjk_content/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/cjk_content/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/extremely_narrow_terminal/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/extremely_narrow_terminal/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/extremely_tall_terminal/ANSI.golden+5−5
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/extremely_tall_terminal/Stripped.golden+5−5
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/extremely_wide_terminal/ANSI.golden+2−2
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/extremely_wide_terminal/Stripped.golden+2−2
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/full_swarm_16_myses/ANSI.golden+8−8
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/full_swarm_16_myses/Stripped.golden+8−8
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/full_swarm_with_10_broadcasts/ANSI.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/full_swarm_with_10_broadcasts/Stripped.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/mixed_states/ANSI.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/mixed_states/Stripped.golden+3−3
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/selection_at_bottom/ANSI.golden+5−5
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/selection_at_bottom/Stripped.golden+5−5
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/selection_middle/ANSI.golden+5−5
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/selection_middle/Stripped.golden+5−5
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/unicode_emoji_in_messages/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/unicode_emoji_in_messages/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/very_long_broadcast/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestDashboardEdgeCases/very_long_broadcast/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusView/with_all_roles/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusView/with_all_roles/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusView/with_scrollbar/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusView/with_scrollbar/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/all_role_types/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/all_role_types/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/cjk_logs/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/cjk_logs/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/huge_json_tool_result/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/huge_json_tool_result/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/many_logs_100_entries/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/many_logs_100_entries/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/narrow_focus_view/ANSI.golden+2−2
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/narrow_focus_view/Stripped.golden+2−2
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/no_logs_empty_state/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/no_logs_empty_state/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/unicode_emoji_logs/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/unicode_emoji_logs/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/very_long_log_entry/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/very_long_log_entry/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/very_long_reasoning/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewEdgeCases/very_long_reasoning/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewWithViewport/with_scroll_indicator/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewWithViewport/with_scroll_indicator/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewWithViewport/with_scrollbar/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestFocusViewWithViewport/with_scrollbar/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/errored_state/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/errored_state/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/loading_state/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/loading_state/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/long_name/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/long_name/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/with_account/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/with_account/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/without_account/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestMysisLine/without_account/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestSpinnerInDashboard/with_spinner_frame_0/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestSpinnerInDashboard/with_spinner_frame_0/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestSpinnerInDashboard/with_spinner_frame_4/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestSpinnerInDashboard/with_spinner_frame_4/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestSpinnerInDashboard/with_spinner_frame_7/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestSpinnerInDashboard/with_spinner_frame_7/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_0/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_0/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_1/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_1/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_2/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_2/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_3/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_3/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_4/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_4/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_5/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_5/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_6/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_6/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_7/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicatorAlignment/spinner_frame_7/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/errored/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/errored/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/idle/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/idle/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/loading/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/loading/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/running_with_spinner/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/running_with_spinner/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/stopped/ANSI.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/testdata/TestStateIndicators/stopped/Stripped.golden+1−1
Cut short: this commit's diff is over 1000 lines.
internal/tui/tui_test.go+15−18
Cut short: this commit's diff is over 1000 lines.
internal/tui/width_test.go+11−11
Cut short: this commit's diff is over 1000 lines.