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
test: align pipeline integration assertions
R.D.07890df6cb1d
diff --git a/tests/integration/integration-wiring.test.mjs b/tests/integration/integration-wiring.test.mjsindex 404945705c..ed9e3011d9 100644--- a/tests/integration/integration-wiring.test.mjs+++ b/tests/integration/integration-wiring.test.mjs@@ -59,6 +59,7 @@ describe("Pipeline Wiring — server-init.ts", () => {describe("Pipeline Wiring — sse chat handler", () => {const src = readProjectFile("src/sse/handlers/chat.ts");+ const coreSrc = readProjectFile("open-sse/handlers/chatCore.ts");it("should import and use request sanitization", () => {assert.ok(src, "src/sse/handlers/chat.ts should exist");@@ -81,8 +82,10 @@ describe("Pipeline Wiring — sse chat handler", () => {assert.match(src, /generateRequestId/);});- it("should import cost tracking integration", () => {- assert.match(src, /recordCost/);+ it("should keep cost tracking integration in the chat pipeline", () => {+ assert.ok(coreSrc, "open-sse/handlers/chatCore.ts should exist");+ assert.match(coreSrc, /calculateCost/);+ assert.match(coreSrc, /recordCost/);});});diff --git a/tests/integration/proxy-pipeline.test.mjs b/tests/integration/proxy-pipeline.test.mjsindex ac50a66d04..cf23643351 100644--- a/tests/integration/proxy-pipeline.test.mjs+++ b/tests/integration/proxy-pipeline.test.mjs@@ -23,12 +23,19 @@ function readSrc(relPath) {return readFileSync(full, "utf8");}+function readOpenSse(relPath) {+ const full = join(ROOT, "open-sse", relPath);+ if (!existsSync(full)) return null;+ return readFileSync(full, "utf8");+}+// ═══════════════════════════════════════════════════// 1. Chat Handler Pipeline Wiring// ═══════════════════════════════════════════════════describe("Chat Pipeline — handleSingleModelChat decomposition", () => {const src = readSrc("sse/handlers/chat.ts");+ const coreSrc = readOpenSse("handlers/chatCore.ts");it("should define resolveModelOrError helper", () => {assert.ok(src, "chat.ts should exist");@@ -43,8 +50,10 @@ describe("Chat Pipeline — handleSingleModelChat decomposition", () => {assert.match(src, /function\s+executeChatWithBreaker/);});- it("should define recordCostIfNeeded helper", () => {- assert.match(src, /function\s+recordCostIfNeeded/);+ it("should keep cost accounting in the core chat pipeline", () => {+ assert.ok(coreSrc, "open-sse/handlers/chatCore.ts should exist");+ assert.match(coreSrc, /calculateCost\(/);+ assert.match(coreSrc, /recordCost\(/);});it("handleSingleModelChat should use resolveModelOrError", () => {@@ -60,8 +69,9 @@ describe("Chat Pipeline — handleSingleModelChat decomposition", () => {assert.match(src, /executeChatWithBreaker\(/);});- it("handleSingleModelChat should use recordCostIfNeeded", () => {- assert.match(src, /recordCostIfNeeded\(/);+ it("chatCore should record cost for both non-streaming and streaming responses", () => {+ assert.match(coreSrc, /if \(apiKeyInfo\?\.id && usage\)/);+ assert.match(coreSrc, /if \(apiKeyInfo\?\.id && streamUsage\)/);});});