fix(core): respect v2 default agents (#30969)

This commit is contained in:
Kit Langton 2026-06-05 10:47:31 -04:00 committed by GitHub
commit 02a5ae6585
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 155 additions and 18 deletions

View file

@ -244,6 +244,7 @@ describe("Config", () => {
JSON.stringify({
shell: "/bin/bash",
model: "anthropic/claude",
default_agent: "reviewer",
autoupdate: "notify",
share: "disabled",
enterprise: { url: "https://share.example.com" },
@ -328,6 +329,7 @@ describe("Config", () => {
expect(documents).toHaveLength(1)
expect(documents[0]?.info.shell).toBe("/bin/bash")
expect(documents[0]?.info.model).toBe("anthropic/claude")
expect(documents[0]?.info.default_agent).toBe("reviewer")
expect(documents[0]?.info.autoupdate).toBe("notify")
expect(documents[0]?.info.share).toBe("disabled")
expect(documents[0]?.info.enterprise).toEqual({ url: "https://share.example.com" })
@ -427,6 +429,7 @@ describe("Config", () => {
path.join(tmp.path, "opencode.json"),
JSON.stringify({
shell: "/bin/zsh",
default_agent: "reviewer",
snapshot: false,
autoshare: true,
permission: {
@ -487,6 +490,7 @@ describe("Config", () => {
expect(documents).toHaveLength(1)
expect(documents[0]?.info).toBeInstanceOf(Config.Info)
expect(documents[0]?.info.shell).toBe("/bin/zsh")
expect(documents[0]?.info.default_agent).toBe("reviewer")
expect(documents[0]?.info.snapshots).toBe(false)
expect(documents[0]?.info.share).toBe("auto")
expect(documents[0]?.info.permissions).toEqual([