Files
can1357 19c0afcc0d feat: implemented external thinking flags and transport reasoning controls
- Added the `--external-thinking` CLI flag alongside model capability checks to gate external thinking tool availability.
- Updated Anthropic and Google transports to honor `forceReasoningOff` for native thinking-off controls.
- Renamed the `thoughts` property and parameter to `notes` across think fixtures, tools, and tests.
- Updated system prompt instructions and test suites to verify transport-specific thinking and tool activation.
2026-08-12 02:23:17 +02:00

46 lines
1.5 KiB
TypeScript

import { beforeAll, describe, expect, it } from "bun:test";
import { getThemeByName, initTheme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
import { thinkToolRenderer } from "../../src/tools/think";
beforeAll(async () => {
await initTheme();
});
describe("thinkToolRenderer", () => {
it("renders thoughts with thinkingText color and italic style", async () => {
const theme = await getThemeByName("dark");
expect(theme).toBeDefined();
const uiTheme = theme!;
const callComponent = thinkToolRenderer.renderCall(
{ thoughts: "Cache the parsed config, then check invalidation." },
{ expanded: true, isPartial: false },
uiTheme,
);
expect(callComponent).toBeDefined();
const lines = callComponent.render(100);
const fullText = lines.join("\n");
expect(fullText).toContain("Cache the parsed config, then check invalidation.");
expect(fullText).toContain(uiTheme.fg("thinkingText", "Cache the parsed config, then check invalidation."));
});
it("has inline set to true", () => {
expect(thinkToolRenderer.inline).toBe(true);
});
it("returns undefined for renderResult", () => {
expect(thinkToolRenderer.renderResult()).toBeUndefined();
});
it("handles empty or missing thoughts gracefully", async () => {
const theme = await getThemeByName("dark");
const uiTheme = theme!;
const emptyCall = thinkToolRenderer.renderCall({}, { expanded: true, isPartial: false }, uiTheme);
expect(emptyCall).toBeDefined();
expect(emptyCall.render(100)).toEqual([]);
});
});