Skip to content

Commit 728a140

Browse files
Apply prettier to files the main merge left unformatted
Amp-Thread-ID: https://ampcode.com/threads/T-01a02c68-0d8d-777b-b717-81fb9a282023 Co-authored-by: Amp <amp@ampcode.com>
1 parent 98a346d commit 728a140

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

src/config.test.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,12 @@ describe("buildBifrostSource", () => {
927927

928928
describe("buildXaiSource", () => {
929929
test("omits reasoning_effort when effort is absent", () => {
930-
const source = buildXaiSource({ id: "xai/work", apiKey: "tok", model: "grok-4.6", sessionId: "sess-1" });
930+
const source = buildXaiSource({
931+
id: "xai/work",
932+
apiKey: "tok",
933+
model: "grok-4.6",
934+
sessionId: "sess-1",
935+
});
931936
expect(source.provider).toBe("grok-responses");
932937
expect(source.defaults?.providerOptions).not.toHaveProperty("reasoning_effort");
933938
});
@@ -944,12 +949,22 @@ describe("buildXaiSource", () => {
944949
});
945950

946951
test("does not invent high when effort is absent", () => {
947-
const source = buildXaiSource({ id: "xai/work", apiKey: "tok", model: "grok-4.6", sessionId: "sess-1" });
952+
const source = buildXaiSource({
953+
id: "xai/work",
954+
apiKey: "tok",
955+
model: "grok-4.6",
956+
sessionId: "sess-1",
957+
});
948958
expect(source.defaults?.providerOptions?.["reasoning_effort"]).toBeUndefined();
949959
});
950960

951961
test("stashes the session id for the adapter's prompt_cache_key", () => {
952-
const source = buildXaiSource({ id: "xai/work", apiKey: "tok", model: "grok-4.6", sessionId: "sess-1" });
962+
const source = buildXaiSource({
963+
id: "xai/work",
964+
apiKey: "tok",
965+
model: "grok-4.6",
966+
sessionId: "sess-1",
967+
});
953968
expect(source.defaults?.providerOptions).toMatchObject({ grokSessionId: "sess-1" });
954969
});
955970
});

tests/unit/grok-responses-adapter.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ describe("grok-responses buildRequest", () => {
105105
...baseOptions,
106106
providerOptions: { ...baseOptions.providerOptions, [GROK_SESSION_ID_OPTION]: "sess-1" },
107107
};
108-
const first = JSON.parse(adapter().buildRequest([userTurn("a")], "grok-4.5", options).body) as Record<string, unknown>;
109-
const second = JSON.parse(adapter().buildRequest([userTurn("b")], "grok-4.5", options).body) as Record<string, unknown>;
108+
const first = JSON.parse(
109+
adapter().buildRequest([userTurn("a")], "grok-4.5", options).body,
110+
) as Record<string, unknown>;
111+
const second = JSON.parse(
112+
adapter().buildRequest([userTurn("b")], "grok-4.5", options).body,
113+
) as Record<string, unknown>;
110114
expect(first["prompt_cache_key"]).toBe("sess-1");
111115
expect(second["prompt_cache_key"]).toBe("sess-1");
112116
});
@@ -123,7 +127,9 @@ describe("grok-responses buildRequest", () => {
123127
});
124128

125129
test("omits prompt_cache_key when no session id is present", () => {
126-
const body = JSON.parse(adapter().buildRequest([userTurn("hi")], "grok-4.5", baseOptions).body) as Record<string, unknown>;
130+
const body = JSON.parse(
131+
adapter().buildRequest([userTurn("hi")], "grok-4.5", baseOptions).body,
132+
) as Record<string, unknown>;
127133
expect(body).not.toHaveProperty("prompt_cache_key");
128134
});
129135

0 commit comments

Comments
 (0)