Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/adapters/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const GOOGLE_BREVITY_INSTRUCTION = [
"- Do detailed reasoning internally, not as visible intermediate output.",
"- Prefer taking the next tool action over explaining; keep calling tools until the task is complete.",
"- This applies only to intermediate progress text. Your final answer after the work is done is exempt: write it in full and at whatever length the task requires.",
"- Formatting: The client environment renders standard Markdown and does not support LaTeX math delimiters ($...$, $$...$$, \\(...\\), \\[...\\]). Do not use LaTeX math delimiters or LaTeX markup (such as \\text{}, \\times, \\le, \\ge, etc.) for variables, formulas, dimensions, or units. Use clean plain text, Markdown, and Unicode symbols (e.g. 180°, 2560 × 1920 px, ≤, ≥, Δ, ±) instead.",
].join("\n");

const ANTIGRAVITY_REJECTED_CLAUDE_SDK_PARAGRAPH =
Expand Down
10 changes: 10 additions & 0 deletions tests/adapters/google/google-adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ describe("google adapter — tool-call ids on the wire", () => {
expect(instruction.parts[0].text).toContain("Valid tool names for this turn are exactly `exec_command`.");
});

test("systemInstruction includes formatting guidance against unrendered LaTeX math", async () => {
const body = await geminiBody(parsedWith(
[{ role: "user", content: "inspect results" }],
[],
));
const instruction = body.systemInstruction as { parts: Array<{ text: string }> };
expect(instruction.parts[0].text).toContain(String.raw`does not support LaTeX math delimiters ($...$, $$...$$, \(...\), \[...\])`);
expect(instruction.parts[0].text).toContain(String.raw`\text{}, \times, \le, \ge`);
});

test("functionCall and functionResponse carry the matching tool-call id", async () => {
const contents = await geminiContents(parsedWith([
{ role: "assistant", content: [{ type: "toolCall", id: "call_abc", name: "bash", arguments: { cmd: "ls" } }] },
Expand Down
Loading