LocalAI/core/http/endpoints/openai
Ettore Di Giacinto e1a6010874
fix(streaming): deduplicate tool call emissions during streaming (#9292)
The Go-side incremental JSON parser was emitting the same tool call on
every streaming token because it lacked the len > lastEmittedCount guard
that the XML parser had. On top of that, the post-streaming default:
case re-emitted all tool calls from index 0, duplicating everything.

This produced duplicate delta.tool_calls events causing clients to
accumulate arguments as "{args}{args}" — invalid JSON.

Fixes:
- JSON incremental parser: add len(jsonResults) > lastEmittedCount guard
  and loop from lastEmittedCount (matching the XML parser pattern)
- Post-streaming default: case: skip i < lastEmittedCount entries that
  were already emitted during streaming
- JSON parser: use blocking channel send (matching XML parser behavior)
2026-04-10 00:44:25 +02:00
..
types
chat.go fix(streaming): deduplicate tool call emissions during streaming (#9292) 2026-04-10 00:44:25 +02:00
chat_test.go chore: refactor endpoints to use same inferencing path, add automatic retrial mechanism in case of errors (#9029) 2026-03-16 21:31:02 +01:00
completion.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
constants.go
edit.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
embeddings.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
image.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
image_test.go
inference.go fix: thinking models with tools returning empty content (reasoning-only retry loop) (#9290) 2026-04-09 18:30:31 +02:00
inference_test.go fix: thinking models with tools returning empty content (reasoning-only retry loop) (#9290) 2026-04-09 18:30:31 +02:00
inpainting.go
inpainting_test.go
list.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
openai_suite_test.go
realtime.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
realtime_model.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
realtime_transport.go
realtime_transport_webrtc.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
realtime_transport_ws.go
realtime_webrtc.go
transcription.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00