Skip to content

fix(cli): keep Ollama tool calls when stream deltas omit id - #13235

Open
seethinajayadileep wants to merge 1 commit into
continuedev:mainfrom
seethinajayadileep:fix/ollama-toolcall-missing-id
Open

fix(cli): keep Ollama tool calls when stream deltas omit id#13235
seethinajayadileep wants to merge 1 commit into
continuedev:mainfrom
seethinajayadileep:fix/ollama-toolcall-missing-id

Conversation

@seethinajayadileep

Copy link
Copy Markdown

Fixes #13225

Summary

Some providers (notably Ollama with models like gpt-oss) send the first streaming tool_calls delta with an index but no id. processToolCallDelta() only created an index→id mapping when id was present, so the first delta was dropped and later argument fragments never accumulated. Tool args then appeared as plain assistant text and the tool never ran.

Change

When a delta has index but no id and no mapping yet, synthesize a stable call_<index> id and store it in indexToIdMap so subsequent fragments attach correctly. Real provider ids are still preferred when present.

Test plan

  • Unit tests for synthetic-id and real-id paths
  • CLI agent turn with Ollama tool use: tool calls with index-only first deltas execute

Some providers (notably Ollama) send the first tool_call delta with an
index but no id. processToolCallDelta previously dropped those deltas.
Synthesize a stable call_<index> id so argument fragments accumulate.

Fixes continuedev#13225

Signed-off-by: JAYA DILEEP <seethinajayadileep@hotmail.com>
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@seethinajayadileep
seethinajayadileep marked this pull request as ready for review September 6, 2026 05:37
@seethinajayadileep
seethinajayadileep requested a review from a team as a code owner September 6, 2026 05:37
@seethinajayadileep
seethinajayadileep requested review from sestinj and removed request for a team September 6, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ollama tool calls are dropped when streaming delta has no id

1 participant