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
fix(types,test): resolve noImplicitAny in progressiveAging + align semaphore test to #2903 gate pruning
diegosouzapwa9bc0e86853a
diff --git a/open-sse/services/compression/progressiveAging.ts b/open-sse/services/compression/progressiveAging.tsindex be50599d07..3dbbdd6d77 100644--- a/open-sse/services/compression/progressiveAging.ts+++ b/open-sse/services/compression/progressiveAging.ts@@ -12,6 +12,10 @@ function estimateTokens(text: string): number {type ChatMessage = ChatMessageLike;+type CompressedResult = {+ body?: { messages?: Array<{ content?: ChatMessageLike["content"] }> };+};+function setContent(msg: ChatMessage, newContent: string): ChatMessage {return replaceTextContent(msg, newContent) as ChatMessage;}@@ -52,7 +56,7 @@ export function applyAging(if (distanceFromEnd <= t.verbatim) {result.push(msg);} else if (distanceFromEnd <= t.light) {- const compressed = applyLiteCompression({ messages: [msg] });+ const compressed = applyLiteCompression({ messages: [msg] }) as CompressedResult;if (compressed?.body?.messages?.[0]?.content) {const newContent =typeof compressed.body.messages[0].content === "string"@@ -65,7 +69,7 @@ export function applyAging(result.push(msg);}} else if (distanceFromEnd <= t.moderate) {- const compressed = cavemanCompress({ messages: [msg] as unknown as Parameters<typeof cavemanCompress>[0]["messages"] });+ const compressed = cavemanCompress({ messages: [msg] as unknown as Parameters<typeof cavemanCompress>[0]["messages"] }) as CompressedResult;if (compressed?.body?.messages?.[0]?.content) {const newContent =typeof compressed.body.messages[0].content === "string"diff --git a/tests/unit/services-branch-hardening.test.ts b/tests/unit/services-branch-hardening.test.tsindex 76ebb95554..f02ec82824 100644--- a/tests/unit/services-branch-hardening.test.ts+++ b/tests/unit/services-branch-hardening.test.ts@@ -193,7 +193,9 @@ test("rate limit semaphore covers immediate acquire, timeout, cooldown drain andrelease();release();- assert.equal(rateLimitSemaphore.getStats()["model-a"].running, 0);+ // #2903 (perf-ram) prunes idle gates when they reach zero running/queued, so the+ // entry may be absent here — assert "no running slots" without assuming it persists.+ assert.equal(rateLimitSemaphore.getStats()["model-a"]?.running ?? 0, 0);const heldRelease = await rateLimitSemaphore.acquire("model-b", { maxConcurrency: 1 });const timeoutPromise = rateLimitSemaphore.acquire("model-b", {@@ -214,7 +216,7 @@ test("rate limit semaphore covers immediate acquire, timeout, cooldown drain andassert.equal(rateLimitSemaphore.getStats()["model-c"].queued, 1);const secondRelease = await secondPromise;secondRelease();- assert.equal(rateLimitSemaphore.getStats()["model-c"].queued, 0);+ assert.equal(rateLimitSemaphore.getStats()["model-c"]?.queued ?? 0, 0);const blockingRelease = await rateLimitSemaphore.acquire("model-d", { maxConcurrency: 1 });const queuedPromise = rateLimitSemaphore.acquire("model-d", {