refactor!: remove hardcoded default models, require explicit config

REMOVED all hardcoded default backend/model values from defaultModelsConfig.
Now ~/.codeagent/models.json is REQUIRED - missing config returns clear error
with example configuration.

BREAKING CHANGE: Users must configure ~/.codeagent/models.json before using
--agent or parallel tasks with agent: field.

Generated with SWE-Agent.ai

Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
This commit is contained in:
cexll
2026-01-26 17:47:21 +08:00
parent 3d76d46336
commit e9a8013c6f
9 changed files with 273 additions and 147 deletions

View File

@@ -3,6 +3,7 @@ package wrapper
import (
"bytes"
"os"
"path/filepath"
"testing"
config "codeagent-wrapper/internal/config"
@@ -29,6 +30,18 @@ func BenchmarkConfigParse_ParseArgs(b *testing.B) {
b.Setenv("HOME", home)
b.Setenv("USERPROFILE", home)
configDir := filepath.Join(home, ".codeagent")
if err := os.MkdirAll(configDir, 0o755); err != nil {
b.Fatal(err)
}
if err := os.WriteFile(filepath.Join(configDir, "models.json"), []byte(`{
"agents": {
"develop": { "backend": "codex", "model": "gpt-test" }
}
}`), 0o644); err != nil {
b.Fatal(err)
}
config.ResetModelsConfigCacheForTest()
b.Cleanup(config.ResetModelsConfigCacheForTest)