mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-20 06:02:14 +03:00
Closed #9183 in favor of this branch at the operator's request. Folds in the exact PR diff (verified byte-identical via `gh pr diff 9183`, applied cleanly with `git apply`): - Fixed output_index collisions between reasoning/message/tool-call items in Responses API streaming, which caused clients to ignore tool calls. - Fixed a race in chunk processing where tool calls and finish signals were lost when they arrived in the same chunk as reasoning/text content. - Enabled full processing of multi-choice chunks (previously truncated to a single choice). - Added reasoning_content capture/replay for DeepSeek-based models (big-pickle), keyed off the real position in the next turn's replayed messages array instead of a hardcoded index 0 — prevents history corruption that caused models to lose context and stop prematurely. - Added big-pickle to models recognized for native textual reasoning tags so <think> blocks convert to reasoning items correctly. - Improved Responses-to-Chat translation to group reasoning, content, and tool calls into a single assistant turn, as strict OpenAI-compatible upstreams require. - Added a descriptive placeholder for encrypted Responses API reasoning blocks so downgraded Chat API requests keep context. Test plan: - All 82 tests across reasoning-cache.test.ts, translator-helper-branches.test.ts, translator-request-openai-responses.test.ts, and the 3 new test files (responses-api-truncation.test.ts, responses-replay-fixes.test.ts, responses-request-translation.test.ts) pass - npm run typecheck:core — clean - npm run check:file-size — chatCore.ts (5024->5032) and translator/response/openai-responses.ts (1174->1180) rebaselined, both cohesive additions at the two reasoning-cache capture call sites and the turn-grouping fix; tests/unit/reasoning-cache.test.ts rebaselined at 1035 (crosses the 1000-line new-file test cap, entirely this fold's diff)