feat: make systemDefaultModel optional for OpenCode fallback (#1136)

- Remove mandatory model requirement from plugin initialization
- Allow OpenCode to use its built-in model fallback when user doesn't specify
- Update model-resolver to handle undefined systemDefaultModel
- Remove throw errors in config-handler, utils, atlas, delegate-task
- Add tests for optional model scenarios

Closes #1129

Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
This commit is contained in:
justsisyphus
2026-01-26 17:01:08 +09:00
committed by GitHub
parent a21e4172b1
commit 8e0773de0a
9 changed files with 246 additions and 190 deletions
+24
View File
@@ -106,6 +106,30 @@ describe("createBuiltinAgents with model overrides", () => {
})
})
describe("createBuiltinAgents without systemDefaultModel", () => {
test("creates agents successfully without systemDefaultModel", async () => {
// #given - no systemDefaultModel provided
// #when
const agents = await createBuiltinAgents([], {}, undefined, undefined)
// #then - agents should still be created using fallback chain
expect(agents.oracle).toBeDefined()
expect(agents.oracle.model).toBe("openai/gpt-5.2")
})
test("sisyphus uses fallback chain when systemDefaultModel undefined", async () => {
// #given - no systemDefaultModel
// #when
const agents = await createBuiltinAgents([], {}, undefined, undefined)
// #then - sisyphus should use its fallback chain
expect(agents.sisyphus).toBeDefined()
expect(agents.sisyphus.model).toBe("anthropic/claude-opus-4-5")
})
})
describe("buildAgent with category and skills", () => {
const { buildAgent } = require("./utils")
const TEST_MODEL = "anthropic/claude-opus-4-5"