Skip to content

Commit f80a6ce

Browse files
committed
refactor(xai): remove unused responses body test seam
1 parent 4c294d9 commit f80a6ce

2 files changed

Lines changed: 1 addition & 36 deletions

File tree

‎extensions/xai/src/responses-tool-shared.test.ts‎

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,12 @@
11
// Xai tests cover responses tool shared plugin behavior.
22
import { describe, expect, it } from "vitest";
33
import {
4-
buildXaiResponsesToolBody,
54
extractXaiWebSearchContent,
65
requireXaiResponseTextAndCitations,
76
requireXaiResponseTextCitationsAndInline,
87
} from "./responses-tool-shared.js";
98

109
describe("xai responses tool helpers", () => {
11-
it("builds the shared xAI Responses tool body", () => {
12-
expect(
13-
buildXaiResponsesToolBody({
14-
model: "grok-4.3",
15-
inputText: "search for openclaw",
16-
tools: [{ type: "x_search" }],
17-
maxTurns: 2,
18-
reasoningEffort: "none",
19-
}),
20-
).toEqual({
21-
model: "grok-4.3",
22-
input: [{ role: "user", content: "search for openclaw" }],
23-
tools: [{ type: "x_search" }],
24-
store: false,
25-
reasoning: { effort: "none" },
26-
max_turns: 2,
27-
});
28-
});
29-
30-
it("keeps custom model reasoning untouched while disabling response storage", () => {
31-
expect(
32-
buildXaiResponsesToolBody({
33-
model: "grok-build-0.1",
34-
inputText: "run code",
35-
tools: [{ type: "code_interpreter" }],
36-
}),
37-
).toEqual({
38-
model: "grok-build-0.1",
39-
input: [{ role: "user", content: "run code" }],
40-
tools: [{ type: "code_interpreter" }],
41-
store: false,
42-
});
43-
});
44-
4510
it("falls back to annotation citations when the API omits top-level citations", () => {
4611
expect(
4712
requireXaiResponseTextAndCitations(

‎extensions/xai/src/responses-tool-shared.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function resolveXaiResponsesEndpoint(baseUrl?: unknown): string {
5757
return `${(trimString(baseUrl) ?? XAI_RESPONSES_BASE_URL).replace(/\/+$/, "")}/responses`;
5858
}
5959

60-
export function buildXaiResponsesToolBody(params: {
60+
function buildXaiResponsesToolBody(params: {
6161
model: string;
6262
inputText: string;
6363
tools: Array<Record<string, unknown>>;

0 commit comments

Comments
 (0)