Files
oh-my-pi/packages/coding-agent/test/sdk-tool-call-syntax.test.ts
T
can1357 fbba331f8a feat(cross-cutting): added multi-syntax in-band tool-call support for runtime tool conversion
- Added optional Agent and SDK tool-call syntax controls (`toolCallSyntax`, `PI_OWNED_TOOLS`) for owned calls.
- Added in-band grammar scanners and renderers for Anthropic, DeepSeek, GLM, Hermes, Kimi, PI, and Qwen3.
- Added supportsTools propagation and model schema updates to route unsupported models to fallback syntax.
- Replaced stream-markup parsing with syntax-specific in-band scanners and event conversion.
2026-06-15 07:33:24 +02:00

17 lines
786 B
TypeScript

import { describe, expect, it } from "bun:test";
import { resolveToolCallSyntax } from "@oh-my-pi/pi-coding-agent/sdk";
describe("resolveToolCallSyntax", () => {
it("uses GLM in auto mode only for models known not to support native tools", () => {
expect(resolveToolCallSyntax("auto", { supportsTools: false })).toBe("glm");
expect(resolveToolCallSyntax("auto", { supportsTools: true })).toBeUndefined();
expect(resolveToolCallSyntax("auto", {})).toBeUndefined();
expect(resolveToolCallSyntax("auto", undefined)).toBeUndefined();
});
it("keeps native unset and passes explicit in-band syntaxes through", () => {
expect(resolveToolCallSyntax("native", { supportsTools: false })).toBeUndefined();
expect(resolveToolCallSyntax("qwen3", undefined)).toBe("qwen3");
});
});