Q82: one output cap and a whole-response wait across provider paths

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 14:00:06 -04:00
1 parent c3458a2eb5
commit 4e232b241f
8 files changed
+141 -41

No files matched your search

+3 -1
View File
@@ -25,8 +25,10 @@ describe("stream usage requests", () => {
for await (const event of result.events) void event;
}
expect(bodies.map((body) => body.stream_options ?? null)).toEqual([{ include_usage: true }, { include_usage: true }, null, null]);
expect(bodies.map((body) => body.max_completion_tokens ?? body.max_tokens)).toEqual([16_000, 16_000, 16_000, 16_000]);
expect(bodies.map((body) => "max_completion_tokens" in body)).toEqual([true, true, false, true]);
await makeChatCompletionsTurn("https://api.x.ai/v1/chat/completions", "xAI", true)({ credential: { apiKey: "k" }, model: "m", instructions: null, messages: [{ role: "user", text: "hi" }], tools: [] });
await makeChatCompletionsTurn("xai", "https://api.x.ai/v1/chat/completions", "xAI", true)({ credential: { apiKey: "k" }, model: "m", instructions: null, messages: [{ role: "user", text: "hi" }], tools: [] });
expect(bodies.at(-1)?.stream_options).toEqual({ include_usage: true });
});
});