Skip to content

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

Merge feature-tests: schema coercion, tool sanitization, Codex auth export, enhanced test suite

diegosouzapw7abea2020c8b
diff --cc open-sse/translator/index.ts
index 80b2b3c860,33bf03dd95..731d710c90
--- a/open-sse/translator/index.ts
+++ b/open-sse/translator/index.ts
@@@ -1,8 -1,12 +1,13 @@@
import { FORMATS } from "./formats.ts";
import { ensureToolCallIds, fixMissingToolResponses } from "./helpers/toolCallHelper.ts";
+import { coerceToolSchemas, sanitizeToolDescriptions } from "./helpers/schemaCoercion.ts";
import { prepareClaudeRequest } from "./helpers/claudeHelper.ts";
import { filterToOpenAIFormat } from "./helpers/openaiHelper.ts";
+ import {
+ coerceToolSchemas,
+ injectEmptyReasoningContentForToolCalls,
+ sanitizeToolDescriptions,
+ } from "./helpers/schemaCoercion.ts";
import { getRequestTranslator, getResponseTranslator } from "./registry.ts";
import { bootstrapTranslatorRegistry } from "./bootstrap.ts";
import { normalizeThinkingConfig } from "../services/provider.ts";
diff --cc src/lib/usage/callLogs.ts
index 1fb4d6f6f3,4ee6ba2e8a..35dbfedd68
--- a/src/lib/usage/callLogs.ts
+++ b/src/lib/usage/callLogs.ts
@@@ -49,20 -48,8 +49,9 @@@ function hasTruncatedFlag(value: unknow
return (value as Record<string, unknown>)._truncated === true;
}
-const DEFAULT_CALL_LOGS_MAX = 10_000;
+const DEFAULT_MAX_CALL_LOGS = 10000;
-
- async function getMaxCallLogs(): Promise<number> {
- try {
- const settings = await getSettings();
- const setting = settings.maxCallLogs;
- if (setting) {
- const num = parseInt(String(setting), 10);
- if (!isNaN(num) && num > 0) return num;
- }
- } catch {}
- return DEFAULT_MAX_CALL_LOGS;
- }
+ const CALL_LOGS_MAX_CACHE_TTL_MS = 30_000;
+
const LOG_RETENTION_DAYS = parseInt(process.env.LOG_RETENTION_DAYS || "7", 10);
const CALL_LOG_PAYLOAD_MODE = (() => {
const value = (process.env.CALL_LOG_PAYLOAD_MODE || "full").toLowerCase();
@@@ -71,6 -58,55 +60,55 @@@
const shouldLogPayloadInDb = CALL_LOG_PAYLOAD_MODE !== "none";
const shouldLogPayloadOnDisk = CALL_LOG_PAYLOAD_MODE === "full";
+ let callLogsMaxCache = {
- value: resolveCallLogsMaxValue(process.env.CALL_LOGS_MAX) ?? DEFAULT_CALL_LOGS_MAX,
++ value: resolveCallLogsMaxValue(process.env.CALL_LOGS_MAX) ?? DEFAULT_MAX_CALL_LOGS,
+ expiresAt: 0,
+ };
+
+ function resolveCallLogsMaxValue(value: unknown): number | null {
+ if (typeof value === "number" && Number.isInteger(value) && value > 0) return value;
+ if (typeof value === "string" && value.trim().length > 0) {
+ const parsed = Number.parseInt(value, 10);
+ return Number.isInteger(parsed) && parsed > 0 ? parsed : null;
+ }
+ return null;
+ }
+
+ async function getMaxCallLogs(): Promise<number> {
+ const now = Date.now();
+ if (callLogsMaxCache.expiresAt > now) {
+ return callLogsMaxCache.value;
+ }
+
- let value = resolveCallLogsMaxValue(process.env.CALL_LOGS_MAX) ?? DEFAULT_CALL_LOGS_MAX;
++ let value = resolveCallLogsMaxValue(process.env.CALL_LOGS_MAX) ?? DEFAULT_MAX_CALL_LOGS;
+
+ try {
+ const { getSettings } = await import("@/lib/localDb");
+ const settings = await getSettings();
+ const configured =
+ resolveCallLogsMaxValue(settings.maxCallLogs) ??
+ resolveCallLogsMaxValue(settings.MAX_CALL_LOGS);
+ if (configured !== null) {
+ value = configured;
+ }
+ } catch {
+ // Fall back to env/default cap when settings are unavailable.
+ }
+
+ callLogsMaxCache = {
+ value,
+ expiresAt: now + CALL_LOGS_MAX_CACHE_TTL_MS,
+ };
+ return value;
+ }
+
+ export function invalidateCallLogsMaxCache(): void {
+ callLogsMaxCache = {
- value: resolveCallLogsMaxValue(process.env.CALL_LOGS_MAX) ?? DEFAULT_CALL_LOGS_MAX,
++ value: resolveCallLogsMaxValue(process.env.CALL_LOGS_MAX) ?? DEFAULT_MAX_CALL_LOGS,
+ expiresAt: 0,
+ };
+ }
+
/** Fields that should always be redacted from logged payloads */
const SENSITIVE_KEYS = new Set([
"api_key",
diff --cc src/shared/constants/cliTools.ts
index 95d23de13e,ff7628633c..6578168fe9
--- a/src/shared/constants/cliTools.ts
+++ b/src/shared/constants/cliTools.ts
@@@ -101,11 -101,21 +101,17 @@@ export const CLI_TOOLS =
windsurf: {
id: "windsurf",
name: "Windsurf",
- icon: "airwave",
- color: "#06B6D4",
- description: "Windsurf IDE guide with current official limitations",
- docsUrl: "https://docs.windsurf.com/windsurf/models",
+ image: "/providers/windsurf.svg",
+ color: "#4A90E2",
+ description: "Windsurf AI-first IDE by Codeium",
+ docsUrl: "https://windsurf.com/",
configType: "guide",
+ notes: [
+ {
+ type: "warning",
+ text: "Official Windsurf docs currently describe BYOK for select Claude models plus enterprise URL/token settings, not a generic custom OpenAI-compatible provider.",
+ },
- {
- type: "warning",
- text: "The official proxy documentation is for network proxies. Verify the latest Windsurf docs before attempting to point it at OmniRoute as a model provider.",
- },
+ ],
guideSteps: [
{
step: 1,