






















@@ -9,6 +9,7 @@ import * as attemptExecutionRuntime from "../agents/command/attempt-execution.ru
99import { loadManifestModelCatalog, loadModelCatalog } from "../agents/model-catalog.js";
1010import * as modelSelectionModule from "../agents/model-selection.js";
1111import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
12+import { BASE_THINKING_LEVELS } from "../auto-reply/thinking.shared.js";
1213import * as runtimeSnapshotModule from "../config/runtime-snapshot.js";
1314import { clearSessionStoreCacheForTest } from "../config/sessions/store.js";
1415import type { OpenClawConfig } from "../config/types.openclaw.js";
@@ -18,7 +19,10 @@ import {
1819resetAgentEventsForTest,
1920resetAgentRunContextForTest,
2021} from "../infra/agent-events.js";
22+import type { PluginProviderRegistration } from "../plugins/registry.js";
23+import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../plugins/runtime.js";
2124import type { RuntimeEnv } from "../runtime.js";
25+import { createTestRegistry } from "../test-utils/channel-plugins.js";
2226import { agentCommand, agentCommandFromIngress } from "./agent.js";
2327import { createThrowingTestRuntime } from "./test-runtime-config-helpers.js";
2428@@ -321,8 +325,30 @@ function mockModelCatalogOnce(entries: ReturnType<typeof loadManifestModelCatalo
321325vi.mocked(loadModelCatalog).mockResolvedValueOnce(entries);
322326}
323327328+function installThinkingTestProviders() {
329+const registry = createTestRegistry();
330+registry.providers = ["anthropic", "codex", "ollama", "openai", "openrouter"].map(
331+(providerId): PluginProviderRegistration => ({
332+pluginId: providerId,
333+source: "test",
334+provider: {
335+id: providerId,
336+label: providerId,
337+auth: [],
338+resolveThinkingProfile: () => ({
339+levels: BASE_THINKING_LEVELS.map((id) => ({ id })),
340+defaultLevel: "off",
341+}),
342+},
343+}),
344+);
345+setActivePluginRegistry(registry);
346+}
347+324348beforeEach(() => {
325349vi.clearAllMocks();
350+resetPluginRuntimeStateForTest();
351+installThinkingTestProviders();
326352clearSessionStoreCacheForTest();
327353resetAgentEventsForTest();
328354resetAgentRunContextForTest();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。