chore: treat minimax as unstable model requiring background monitoring

This commit is contained in:
justsisyphus
2026-02-01 17:20:01 +09:00
parent 0dafdde173
commit ab54e6ccdc
5 changed files with 108 additions and 3 deletions
@@ -91,6 +91,41 @@ describe("unstable-agent-babysitter hook", () => {
expect(text).toContain("deep thought")
})
test("fires reminder for hung minimax task", async () => {
// #given
setMainSession("main-1")
const promptCalls: Array<{ input: unknown }> = []
const ctx = createMockPluginInput({
messagesBySession: {
"main-1": [
{ info: { agent: "sisyphus", model: { providerID: "openai", modelID: "gpt-4" } } },
],
"bg-1": [
{ info: { role: "assistant" }, parts: [{ type: "thinking", thinking: "minimax thought" }] },
],
},
promptCalls,
})
const backgroundManager = createBackgroundManager([
createTask({ model: { providerID: "minimax", modelID: "minimax-1" } }),
])
const hook = createUnstableAgentBabysitterHook(ctx, {
backgroundManager,
config: { enabled: true, timeout_ms: 120000 },
})
// #when
await hook.event({ event: { type: "session.idle", properties: { sessionID: "main-1" } } })
// #then
expect(promptCalls.length).toBe(1)
const payload = promptCalls[0].input as { body?: { parts?: Array<{ text?: string }> } }
const text = payload.body?.parts?.[0]?.text ?? ""
expect(text).toContain("background_output")
expect(text).toContain("background_cancel")
expect(text).toContain("minimax thought")
})
test("does not remind stable model tasks", async () => {
// #given
setMainSession("main-1")
+1 -1
View File
@@ -99,7 +99,7 @@ function extractMessages(value: unknown): unknown[] {
function isUnstableTask(task: BackgroundTask): boolean {
if (task.isUnstableAgent === true) return true
const modelId = task.model?.modelID?.toLowerCase()
return modelId ? modelId.includes("gemini") : false
return modelId ? modelId.includes("gemini") || modelId.includes("minimax") : false
}
async function resolveMainSessionTarget(