Compare commits

..

2 Commits

Author SHA1 Message Date
diegosouzapw 0517dcf0b7 chore: bump version to 1.7.10 and update CHANGELOG
Build Electron Desktop App / Validate version (push) Failing after 39s
Build Electron Desktop App / Build Electron (macos-arm64) (push) Has been skipped
Build Electron Desktop App / Build Electron (linux) (push) Has been skipped
Build Electron Desktop App / Build Electron (macos-intel) (push) Has been skipped
Build Electron Desktop App / Build Electron (windows) (push) Has been skipped
Build Electron Desktop App / Create Release (push) Has been skipped
2026-03-02 15:31:38 -03:00
diegosouzapw b7f0665ce9 fix: streaming tool calls missing id and wrong finish_reason in Responses→ChatCompletions translation (#180)
- Added tool_calls[].id and type:'function' to argument delta chunks
  so OpenAI-compatible clients can associate argument fragments with
  the correct tool call
- Changed finish_reason from hardcoded 'stop' to 'tool_calls' when
  tool calls were emitted (in flush, response.completed, and final chunk)
- Fixes state desync in agentic clients (OpenCode, Claude Code, etc.)
  where the assistant thinks tools already ran
2026-03-02 15:30:54 -03:00
4 changed files with 17 additions and 6 deletions
+6
View File
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---
## [1.7.10] — 2026-03-02
### 🐛 Bug Fixes
- **Streaming Tool Calls (Responses→ChatCompletions)** — Fixed two issues in the `openaiResponsesToOpenAIResponse` translator that broke tool call execution in agentic clients (OpenCode, Claude Code, Cursor, etc.): (1) Argument delta chunks now include `tool_calls[].id` and `type: "function"` so clients can associate argument fragments correctly. (2) `finish_reason` is now `"tool_calls"` instead of hardcoded `"stop"` when tool calls occurred. Fixes #180
## [1.7.9] — 2026-03-02
### 🐛 Bug Fixes
@@ -364,6 +364,7 @@ export function openaiResponsesToOpenAIResponse(chunk, state) {
// Flush: send final chunk with finish_reason
if (!state.finishReasonSent && state.started) {
state.finishReasonSent = true;
const hadToolCalls = (state.toolCallIndex || 0) > 0;
return {
id: state.chatId || `chatcmpl-${Date.now()}`,
object: "chat.completion.chunk",
@@ -373,7 +374,7 @@ export function openaiResponsesToOpenAIResponse(chunk, state) {
{
index: 0,
delta: {},
finish_reason: "stop",
finish_reason: hadToolCalls ? "tool_calls" : "stop",
},
],
};
@@ -468,6 +469,8 @@ export function openaiResponsesToOpenAIResponse(chunk, state) {
tool_calls: [
{
index: state.toolCallIndex,
id: state.currentToolCallId,
type: "function",
function: { arguments: argsDelta },
},
],
@@ -517,7 +520,9 @@ export function openaiResponsesToOpenAIResponse(chunk, state) {
if (!state.finishReasonSent) {
state.finishReasonSent = true;
state.finishReason = "stop"; // Mark for usage injection in stream.js
const hadToolCalls = (state.toolCallIndex || 0) > 0;
const reason = hadToolCalls ? "tool_calls" : "stop";
state.finishReason = reason; // Mark for usage injection in stream.js
const finalChunk: Record<string, any> = {
id: state.chatId,
@@ -528,7 +533,7 @@ export function openaiResponsesToOpenAIResponse(chunk, state) {
{
index: 0,
delta: {},
finish_reason: "stop",
finish_reason: reason,
},
],
};
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "omniroute",
"version": "1.7.9",
"version": "1.7.10",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "omniroute",
"version": "1.7.9",
"version": "1.7.10",
"hasInstallScript": true,
"license": "MIT",
"workspaces": [
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "omniroute",
"version": "1.7.9",
"version": "1.7.10",
"description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
"type": "module",
"bin": {