Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
import test from "node:test";
import assert from "node:assert/strict";
import { DefaultExecutor } from "../../open-sse/executors/default.ts";
// #13198: reka-flash-3 reasons on every request. #14888 keeps a budget the
// caller set; the 4096 floor only fills in when the caller omitted one.
test("#14888 reka-flash-3 keeps a caller-supplied max_tokens", () => {
const executor = new DefaultExecutor("reka");
const body = { model: "reka-flash-3", max_tokens: 256 } as Record<string, unknown>;
executor.ensureThinkingBudget(body, "reka-flash-3");
assert.equal(body.max_tokens, 256);
});
test("#13198 reka-flash-3 still gets the floor when the caller omitted max_tokens", () => {
const executor = new DefaultExecutor("reka");
const body = { model: "reka-flash-3" } as Record<string, unknown>;
executor.ensureThinkingBudget(body, "reka-flash-3");
assert.equal(body.max_tokens, 4096);
});
test("#13198 non-reasoning reka models keep the caller's max_tokens", () => {
const executor = new DefaultExecutor("reka");
const body = { model: "reka-flash", max_tokens: 256 } as Record<string, unknown>;
executor.ensureThinkingBudget(body, "reka-flash");
assert.equal(body.max_tokens, 256);
});