From b88ea39b83641af8d63abaf4a4bef78ced09a541 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 18:18:03 +0000 Subject: [PATCH] fix: add subagent default model typing --- src/agents/pi-embedded-runner.test.ts | 8 ++------ src/cli/models-cli.test.ts | 8 ++------ src/config/types.ts | 2 ++ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/agents/pi-embedded-runner.test.ts b/src/agents/pi-embedded-runner.test.ts index 5cfaf41b6..e6776c812 100644 --- a/src/agents/pi-embedded-runner.test.ts +++ b/src/agents/pi-embedded-runner.test.ts @@ -703,9 +703,7 @@ describe("runEmbeddedPiAgent", () => { ).resolves.toBeTruthy(); }); - it( - "persists the first user message before assistant output", - async () => { + it("persists the first user message before assistant output", async () => { const agentDir = await fs.mkdtemp( path.join(os.tmpdir(), "clawdbot-agent-"), ); @@ -743,9 +741,7 @@ describe("runEmbeddedPiAgent", () => { if (firstAssistantIndex !== -1) { expect(firstUserIndex).toBeLessThan(firstAssistantIndex); } - }, - 15_000, - ); + }, 15_000); it("persists the user message when prompt fails before assistant output", async () => { const agentDir = await fs.mkdtemp( diff --git a/src/cli/models-cli.test.ts b/src/cli/models-cli.test.ts index d959981a7..32614f31d 100644 --- a/src/cli/models-cli.test.ts +++ b/src/cli/models-cli.test.ts @@ -14,9 +14,7 @@ vi.mock("../commands/models.js", async () => { }); describe("models cli", () => { - it( - "registers github-copilot login command", - async () => { + it("registers github-copilot login command", async () => { const { Command } = await import("commander"); const { registerModelsCli } = await import("./models-cli.js"); @@ -46,7 +44,5 @@ describe("models cli", () => { expect.objectContaining({ yes: true }), expect.any(Object), ); - }, - 15_000, - ); + }, 15_000); }); diff --git a/src/config/types.ts b/src/config/types.ts index d1d5e6af6..c07c19d08 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -1651,6 +1651,8 @@ export type AgentDefaultsConfig = { maxConcurrent?: number; /** Auto-archive sub-agent sessions after N minutes (default: 60). */ archiveAfterMinutes?: number; + /** Default model selection for spawned sub-agents (string or {primary,fallbacks}). */ + model?: string | { primary?: string; fallbacks?: string[] }; }; /** Optional sandbox settings for non-main sessions. */ sandbox?: {