Files
openclaw/src/system-agent/assistant-timeout.test.ts
Peter Steinberger 784ede0af1 feat(system-agent): local-model viability — context cap, thinking off, route-aware timeout (#109445)
* feat: improve system agent local model viability

* fix: forward Ollama effective context cap

* fix(system-agent): keep flat 120s agent-turn budget

* fix(system-agent): keep manifests timeout helper module-local
2026-07-16 18:11:22 -07:00

52 lines
1.6 KiB
TypeScript

// System-agent timeout tests cover manifest-owned local-route classification.
import { describe, expect, it } from "vitest";
import {
SYSTEM_AGENT_ASSISTANT_LOCAL_TIMEOUT_MS,
SYSTEM_AGENT_ASSISTANT_TIMEOUT_MS,
} from "./assistant-prompts.js";
import "./assistant-timeout.js";
const { resolveSystemAgentAssistantTimeoutFromManifests } = (
globalThis as Record<PropertyKey, unknown>
)[Symbol.for("openclaw.systemAgentTimeoutTestApi")] as {
resolveSystemAgentAssistantTimeoutFromManifests: (params: {
route: { modelLabel: string; provider: string };
plugins: ReadonlyArray<{
modelPricing?: { providers?: Record<string, { external?: boolean }> };
}>;
}) => number;
};
describe("system-agent assistant timeout", () => {
it.each([
{
name: "external provider",
provider: "openai",
modelLabel: "openai/gpt-5.5",
external: true,
expected: SYSTEM_AGENT_ASSISTANT_TIMEOUT_MS,
},
{
name: "local provider",
provider: "ollama",
modelLabel: "ollama/qwen3.5:4b",
external: false,
expected: SYSTEM_AGENT_ASSISTANT_LOCAL_TIMEOUT_MS,
},
{
name: "hosted sibling provider",
provider: "ollama-cloud",
modelLabel: "ollama-cloud/glm-5.2:cloud",
external: true,
expected: SYSTEM_AGENT_ASSISTANT_TIMEOUT_MS,
},
])("uses the $name budget", ({ provider, modelLabel, external, expected }) => {
expect(
resolveSystemAgentAssistantTimeoutFromManifests({
route: { provider, modelLabel },
plugins: [{ modelPricing: { providers: { [provider]: { external } } } }],
}),
).toBe(expected);
});
});