Repository navigation
fix(reasoning): extend reasoning_content injection to Kimi K2 and other replay models - #2639
Conversation
…er replay models The injectEmptyReasoningContentForToolCalls function only handled DeepSeek V4 models, leaving Kimi K2 and other reasoning models without reasoning_content when tool_calls were present. This caused Kimi models to enter an infinite loop, repeating the same tool call indefinitely because the reasoning_content was not passed back. Changes: - Use requiresReasoningReplay() instead of isDeepSeekReasoningModel() to detect all models that need reasoning_content injection - Add comprehensive tests for Kimi K2, Qoder, and all reasoning replay providers Fixes infinite loop when using Kimi K2 models through OmniRoute.
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
There was a problem hiding this comment.
Code Review
This pull request refactors the reasoning content injection logic to use the requiresReasoningReplay helper, extending support to models like Kimi K2 and various third-party providers. The test suite has been significantly expanded to validate these additions. Review feedback identifies a critical syntax error in the test file due to orphaned code, an unused import in the schema coercion helper, and a recommendation to use unique test names for better maintainability.
| test("injectEmptyReasoningContentForToolCalls skips non-reasoning models", () => { | ||
| const messages = [{ role: "assistant", tool_calls: [{ id: "call_1" }] }]; | ||
|
|
||
| const result = injectEmptyReasoningContentForToolCalls( | ||
| messages, | ||
| "deepseek", | ||
| "deepseek-v3" | ||
| ) as Array<{ reasoning_content?: string }>; | ||
|
|
||
| assert.equal(result[0].reasoning_content, undefined); | ||
| }); |
There was a problem hiding this comment.
This change introduces a syntax error in the test file. While a new test block was added, the header for the previous test (formerly at line 134) was removed, but its body (lines 145-154) was left dangling. This results in orphaned code and an unmatched closing brace }); at line 154, which will prevent the test suite from running.
Please remove the redundant code block from lines 145 to 154 to restore the file's integrity.
| @@ -1,4 +1,4 @@ | |||
| import { isDeepSeekReasoningModel } from "../../services/reasoningCache.ts"; | |||
| import { isDeepSeekReasoningModel, requiresReasoningReplay } from "../../services/reasoningCache.ts"; | |||
There was a problem hiding this comment.
The import isDeepSeekReasoningModel is no longer used in this file. It was replaced by requiresReasoningReplay in the injectEmptyReasoningContentForToolCalls function. Removing unused imports helps maintain code cleanliness.
| import { isDeepSeekReasoningModel, requiresReasoningReplay } from "../../services/reasoningCache.ts"; | |
| import { requiresReasoningReplay } from "../../services/reasoningCache.ts"; |
| } | ||
| }); | ||
|
|
||
| test("injectEmptyReasoningContentForToolCalls skips non-reasoning models", () => { |
There was a problem hiding this comment.
This test shares the same name as the one defined on line 134. Duplicate test names can lead to confusing test reports and make it harder to identify which specific test failed. Consider using a more descriptive name for this comprehensive test case.
test("injectEmptyReasoningContentForToolCalls skips various non-reasoning models and providers", () => {81a35b8
into
cheaper-inference:release/v3.8.3
|
Muito obrigado pela contribuição, @herjarsa! A correção para o loop infinito de tool calls com o Kimi K2 foi integrada na release v3.8.3. Fizemos uma pequena limpeza em tests/unit/schema-coercion.test.ts para remover um trecho órfão remanescente. Seu trabalho é muito valioso para o OmniRoute! 🚀 |
* chore(config): ignore additional agent workflow command files Add newly introduced agent workflow and Claude command files to .gitignore so proprietary automation assets are not committed. * feat(deepseek-web): fix auth to use userToken + WASM PoW solver Rewrite deepseek-web executor from broken cookie auth to userToken Bearer flow (like Chat2API). Replace pure JS Keccak PoW with WASM solver (5.8s → 86ms). Add 14 models, validation, and dashboard UX. * fix(deepseek-web): update target_path to use challenge property * refactor(deepseek-web): streamline token handling and implement cache eviction * fix(deepseek-web): fix SSE parser, prompt format, and error handling - Handle all 3 DeepSeek SSE stream formats: initial fragments, APPEND operations, and bare string tokens (fixes truncated responses) - Simplify prompt builder to send system + last user message only (DeepSeek web API is single-turn, full history caused marker leakage) - Check json.code before token extraction (fixes "did not return access token: Authorization" on code 40003 with HTTP 200) - Clear session cache alongside token cache on auth errors - Add dev origin for remote testing Co-authored-by: Cursor <cursoragent@cursor.com> * chore: ignore memory-bank and cursor agent rules from tracking Co-authored-by: Cursor <cursoragent@cursor.com> * feat: enhance documentation and configuration for Fumadocs integration - Added Fumadocs MDX support in the Next.js configuration. - Updated transpile packages to include fumadocs-ui and fumadocs-core. - Implemented a comprehensive set of redirects for documentation paths to improve navigation. - Removed the generate-docs-index script as it is no longer needed. - Updated various documentation titles for consistency and clarity. - Enhanced global styles to incorporate Fumadocs UI themes and styles. * refactor(docs): cleanup fumadocs PR — revert deepseek, add i18n fallback, restore LanguageSelector - Revert unrelated deepseek-web.ts changes (should be separate PR) - Add .source/ to .gitignore (Fumadocs generated files) - Remove contributor IP from allowedDevOrigins - Add i18n runtime fallback: reads NEXT_LOCALE cookie, loads translated .md from docs/i18n/<locale>/docs/ (preserves existing translation pipeline) - Restore LanguageSelector in Fumadocs layout nav - Restore SEO metadata (title template, description, robots) * fix(codex): use allowlist to strip non-Responses-API fields in non-passthrough path (#2608) (#2615) Integrated into release/v3.8.3 — fix(codex): allowlist-based sanitization for gpt-5.5 Responses API * fix(deepseek-web): fix SSE parser, prompt format, error handling, and cache keys (#2616) Integrated into release/v3.8.3 — fix(deepseek-web): SSE parser (APPEND + bare tokens), prompt builder, error handling, session cache cleanup * chore(config): ignore additional agent workflow command files Add newly introduced agent workflow and Claude command files to .gitignore so proprietary automation assets are not committed. * feat(docs): migrate /docs to Fumadocs MDX with nested routes (#2614) Integrated into release/v3.8.3 — Fumadocs MDX migration with nested routes, search API, and 50+ URL redirects * fix(catalog): skip static PROVIDER_MODELS when synced models exist (#2625) Integrated into release/v3.8.3 * fix(qoder): Cosy auth fallback for PAT tokens + vision support for qwen3-vl-plus (#2629) Integrated into release/v3.8.3 * fix(cli): register tsx loader and add opencode config subcommand (#2631) Integrated into release/v3.8.3 * feat(dashboard): add search and filters to /dashboard/api-manager (#2628) Integrated into release/v3.8.3 * fix(claude): improve Pi and OpenCode compatibility (#2621) Integrated into release/v3.8.3 * fix: restore semantic passthrough system-role-only extraction instead of full normalization (#2620) Integrated into release/v3.8.3 * fix(kiro): stabilize conversationId across prompt compression (#2630) Integrated into release/v3.8.3 * fix(deepseek-web): SSE thinking/search routing and session lifecycle (#2624) Integrated into release/v3.8.3 — DeepSeek Web SSE thinking/search routing overhaul * feat(dashboard): free-tier grouping with symbolic link in /providers (#2632) Integrated into release/v3.8.3 * fix: close implementation gaps — t3-chat-web, stream_options, combo_strategy, batch config (#2634) Integrated into release/v3.8.3 * feat(dashboard): risk notice modal for sensitive providers (#2633) Integrated into release/v3.8.3 * fix(reasoning): extend reasoning_content injection to Kimi K2 and other replay models (#2639) Integrated into release/v3.8.3 * fix(cli): Linux autostart via systemd user service (fixes #2627) (#2635) Integrated into release/v3.8.3 * Refactor/providers free tier (#2640) Integrated into release/v3.8.3 * fix(tests): remove duplicate assertion in schema coercion & fix(cli): ignore system vars in env check * fix(combo): preserve omniModel tag in streaming output for round-trip context pinning (#2646) Integrated into release/v3.8.3 * feat(dashboard): media providers pages + Web Fetch category (#2645) Integrated into release/v3.8.3 * Feature provider adapta org com tutorial de conexão em modal (#2643) Integrated into release/v3.8.3 * fix(rtk): skip content-based filter matching for non-shell tool results (#2642) Integrated into release/v3.8.3 * fix(translator): enable Claude extended thinking for Copilot Responses-API requests (#2647) Integrated into release/v3.8.3 * feat(dashboard): add search and filters to /dashboard/api-manager (#2641) Integrated into release/v3.8.3 * feat(dashboard): risk notice modal for sensitive providers (#2638) Integrated into release/v3.8.3 * feat(dashboard): mini-playground inline (Phase 4) (#2648) Integrated into release/v3.8.3 * fix(settings): fix Require Login modal Cancel button text and dismissal (#2649) Integrated into release/v3.8.3 * feat(combos): universal context handoff for cross-model conversation continuity (#2653) Integrated into release/v3.8.3 * chore(release): bump to v3.8.3 — changelog, docs, version sync * feat(i18n): complete zh-CN translations for 1220 missing keys (#2655) Integrated into release/v3.8.3 * chore(release): include electron package changes in v3.8.3 * docs(changelog): integrate PR #2655 into v3.8.3 * feat(i18n): translate 377 additional zh-CN entries (81 new keys + 296 same-as-en) (#2659) Integrated into release/v3.8.3 * feat(dashboard): add Cmd+K / Ctrl+K command palette for sidebar navigation (#2656) Integrated into release/v3.8.3 * docs: update changelog for PR integrations under v3.8.3 * feat(cli): integrate native updates, autostart and headless CLI mode (#2662) Integrated into release/v3.8.3 * fix(proxy): save dashboard custom proxies in registry (#2661) Integrated into release/v3.8.3 * feat(dashboard): chat-first test slide-over (Option A) (#2660) Integrated into release/v3.8.3 * docs: update changelog with Batch 2 PR merges for v3.8.3 * fix: add xhigh+max to effortLevel schema; add opencode-plugin publish job (#2666) Integrated into release/v3.8.3 * docs: update changelog with Batch 3 PR #2666 merge for v3.8.3 * feat(quota+providers): card-grid layout, provider group headers, Codex race fix (#2667) Integrated into release/v3.8.3 * feat(dashboard): real-time live WebSocket monitoring (#2668) Integrated into release/v3.8.3 * feat(copilot): AI assistant with CodeGraph + CLI + knowledge base (#2669) Integrated into release/v3.8.3 * feat(pipeline): pre-request middleware hooks (#2670) Integrated into release/v3.8.3 * feat(resilience): credential health check + adaptive circuit breaker (#2671) Integrated into release/v3.8.3 * feat(playground): combo routing visual simulator (#2672) Integrated into release/v3.8.3 * feat(auth): API key groups with model-level permissions (#2673) Integrated into release/v3.8.3 * feat(pwa): enhanced manifest + push notification support (#2674) Integrated into release/v3.8.3 * feat(proxy): serverless relay endpoints with rate limiting (#2675) Integrated into release/v3.8.3 * docs(changelog): update changelog for PRs 2667-2675 & fix: resolve typescript compile-time errors * fix(db): remove transactions from migrations Remove explicit transaction wrappers from recent migrations and correct the API key groups migration metadata. Also fix codegraph path resolution for ESM environments and refresh generated fumadocs source output. --------- Co-authored-by: Ömer Vehbe <ovehbe@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Mr. Meowgi <mr@meowgi.dev> Co-authored-by: Hernan Javier Ardila Sanchez <hjasgr@gmail.com> Co-authored-by: amogus22877769 <y.lev357@gmail.com> Co-authored-by: Halil Tezcan KARABULUT <info@hlltzcnkb.com> Co-authored-by: Tentoxa <53821604+Tentoxa@users.noreply.github.com> Co-authored-by: HALDRO <121296348+HALDRO@users.noreply.github.com> Co-authored-by: Paijo <14921983+oyi77@users.noreply.github.com> Co-authored-by: janeza2 <49841619+janeza2@users.noreply.github.com> Co-authored-by: df4p <38404+df4p@users.noreply.github.com> Co-authored-by: ivan-mezentsev <ivan@mezentsev.me> Co-authored-by: Chewji <126886556+Chewji9875@users.noreply.github.com> Co-authored-by: L-aros <107354918+L-aros@users.noreply.github.com> Co-authored-by: M.M <mr.maatoug@gmail.com> Co-authored-by: Benson K B <bensonkbmca@gmail.com> Co-authored-by: terence71-glitch <mcdowellterence71@gmail.com>
* chore(config): ignore additional agent workflow command files Add newly introduced agent workflow and Claude command files to .gitignore so proprietary automation assets are not committed. * feat(deepseek-web): fix auth to use userToken + WASM PoW solver Rewrite deepseek-web executor from broken cookie auth to userToken Bearer flow (like Chat2API). Replace pure JS Keccak PoW with WASM solver (5.8s → 86ms). Add 14 models, validation, and dashboard UX. * fix(deepseek-web): update target_path to use challenge property * refactor(deepseek-web): streamline token handling and implement cache eviction * fix(deepseek-web): fix SSE parser, prompt format, and error handling - Handle all 3 DeepSeek SSE stream formats: initial fragments, APPEND operations, and bare string tokens (fixes truncated responses) - Simplify prompt builder to send system + last user message only (DeepSeek web API is single-turn, full history caused marker leakage) - Check json.code before token extraction (fixes "did not return access token: Authorization" on code 40003 with HTTP 200) - Clear session cache alongside token cache on auth errors - Add dev origin for remote testing Co-authored-by: Cursor <cursoragent@cursor.com> * chore: ignore memory-bank and cursor agent rules from tracking Co-authored-by: Cursor <cursoragent@cursor.com> * feat: enhance documentation and configuration for Fumadocs integration - Added Fumadocs MDX support in the Next.js configuration. - Updated transpile packages to include fumadocs-ui and fumadocs-core. - Implemented a comprehensive set of redirects for documentation paths to improve navigation. - Removed the generate-docs-index script as it is no longer needed. - Updated various documentation titles for consistency and clarity. - Enhanced global styles to incorporate Fumadocs UI themes and styles. * refactor(docs): cleanup fumadocs PR — revert deepseek, add i18n fallback, restore LanguageSelector - Revert unrelated deepseek-web.ts changes (should be separate PR) - Add .source/ to .gitignore (Fumadocs generated files) - Remove contributor IP from allowedDevOrigins - Add i18n runtime fallback: reads NEXT_LOCALE cookie, loads translated .md from docs/i18n/<locale>/docs/ (preserves existing translation pipeline) - Restore LanguageSelector in Fumadocs layout nav - Restore SEO metadata (title template, description, robots) * fix(codex): use allowlist to strip non-Responses-API fields in non-passthrough path (cheaper-inference#2608) (cheaper-inference#2615) Integrated into release/v3.8.3 — fix(codex): allowlist-based sanitization for gpt-5.5 Responses API * fix(deepseek-web): fix SSE parser, prompt format, error handling, and cache keys (cheaper-inference#2616) Integrated into release/v3.8.3 — fix(deepseek-web): SSE parser (APPEND + bare tokens), prompt builder, error handling, session cache cleanup * chore(config): ignore additional agent workflow command files Add newly introduced agent workflow and Claude command files to .gitignore so proprietary automation assets are not committed. * feat(docs): migrate /docs to Fumadocs MDX with nested routes (cheaper-inference#2614) Integrated into release/v3.8.3 — Fumadocs MDX migration with nested routes, search API, and 50+ URL redirects * fix(catalog): skip static PROVIDER_MODELS when synced models exist (cheaper-inference#2625) Integrated into release/v3.8.3 * fix(qoder): Cosy auth fallback for PAT tokens + vision support for qwen3-vl-plus (cheaper-inference#2629) Integrated into release/v3.8.3 * fix(cli): register tsx loader and add opencode config subcommand (cheaper-inference#2631) Integrated into release/v3.8.3 * feat(dashboard): add search and filters to /dashboard/api-manager (cheaper-inference#2628) Integrated into release/v3.8.3 * fix(claude): improve Pi and OpenCode compatibility (cheaper-inference#2621) Integrated into release/v3.8.3 * fix: restore semantic passthrough system-role-only extraction instead of full normalization (cheaper-inference#2620) Integrated into release/v3.8.3 * fix(kiro): stabilize conversationId across prompt compression (cheaper-inference#2630) Integrated into release/v3.8.3 * fix(deepseek-web): SSE thinking/search routing and session lifecycle (cheaper-inference#2624) Integrated into release/v3.8.3 — DeepSeek Web SSE thinking/search routing overhaul * feat(dashboard): free-tier grouping with symbolic link in /providers (cheaper-inference#2632) Integrated into release/v3.8.3 * fix: close implementation gaps — t3-chat-web, stream_options, combo_strategy, batch config (cheaper-inference#2634) Integrated into release/v3.8.3 * feat(dashboard): risk notice modal for sensitive providers (cheaper-inference#2633) Integrated into release/v3.8.3 * fix(reasoning): extend reasoning_content injection to Kimi K2 and other replay models (cheaper-inference#2639) Integrated into release/v3.8.3 * fix(cli): Linux autostart via systemd user service (fixes cheaper-inference#2627) (cheaper-inference#2635) Integrated into release/v3.8.3 * Refactor/providers free tier (cheaper-inference#2640) Integrated into release/v3.8.3 * fix(tests): remove duplicate assertion in schema coercion & fix(cli): ignore system vars in env check * fix(combo): preserve omniModel tag in streaming output for round-trip context pinning (cheaper-inference#2646) Integrated into release/v3.8.3 * feat(dashboard): media providers pages + Web Fetch category (cheaper-inference#2645) Integrated into release/v3.8.3 * Feature provider adapta org com tutorial de conexão em modal (cheaper-inference#2643) Integrated into release/v3.8.3 * fix(rtk): skip content-based filter matching for non-shell tool results (cheaper-inference#2642) Integrated into release/v3.8.3 * fix(translator): enable Claude extended thinking for Copilot Responses-API requests (cheaper-inference#2647) Integrated into release/v3.8.3 * feat(dashboard): add search and filters to /dashboard/api-manager (cheaper-inference#2641) Integrated into release/v3.8.3 * feat(dashboard): risk notice modal for sensitive providers (cheaper-inference#2638) Integrated into release/v3.8.3 * feat(dashboard): mini-playground inline (Phase 4) (cheaper-inference#2648) Integrated into release/v3.8.3 * fix(settings): fix Require Login modal Cancel button text and dismissal (cheaper-inference#2649) Integrated into release/v3.8.3 * feat(combos): universal context handoff for cross-model conversation continuity (cheaper-inference#2653) Integrated into release/v3.8.3 * chore(release): bump to v3.8.3 — changelog, docs, version sync * feat(i18n): complete zh-CN translations for 1220 missing keys (cheaper-inference#2655) Integrated into release/v3.8.3 * chore(release): include electron package changes in v3.8.3 * docs(changelog): integrate PR cheaper-inference#2655 into v3.8.3 * feat(i18n): translate 377 additional zh-CN entries (81 new keys + 296 same-as-en) (cheaper-inference#2659) Integrated into release/v3.8.3 * feat(dashboard): add Cmd+K / Ctrl+K command palette for sidebar navigation (cheaper-inference#2656) Integrated into release/v3.8.3 * docs: update changelog for PR integrations under v3.8.3 * feat(cli): integrate native updates, autostart and headless CLI mode (cheaper-inference#2662) Integrated into release/v3.8.3 * fix(proxy): save dashboard custom proxies in registry (cheaper-inference#2661) Integrated into release/v3.8.3 * feat(dashboard): chat-first test slide-over (Option A) (cheaper-inference#2660) Integrated into release/v3.8.3 * docs: update changelog with Batch 2 PR merges for v3.8.3 * fix: add xhigh+max to effortLevel schema; add opencode-plugin publish job (cheaper-inference#2666) Integrated into release/v3.8.3 * docs: update changelog with Batch 3 PR cheaper-inference#2666 merge for v3.8.3 * feat(quota+providers): card-grid layout, provider group headers, Codex race fix (cheaper-inference#2667) Integrated into release/v3.8.3 * feat(dashboard): real-time live WebSocket monitoring (cheaper-inference#2668) Integrated into release/v3.8.3 * feat(copilot): AI assistant with CodeGraph + CLI + knowledge base (cheaper-inference#2669) Integrated into release/v3.8.3 * feat(pipeline): pre-request middleware hooks (cheaper-inference#2670) Integrated into release/v3.8.3 * feat(resilience): credential health check + adaptive circuit breaker (cheaper-inference#2671) Integrated into release/v3.8.3 * feat(playground): combo routing visual simulator (cheaper-inference#2672) Integrated into release/v3.8.3 * feat(auth): API key groups with model-level permissions (cheaper-inference#2673) Integrated into release/v3.8.3 * feat(pwa): enhanced manifest + push notification support (cheaper-inference#2674) Integrated into release/v3.8.3 * feat(proxy): serverless relay endpoints with rate limiting (cheaper-inference#2675) Integrated into release/v3.8.3 * docs(changelog): update changelog for PRs 2667-2675 & fix: resolve typescript compile-time errors * fix(db): remove transactions from migrations Remove explicit transaction wrappers from recent migrations and correct the API key groups migration metadata. Also fix codegraph path resolution for ESM environments and refresh generated fumadocs source output. --------- Co-authored-by: Ömer Vehbe <ovehbe@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Mr. Meowgi <mr@meowgi.dev> Co-authored-by: Hernan Javier Ardila Sanchez <hjasgr@gmail.com> Co-authored-by: amogus22877769 <y.lev357@gmail.com> Co-authored-by: Halil Tezcan KARABULUT <info@hlltzcnkb.com> Co-authored-by: Tentoxa <53821604+Tentoxa@users.noreply.github.com> Co-authored-by: HALDRO <121296348+HALDRO@users.noreply.github.com> Co-authored-by: Paijo <14921983+oyi77@users.noreply.github.com> Co-authored-by: janeza2 <49841619+janeza2@users.noreply.github.com> Co-authored-by: df4p <38404+df4p@users.noreply.github.com> Co-authored-by: ivan-mezentsev <ivan@mezentsev.me> Co-authored-by: Chewji <126886556+Chewji9875@users.noreply.github.com> Co-authored-by: L-aros <107354918+L-aros@users.noreply.github.com> Co-authored-by: M.M <mr.maatoug@gmail.com> Co-authored-by: Benson K B <bensonkbmca@gmail.com> Co-authored-by: terence71-glitch <mcdowellterence71@gmail.com>
* chore(config): ignore additional agent workflow command files Add newly introduced agent workflow and Claude command files to .gitignore so proprietary automation assets are not committed. * feat(deepseek-web): fix auth to use userToken + WASM PoW solver Rewrite deepseek-web executor from broken cookie auth to userToken Bearer flow (like Chat2API). Replace pure JS Keccak PoW with WASM solver (5.8s → 86ms). Add 14 models, validation, and dashboard UX. * fix(deepseek-web): update target_path to use challenge property * refactor(deepseek-web): streamline token handling and implement cache eviction * fix(deepseek-web): fix SSE parser, prompt format, and error handling - Handle all 3 DeepSeek SSE stream formats: initial fragments, APPEND operations, and bare string tokens (fixes truncated responses) - Simplify prompt builder to send system + last user message only (DeepSeek web API is single-turn, full history caused marker leakage) - Check json.code before token extraction (fixes "did not return access token: Authorization" on code 40003 with HTTP 200) - Clear session cache alongside token cache on auth errors - Add dev origin for remote testing Co-authored-by: Cursor <cursoragent@cursor.com> * chore: ignore memory-bank and cursor agent rules from tracking Co-authored-by: Cursor <cursoragent@cursor.com> * feat: enhance documentation and configuration for Fumadocs integration - Added Fumadocs MDX support in the Next.js configuration. - Updated transpile packages to include fumadocs-ui and fumadocs-core. - Implemented a comprehensive set of redirects for documentation paths to improve navigation. - Removed the generate-docs-index script as it is no longer needed. - Updated various documentation titles for consistency and clarity. - Enhanced global styles to incorporate Fumadocs UI themes and styles. * refactor(docs): cleanup fumadocs PR — revert deepseek, add i18n fallback, restore LanguageSelector - Revert unrelated deepseek-web.ts changes (should be separate PR) - Add .source/ to .gitignore (Fumadocs generated files) - Remove contributor IP from allowedDevOrigins - Add i18n runtime fallback: reads NEXT_LOCALE cookie, loads translated .md from docs/i18n/<locale>/docs/ (preserves existing translation pipeline) - Restore LanguageSelector in Fumadocs layout nav - Restore SEO metadata (title template, description, robots) * fix(codex): use allowlist to strip non-Responses-API fields in non-passthrough path (cheaper-inference#2608) (cheaper-inference#2615) Integrated into release/v3.8.3 — fix(codex): allowlist-based sanitization for gpt-5.5 Responses API * fix(deepseek-web): fix SSE parser, prompt format, error handling, and cache keys (cheaper-inference#2616) Integrated into release/v3.8.3 — fix(deepseek-web): SSE parser (APPEND + bare tokens), prompt builder, error handling, session cache cleanup * chore(config): ignore additional agent workflow command files Add newly introduced agent workflow and Claude command files to .gitignore so proprietary automation assets are not committed. * feat(docs): migrate /docs to Fumadocs MDX with nested routes (cheaper-inference#2614) Integrated into release/v3.8.3 — Fumadocs MDX migration with nested routes, search API, and 50+ URL redirects * fix(catalog): skip static PROVIDER_MODELS when synced models exist (cheaper-inference#2625) Integrated into release/v3.8.3 * fix(qoder): Cosy auth fallback for PAT tokens + vision support for qwen3-vl-plus (cheaper-inference#2629) Integrated into release/v3.8.3 * fix(cli): register tsx loader and add opencode config subcommand (cheaper-inference#2631) Integrated into release/v3.8.3 * feat(dashboard): add search and filters to /dashboard/api-manager (cheaper-inference#2628) Integrated into release/v3.8.3 * fix(claude): improve Pi and OpenCode compatibility (cheaper-inference#2621) Integrated into release/v3.8.3 * fix: restore semantic passthrough system-role-only extraction instead of full normalization (cheaper-inference#2620) Integrated into release/v3.8.3 * fix(kiro): stabilize conversationId across prompt compression (cheaper-inference#2630) Integrated into release/v3.8.3 * fix(deepseek-web): SSE thinking/search routing and session lifecycle (cheaper-inference#2624) Integrated into release/v3.8.3 — DeepSeek Web SSE thinking/search routing overhaul * feat(dashboard): free-tier grouping with symbolic link in /providers (cheaper-inference#2632) Integrated into release/v3.8.3 * fix: close implementation gaps — t3-chat-web, stream_options, combo_strategy, batch config (cheaper-inference#2634) Integrated into release/v3.8.3 * feat(dashboard): risk notice modal for sensitive providers (cheaper-inference#2633) Integrated into release/v3.8.3 * fix(reasoning): extend reasoning_content injection to Kimi K2 and other replay models (cheaper-inference#2639) Integrated into release/v3.8.3 * fix(cli): Linux autostart via systemd user service (fixes cheaper-inference#2627) (cheaper-inference#2635) Integrated into release/v3.8.3 * Refactor/providers free tier (cheaper-inference#2640) Integrated into release/v3.8.3 * fix(tests): remove duplicate assertion in schema coercion & fix(cli): ignore system vars in env check * fix(combo): preserve omniModel tag in streaming output for round-trip context pinning (cheaper-inference#2646) Integrated into release/v3.8.3 * feat(dashboard): media providers pages + Web Fetch category (cheaper-inference#2645) Integrated into release/v3.8.3 * Feature provider adapta org com tutorial de conexão em modal (cheaper-inference#2643) Integrated into release/v3.8.3 * fix(rtk): skip content-based filter matching for non-shell tool results (cheaper-inference#2642) Integrated into release/v3.8.3 * fix(translator): enable Claude extended thinking for Copilot Responses-API requests (cheaper-inference#2647) Integrated into release/v3.8.3 * feat(dashboard): add search and filters to /dashboard/api-manager (cheaper-inference#2641) Integrated into release/v3.8.3 * feat(dashboard): risk notice modal for sensitive providers (cheaper-inference#2638) Integrated into release/v3.8.3 * feat(dashboard): mini-playground inline (Phase 4) (cheaper-inference#2648) Integrated into release/v3.8.3 * fix(settings): fix Require Login modal Cancel button text and dismissal (cheaper-inference#2649) Integrated into release/v3.8.3 * feat(combos): universal context handoff for cross-model conversation continuity (cheaper-inference#2653) Integrated into release/v3.8.3 * chore(release): bump to v3.8.3 — changelog, docs, version sync * feat(i18n): complete zh-CN translations for 1220 missing keys (cheaper-inference#2655) Integrated into release/v3.8.3 * chore(release): include electron package changes in v3.8.3 * docs(changelog): integrate PR cheaper-inference#2655 into v3.8.3 * feat(i18n): translate 377 additional zh-CN entries (81 new keys + 296 same-as-en) (cheaper-inference#2659) Integrated into release/v3.8.3 * feat(dashboard): add Cmd+K / Ctrl+K command palette for sidebar navigation (cheaper-inference#2656) Integrated into release/v3.8.3 * docs: update changelog for PR integrations under v3.8.3 * feat(cli): integrate native updates, autostart and headless CLI mode (cheaper-inference#2662) Integrated into release/v3.8.3 * fix(proxy): save dashboard custom proxies in registry (cheaper-inference#2661) Integrated into release/v3.8.3 * feat(dashboard): chat-first test slide-over (Option A) (cheaper-inference#2660) Integrated into release/v3.8.3 * docs: update changelog with Batch 2 PR merges for v3.8.3 * fix: add xhigh+max to effortLevel schema; add opencode-plugin publish job (cheaper-inference#2666) Integrated into release/v3.8.3 * docs: update changelog with Batch 3 PR cheaper-inference#2666 merge for v3.8.3 * feat(quota+providers): card-grid layout, provider group headers, Codex race fix (cheaper-inference#2667) Integrated into release/v3.8.3 * feat(dashboard): real-time live WebSocket monitoring (cheaper-inference#2668) Integrated into release/v3.8.3 * feat(copilot): AI assistant with CodeGraph + CLI + knowledge base (cheaper-inference#2669) Integrated into release/v3.8.3 * feat(pipeline): pre-request middleware hooks (cheaper-inference#2670) Integrated into release/v3.8.3 * feat(resilience): credential health check + adaptive circuit breaker (cheaper-inference#2671) Integrated into release/v3.8.3 * feat(playground): combo routing visual simulator (cheaper-inference#2672) Integrated into release/v3.8.3 * feat(auth): API key groups with model-level permissions (cheaper-inference#2673) Integrated into release/v3.8.3 * feat(pwa): enhanced manifest + push notification support (cheaper-inference#2674) Integrated into release/v3.8.3 * feat(proxy): serverless relay endpoints with rate limiting (cheaper-inference#2675) Integrated into release/v3.8.3 * docs(changelog): update changelog for PRs 2667-2675 & fix: resolve typescript compile-time errors * fix(db): remove transactions from migrations Remove explicit transaction wrappers from recent migrations and correct the API key groups migration metadata. Also fix codegraph path resolution for ESM environments and refresh generated fumadocs source output. --------- Co-authored-by: Ömer Vehbe <ovehbe@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Mr. Meowgi <mr@meowgi.dev> Co-authored-by: Hernan Javier Ardila Sanchez <hjasgr@gmail.com> Co-authored-by: amogus22877769 <y.lev357@gmail.com> Co-authored-by: Halil Tezcan KARABULUT <info@hlltzcnkb.com> Co-authored-by: Tentoxa <53821604+Tentoxa@users.noreply.github.com> Co-authored-by: HALDRO <121296348+HALDRO@users.noreply.github.com> Co-authored-by: Paijo <14921983+oyi77@users.noreply.github.com> Co-authored-by: janeza2 <49841619+janeza2@users.noreply.github.com> Co-authored-by: df4p <38404+df4p@users.noreply.github.com> Co-authored-by: ivan-mezentsev <ivan@mezentsev.me> Co-authored-by: Chewji <126886556+Chewji9875@users.noreply.github.com> Co-authored-by: L-aros <107354918+L-aros@users.noreply.github.com> Co-authored-by: M.M <mr.maatoug@gmail.com> Co-authored-by: Benson K B <bensonkbmca@gmail.com> Co-authored-by: terence71-glitch <mcdowellterence71@gmail.com>
…er replay models (cheaper-inference#2639) Integrated into release/v3.8.3
* chore(config): ignore additional agent workflow command files Add newly introduced agent workflow and Claude command files to .gitignore so proprietary automation assets are not committed. * feat(deepseek-web): fix auth to use userToken + WASM PoW solver Rewrite deepseek-web executor from broken cookie auth to userToken Bearer flow (like Chat2API). Replace pure JS Keccak PoW with WASM solver (5.8s → 86ms). Add 14 models, validation, and dashboard UX. * fix(deepseek-web): update target_path to use challenge property * refactor(deepseek-web): streamline token handling and implement cache eviction * fix(deepseek-web): fix SSE parser, prompt format, and error handling - Handle all 3 DeepSeek SSE stream formats: initial fragments, APPEND operations, and bare string tokens (fixes truncated responses) - Simplify prompt builder to send system + last user message only (DeepSeek web API is single-turn, full history caused marker leakage) - Check json.code before token extraction (fixes "did not return access token: Authorization" on code 40003 with HTTP 200) - Clear session cache alongside token cache on auth errors - Add dev origin for remote testing Co-authored-by: Cursor <cursoragent@cursor.com> * chore: ignore memory-bank and cursor agent rules from tracking Co-authored-by: Cursor <cursoragent@cursor.com> * feat: enhance documentation and configuration for Fumadocs integration - Added Fumadocs MDX support in the Next.js configuration. - Updated transpile packages to include fumadocs-ui and fumadocs-core. - Implemented a comprehensive set of redirects for documentation paths to improve navigation. - Removed the generate-docs-index script as it is no longer needed. - Updated various documentation titles for consistency and clarity. - Enhanced global styles to incorporate Fumadocs UI themes and styles. * refactor(docs): cleanup fumadocs PR — revert deepseek, add i18n fallback, restore LanguageSelector - Revert unrelated deepseek-web.ts changes (should be separate PR) - Add .source/ to .gitignore (Fumadocs generated files) - Remove contributor IP from allowedDevOrigins - Add i18n runtime fallback: reads NEXT_LOCALE cookie, loads translated .md from docs/i18n/<locale>/docs/ (preserves existing translation pipeline) - Restore LanguageSelector in Fumadocs layout nav - Restore SEO metadata (title template, description, robots) * fix(codex): use allowlist to strip non-Responses-API fields in non-passthrough path (cheaper-inference#2608) (cheaper-inference#2615) Integrated into release/v3.8.3 — fix(codex): allowlist-based sanitization for gpt-5.5 Responses API * fix(deepseek-web): fix SSE parser, prompt format, error handling, and cache keys (cheaper-inference#2616) Integrated into release/v3.8.3 — fix(deepseek-web): SSE parser (APPEND + bare tokens), prompt builder, error handling, session cache cleanup * chore(config): ignore additional agent workflow command files Add newly introduced agent workflow and Claude command files to .gitignore so proprietary automation assets are not committed. * feat(docs): migrate /docs to Fumadocs MDX with nested routes (cheaper-inference#2614) Integrated into release/v3.8.3 — Fumadocs MDX migration with nested routes, search API, and 50+ URL redirects * fix(catalog): skip static PROVIDER_MODELS when synced models exist (cheaper-inference#2625) Integrated into release/v3.8.3 * fix(qoder): Cosy auth fallback for PAT tokens + vision support for qwen3-vl-plus (cheaper-inference#2629) Integrated into release/v3.8.3 * fix(cli): register tsx loader and add opencode config subcommand (cheaper-inference#2631) Integrated into release/v3.8.3 * feat(dashboard): add search and filters to /dashboard/api-manager (cheaper-inference#2628) Integrated into release/v3.8.3 * fix(claude): improve Pi and OpenCode compatibility (cheaper-inference#2621) Integrated into release/v3.8.3 * fix: restore semantic passthrough system-role-only extraction instead of full normalization (cheaper-inference#2620) Integrated into release/v3.8.3 * fix(kiro): stabilize conversationId across prompt compression (cheaper-inference#2630) Integrated into release/v3.8.3 * fix(deepseek-web): SSE thinking/search routing and session lifecycle (cheaper-inference#2624) Integrated into release/v3.8.3 — DeepSeek Web SSE thinking/search routing overhaul * feat(dashboard): free-tier grouping with symbolic link in /providers (cheaper-inference#2632) Integrated into release/v3.8.3 * fix: close implementation gaps — t3-chat-web, stream_options, combo_strategy, batch config (cheaper-inference#2634) Integrated into release/v3.8.3 * feat(dashboard): risk notice modal for sensitive providers (cheaper-inference#2633) Integrated into release/v3.8.3 * fix(reasoning): extend reasoning_content injection to Kimi K2 and other replay models (cheaper-inference#2639) Integrated into release/v3.8.3 * fix(cli): Linux autostart via systemd user service (fixes cheaper-inference#2627) (cheaper-inference#2635) Integrated into release/v3.8.3 * Refactor/providers free tier (cheaper-inference#2640) Integrated into release/v3.8.3 * fix(tests): remove duplicate assertion in schema coercion & fix(cli): ignore system vars in env check * fix(combo): preserve omniModel tag in streaming output for round-trip context pinning (cheaper-inference#2646) Integrated into release/v3.8.3 * feat(dashboard): media providers pages + Web Fetch category (cheaper-inference#2645) Integrated into release/v3.8.3 * Feature provider adapta org com tutorial de conexão em modal (cheaper-inference#2643) Integrated into release/v3.8.3 * fix(rtk): skip content-based filter matching for non-shell tool results (cheaper-inference#2642) Integrated into release/v3.8.3 * fix(translator): enable Claude extended thinking for Copilot Responses-API requests (cheaper-inference#2647) Integrated into release/v3.8.3 * feat(dashboard): add search and filters to /dashboard/api-manager (cheaper-inference#2641) Integrated into release/v3.8.3 * feat(dashboard): risk notice modal for sensitive providers (cheaper-inference#2638) Integrated into release/v3.8.3 * feat(dashboard): mini-playground inline (Phase 4) (cheaper-inference#2648) Integrated into release/v3.8.3 * fix(settings): fix Require Login modal Cancel button text and dismissal (cheaper-inference#2649) Integrated into release/v3.8.3 * feat(combos): universal context handoff for cross-model conversation continuity (cheaper-inference#2653) Integrated into release/v3.8.3 * chore(release): bump to v3.8.3 — changelog, docs, version sync * feat(i18n): complete zh-CN translations for 1220 missing keys (cheaper-inference#2655) Integrated into release/v3.8.3 * chore(release): include electron package changes in v3.8.3 * docs(changelog): integrate PR cheaper-inference#2655 into v3.8.3 * feat(i18n): translate 377 additional zh-CN entries (81 new keys + 296 same-as-en) (cheaper-inference#2659) Integrated into release/v3.8.3 * feat(dashboard): add Cmd+K / Ctrl+K command palette for sidebar navigation (cheaper-inference#2656) Integrated into release/v3.8.3 * docs: update changelog for PR integrations under v3.8.3 * feat(cli): integrate native updates, autostart and headless CLI mode (cheaper-inference#2662) Integrated into release/v3.8.3 * fix(proxy): save dashboard custom proxies in registry (cheaper-inference#2661) Integrated into release/v3.8.3 * feat(dashboard): chat-first test slide-over (Option A) (cheaper-inference#2660) Integrated into release/v3.8.3 * docs: update changelog with Batch 2 PR merges for v3.8.3 * fix: add xhigh+max to effortLevel schema; add opencode-plugin publish job (cheaper-inference#2666) Integrated into release/v3.8.3 * docs: update changelog with Batch 3 PR cheaper-inference#2666 merge for v3.8.3 * feat(quota+providers): card-grid layout, provider group headers, Codex race fix (cheaper-inference#2667) Integrated into release/v3.8.3 * feat(dashboard): real-time live WebSocket monitoring (cheaper-inference#2668) Integrated into release/v3.8.3 * feat(copilot): AI assistant with CodeGraph + CLI + knowledge base (cheaper-inference#2669) Integrated into release/v3.8.3 * feat(pipeline): pre-request middleware hooks (cheaper-inference#2670) Integrated into release/v3.8.3 * feat(resilience): credential health check + adaptive circuit breaker (cheaper-inference#2671) Integrated into release/v3.8.3 * feat(playground): combo routing visual simulator (cheaper-inference#2672) Integrated into release/v3.8.3 * feat(auth): API key groups with model-level permissions (cheaper-inference#2673) Integrated into release/v3.8.3 * feat(pwa): enhanced manifest + push notification support (cheaper-inference#2674) Integrated into release/v3.8.3 * feat(proxy): serverless relay endpoints with rate limiting (cheaper-inference#2675) Integrated into release/v3.8.3 * docs(changelog): update changelog for PRs 2667-2675 & fix: resolve typescript compile-time errors * fix(db): remove transactions from migrations Remove explicit transaction wrappers from recent migrations and correct the API key groups migration metadata. Also fix codegraph path resolution for ESM environments and refresh generated fumadocs source output. --------- Co-authored-by: Ömer Vehbe <ovehbe@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Mr. Meowgi <mr@meowgi.dev> Co-authored-by: Hernan Javier Ardila Sanchez <hjasgr@gmail.com> Co-authored-by: amogus22877769 <y.lev357@gmail.com> Co-authored-by: Halil Tezcan KARABULUT <info@hlltzcnkb.com> Co-authored-by: Tentoxa <53821604+Tentoxa@users.noreply.github.com> Co-authored-by: HALDRO <121296348+HALDRO@users.noreply.github.com> Co-authored-by: Paijo <14921983+oyi77@users.noreply.github.com> Co-authored-by: janeza2 <49841619+janeza2@users.noreply.github.com> Co-authored-by: df4p <38404+df4p@users.noreply.github.com> Co-authored-by: ivan-mezentsev <ivan@mezentsev.me> Co-authored-by: Chewji <126886556+Chewji9875@users.noreply.github.com> Co-authored-by: L-aros <107354918+L-aros@users.noreply.github.com> Co-authored-by: M.M <mr.maatoug@gmail.com> Co-authored-by: Benson K B <bensonkbmca@gmail.com> Co-authored-by: terence71-glitch <mcdowellterence71@gmail.com>
Description
Fixes #2637
Kimi K2 models enter an infinite loop when using tool calls through OmniRoute because
injectEmptyReasoningContentForToolCallsonly handled DeepSeek V4 models, leaving Kimi K2 and other reasoning models withoutreasoning_contentwhentool_callswere present.Root Cause
The
injectEmptyReasoningContentForToolCallsfunction usedisDeepSeekReasoningModel()to decide whether to inject emptyreasoning_contentfor assistant messages withtool_calls. This only covered DeepSeek V4, but Kimi K2, Qwen-Thinking, GLM, and MiMo models also requirereasoning_contentto be passed back on subsequent turns.When these models don't receive their
reasoning_contentback, they attempt to regenerate the response, generating the sametool_callagain, causing an infinite loop.Changes
open-sse/translator/helpers/schemaCoercion.ts:isDeepSeekReasoningModel()withrequiresReasoningReplay()to cover all reasoning replay modelsREASONING_REPLAY_MODEL_PATTERNStests/unit/schema-coercion.test.ts:deepseek-v3) instead ofdeepseek-reasoner(which now correctly receives injection)Test Coverage
Tests verify that:
reasoning_content: ""reasoning_content: ""reasoning_content: ""reasoning_content: ""Related
docs/routing/REASONING_REPLAY.mdopen-sse/services/reasoningCache.ts(definesrequiresReasoningReplay())Checklist