Skip to content

fix(cli): keep id-less Ollama tool-call deltas instead of dropping them - #13236

Open
bunnysayzz wants to merge 3 commits into
continuedev:mainfrom
bunnysayzz:fix/ollama-toolcall-no-id-13225
Open

fix(cli): keep id-less Ollama tool-call deltas instead of dropping them#13236
bunnysayzz wants to merge 3 commits into
continuedev:mainfrom
bunnysayzz:fix/ollama-toolcall-no-id-13225

Conversation

@bunnysayzz

Copy link
Copy Markdown

Ollama streams tool-call deltas with an index but no id, and processToolCallDelta() dropped them when no index-to-ID mapping existed yet — tool arguments surfaced as plain assistant text and the tool never ran.

Fix: when a delta carries an index with no mapped ID, generate a stable synthetic call_<index> ID and record the mapping, so the entry is created on the first delta and later fragments accumulate. Provider-supplied IDs and the drop path for deltas with neither id nor index are unchanged.

Tests: new streamChatResponse.helpers.test.ts, 4 cases (id-less creation, fragment accumulation with full JSON parse, provider-ID passthrough, neither-id-nor-index still dropped). The 2 id-less cases fail on old code, all 4 pass with the fix.

Fixes #13225

## Summary\n\nThe existing `isCriticalCommand` blocklist was incomplete, allowing dangerous commands to auto-execute in headless/auto mode.\n\n## Changes\n\n- **Added dangerous paths:** /home, /root, /Users/mdazharuddin, /Users/mdazharuddin to both the recursive-deletion path check and the explicit `rm` critical paths list\n- **Added find -delete:** Detects destructive find commands with -delete flag\n- **Added shred/wipefs:** File-shredding and filesystem-wiping commands now blocked\n- **Added pkexec:** Privilege escalation via PolicyKit now blocked\n- **Shell expansion:** Added /Users/mdazharuddin pattern to catch variable-expansion bypasses\n\nCloses continuedev#13001
…up failure

## Summary\n\nWhen extension activation fails (e.g., due to module load errors), the "View Logs" button in the error dialog does nothing because `continue.viewLogs` is registered inside the dynamically imported `activate.ts`. If the dynamic import fails, the command is never registered.\n\n## Fix\n\nRegistered `continue.viewLogs` directly in `extension.ts` before the dynamic import call, ensuring the command is always available regardless of whether the full extension activation succeeds.\n\nCloses continuedev#12946
@bunnysayzz
bunnysayzz requested a review from a team as a code owner September 6, 2026 05:37
@bunnysayzz
bunnysayzz 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