Download src/agents/runtime-plan/tools.diagnostics.test.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/runtime-plan/tools.diagnostics.test.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/agents/runtime-plan/tools.diagnostics.test.ts
-
curl -L -o tools.diagnostics.test.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/agents/runtime-plan/tools.diagnostics.test.ts
1.47 kB
| // Runtime plan tool-diagnostics tests cover the legacy provider diagnostic path | |
| // used when no runtime plan owns tool schema diagnostics. | |
| import { describe, expect, it, vi } from "vitest"; | |
| const mocks = vi.hoisted(() => ({ | |
| logProviderToolSchemaDiagnostics: vi.fn(), | |
| normalizeProviderToolSchemas: vi.fn((params: { tools: unknown[] }) => params.tools), | |
| })); | |
| vi.mock("../embedded-agent-runner/tool-schema-runtime.js", () => ({ | |
| logProviderToolSchemaDiagnostics: mocks.logProviderToolSchemaDiagnostics, | |
| normalizeProviderToolSchemas: mocks.normalizeProviderToolSchemas, | |
| })); | |
| const { logAgentRuntimeToolDiagnostics } = await import("./tools.js"); | |
| describe("AgentRuntimePlan tool diagnostics legacy fallback", () => { | |
| it("falls back to provider diagnostics when no RuntimePlan is available", () => { | |
| const tools = [{ name: "alpha" }] as never; | |
| logAgentRuntimeToolDiagnostics({ | |
| tools, | |
| provider: "openai", | |
| modelId: "gpt-5.4", | |
| modelApi: "openai-responses", | |
| workspaceDir: "/tmp/openclaw-runtime-plan-tools", | |
| }); | |
| expect(mocks.logProviderToolSchemaDiagnostics).toHaveBeenCalledTimes(1); | |
| expect(mocks.logProviderToolSchemaDiagnostics.mock.calls.at(0)?.[0]).toEqual({ | |
| tools, | |
| provider: "openai", | |
| config: undefined, | |
| workspaceDir: "/tmp/openclaw-runtime-plan-tools", | |
| env: process.env, | |
| modelId: "gpt-5.4", | |
| modelApi: "openai-responses", | |
| model: undefined, | |
| }); | |
| }); | |
| }); | |