continue-custom/core
Joaquin Hui 3c12dab7aa
fix: Ollama MCP tool calling for Mistral and Gemma3 models (#11523)
* fix: Ollama MCP tool calling for Mistral and Gemma3 models (#9249)

Fix two issues with Ollama tool calling:

1. Mistral/Ministral: reorder messages so system messages never follow
   tool messages (causes "Unexpected role 'system' after role 'tool'")

2. Gemma3: strip unsupported fields (index, id, type) from tool_calls
   when converting assistant messages to Ollama format (causes "unknown
   variant 'index'")

Also forward assistant toolCalls to Ollama's tool_calls format for
proper multi-turn tool calling conversations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: resolve CI failures in prettier and jest module resolution

Remove .js extensions from jest.mock paths so the moduleNameMapper
resolves ollamaHelper and url modules correctly. Apply prettier
formatting to both changed files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove relative-path jest.mock calls that break ESM resolution

The jest ESM config resolves relative mock paths from the setup file
context, not the test file, causing 'Cannot find module' errors.
These mocks are unnecessary since the test bypasses the constructor
via Object.create() and only tests pure transformation methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: guard unprotected JSON.parse calls in Ollama.ts

Wrap JSON.parse of tool-call arguments in _convertToOllamaMessage and
pull-progress lines in installModel with try/catch to prevent unhandled
exceptions from aborting the request flow.

Addresses Cubic review feedback on PR #11523.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Joaquin Hui Gomez <joaquinhui1995@gmail.com>

* fix: add missing type cast through unknown for ToolCall arguments

TypeScript rejects a direct cast from string to JSONSchema7Object.
Cast through unknown first to satisfy the type checker.

Signed-off-by: Joaquin <joaquin@users.noreply.github.com>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: guard undefined arguments before JSONSchema7Object cast

---------

Signed-off-by: Joaquin Hui Gomez <joaquinhui1995@gmail.com>
Co-authored-by: Joaquin Hui Gomez <joaquinhui1995@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 13:49:32 -07:00
..
.vscode
__mocks__/@continuedev/fetch llm pre-fetch tests: nested dependency mocks for continue fetch 2025-06-06 17:39:28 -07:00
autocomplete Merge pull request #8367 from Ayyanaruto/f/optimize-autocompletelru-cache 2025-11-18 18:26:45 -08:00
codeRenderer feat: next edit char-level diff (#7776) 2025-09-19 00:25:33 -07:00
commands chore: mcp 1.24.0 (#8974) 2025-12-04 12:58:28 -08:00
config fix: use config.yaml name for default Local Config profile (#11110) 2026-03-24 13:37:52 -07:00
context fix: skip remote URIs when resolving MCP server cwd (#10844) 2026-03-20 17:12:29 -07:00
continueServer remove legacy config.js 2025-01-24 20:45:07 -08:00
control-plane feat: add Tensorix as an LLM provider (#11184) 2026-03-19 16:29:45 -07:00
data fix types 2025-08-13 22:12:33 -07:00
deploy clean up URLs 2024-10-15 12:00:05 -07:00
diff refactor: remove unused code 2025-07-28 17:10:45 -07:00
edit fix: preserve indentation when applying code edits to Python files (#11289) 2026-03-24 13:12:00 -07:00
indexing Test fix. 2025-12-11 03:16:59 +07:00
llm fix: Ollama MCP tool calling for Mistral and Gemma3 models (#11523) 2026-03-24 13:49:32 -07:00
nextEdit add current file path to prompt 2025-12-04 12:37:53 -08:00
promptFiles fix: show md rules and prompts in respective sections (#8178) 2025-10-27 15:25:03 -07:00
protocol feat: limited MCP App support (#10132) 2026-02-05 19:07:44 -08:00
tag-qry
test Fix: Refactor dependency injection for settings and clients 2025-09-03 09:15:47 -04:00
tools Fix system-message tools parser when tool call is non-terminal (#11092) 2026-03-24 11:56:43 -07:00
util Improve error handling UX and move stream retry to BaseLLM (#11773) 2026-03-24 12:40:19 -07:00
utils prettier and code cleanup 2025-07-13 14:47:54 -07:00
vendor Update Node.js LTS to v20.20.1 (#11506) 2026-03-24 11:36:07 -07:00
.eslintrc.json chore: ignore max-lines-per-function in tests (#6825) 2025-07-28 09:04:13 -07:00
.gitignore feat: implement Sentry error tracking with privacy-first anonymization (#6881) 2025-08-14 16:54:21 -07:00
.npmignore
core.ts fix: refresh all configs when creating a new assistant file (#11103) 2026-03-09 23:42:29 -07:00
index.d.ts fix: harden system message tools and wire toolOverrides to system message path (#10485) 2026-03-13 12:52:05 -07:00
jest.config.js Reapply "feat: enhance oneper utility and refactor build system for commit SHA versioning" (#6811) 2025-07-28 14:15:49 -07:00
package-lock.json Update Node.js LTS to v20.20.1 (#11506) 2026-03-24 11:36:07 -07:00
package.json Update Node.js LTS to v20.20.1 (#11506) 2026-03-24 11:36:07 -07:00
rules.md new rules 2025-06-20 16:06:03 -07:00
tsconfig.json feat: implement Sentry error tracking with privacy-first anonymization (#6881) 2025-08-14 16:54:21 -07:00
tsconfig.npm.json
vitest.config.ts test only .vitest.ts files 2025-06-17 10:28:02 +05:30