refactor(api): extract assistant chat orchestration

This commit is contained in:
2026-03-31 22:44:54 +02:00
parent 1b5f19c72c
commit 64111a9013
6 changed files with 522 additions and 214 deletions
@@ -1,3 +1,4 @@
import { DEFAULT_OPENAI_MODEL } from "@capakraken/shared";
import { beforeEach, describe, expect, it, vi } from "vitest";
vi.mock("../ai-client.js", () => ({
@@ -83,7 +84,7 @@ function createLoopInput(overrides: Partial<Parameters<typeof runAssistantToolLo
choices: [{ message: { content: "ok" } }],
}),
provider: "openai",
model: "gpt-4o-mini",
model: DEFAULT_OPENAI_MODEL,
maxTokens: 2000,
temperature: 0.4,
openaiMessages: [{ role: "system", content: "system" }],