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 c9b86b7815
commit 3ee519c7b0
9 changed files with 246 additions and 190 deletions
+6 -6
View File
@@ -78,11 +78,11 @@ describe("sisyphus-task", () => {
})
describe("category delegation config validation", () => {
test("returns error when systemDefaultModel is not configured", async () => {
test("proceeds without error when systemDefaultModel is undefined", async () => {
// #given a mock client with no model in config
const { createDelegateTask } = require("./tools")
const mockManager = { launch: async () => ({}) }
const mockManager = { launch: async () => ({ id: "task-123" }) }
const mockClient = {
app: { agents: async () => ({ data: [] }) },
config: { get: async () => ({}) }, // No model configured
@@ -111,14 +111,14 @@ describe("sisyphus-task", () => {
description: "Test task",
prompt: "Do something",
category: "ultrabrain",
run_in_background: false,
load_skills: ["git-master"],
run_in_background: true,
load_skills: [],
},
toolContext
)
// #then returns descriptive error message
expect(result).toContain("oh-my-opencode requires a default model")
// #then proceeds without error - uses fallback chain
expect(result).not.toContain("oh-my-opencode requires a default model")
})
})