continuedev / continuedev/continue

Ollama tool calls are dropped when streaming delta has no id

Open
#13,225 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
36k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Before submitting your bug report
Relevant environment info
- OS: Windows 11
- Continue CLI: @continuedev/cli@1.5.47
- Model: gpt-oss:20b
- Provider: Ollama
- Model context: 65,536
- Agent capabilities: tool_use
Description

Continue CLI 1.5.47 drops Ollama streaming tool calls when the first tool-call delta contains an index but no id.

With gpt-oss:20b, Ollama returns valid structured tool_calls directly through its API. However, Continue's processToolCallDelta() drops the tool call when there is no id and no existing index-to-ID mapping.

The result is that tool arguments appear as plain assistant content:

{"filepath":"convex/schema.ts"}

The tool is never executed and the agent turn ends without a final response. Typing "continue" manually allows the agent to resume.

I verified the issue by patching processToolCallDelta() to generate a stable call_ ID when id is absent. This fixes the tool-call handling.

I verified the issue by patching processToolCallDelta() to generate a stable call_ ID when id is absent. This fixes the tool-call handling.

I found related Ollama/tool-calling issues, including #10711, but none describing this specific missing-ID/index-mapping failure.

To reproduce
  1. Configure Continue CLI 1.5.47 to use gpt-oss:20b through Ollama with tool use enabled.
  2. Start cn in a repository.
  3. Give the agent a task requiring multiple tool calls.
  4. After several successful tool calls, an Ollama tool-call delta is received with an index but no id.
  5. Continue drops the tool call.
  6. The tool arguments appear as plain assistant content, for example: {"filepath":"convex/schema.ts"}
  7. The agent stops without executing the tool.
  8. Entering "continue" allows the task to resume.

The same model was tested directly against the Ollama API with multiple sequential tool calls, and the API returned correctly structured tool_calls each time.

Log output
The Continue session successfully executed 13 tool calls before the failure.

The final assistant message contained:

{"filepath":"convex/schema.ts"}

but had no toolCalls or toolCallStates entry. Therefore Read(convex/schema.ts) was never dispatched.

The relevant Continue source is processToolCallDelta() in the CLI bundle:

if(e.id?(r=e.id,e.index!==void 0&&r&&n.set(e.index,r)):e.index!==void 0&&(r=n.get(e.index)),!r){
  xe.warn("Tool call delta without ID or valid index mapping",{toolCallDelta:e});
  return;
}

When the first Ollama delta has index but no id, n.get(e.index) returns undefined and the tool call is dropped.

A local patch that generates a stable call_<index> ID and stores it in the index-to-ID map fixes the issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with processToolCallDelta() in the Continue CLI bundle and trace how streaming deltas map indexes to tool-call IDs. Reproduce with Ollama and gpt-oss:20b using the steps in the issue, then verify that a delta with an index but no id is retained, its arguments are dispatched as a tool call, and the agent produces a final response.

Written by the indexing model from the issue text.

Assessment

Tech stack
ollama, typescript
Domain
ai, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
73/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.