Skip to content

Conversation

@continue
Copy link
Contributor

@continue continue bot commented Dec 21, 2025

Summary

This PR adds documentation for the message normalization feature introduced in PR #9253.

Changes

Troubleshooting Guide (docs/troubleshooting.mdx)

  • Added new section "Ollama model errors with MCP tool calling"
  • Documented Mistral/Ministral "Unexpected role 'system' after role 'tool'" error
  • Documented Gemma "Invalid 'tool_calls': unknown variant 'index'" error
  • Used Accordion components for better UX

Ollama Guide (docs/guides/ollama-guide.mdx)

  • Added info callout about automatic MCP tool calling compatibility
  • Added troubleshooting subsection for MCP tool calling errors
  • Added new section "Using Ollama with MCP Tools" with best practices
  • Updated recommended models list to include DeepSeek and Qwen for MCP support

Documentation Approach

  • Scoped to user-facing impact: Focused on what users need to know, not implementation details
  • Mintlify components: Used Accordion and Info components for better readability
  • Cross-references: Added links between troubleshooting and guide sections
  • No code changes: Only documentation updates as requested

Related


This agent session was co-authored by nate and Continue.


Summary by cubic

Adds troubleshooting guidance for Ollama MCP tool calling and updates the Ollama guide with MCP best practices. Also adds message normalization in the CLI to fix Mistral and Gemma tool-calling errors for more reliable MCP support.

  • Bug Fixes
    • Normalize messages per model: reorder late system messages for Mistral; remove the 'index' field from Gemma tool_calls.
    • Integrated in streamChatResponse via a new messageNormalizer utility before sending requests to Ollama.
    • No config needed; unaffected models pass through unchanged. Verified MCP tool calling with DeepSeek V3 and Qwen3.

Written for commit b73e94a. Summary will update automatically on new commits.

jackccrawford and others added 5 commits December 21, 2025 11:46
Fixes GitHub Issue #9249

Problem:
- Mistral Large 3, Ministral 3, Gemma3 27B fail during MCP tool calling
- Errors occur in Turn 2 when sending conversation + tool results back to model
- Mistral/Ministral: 'Unexpected role system after role tool'
- Gemma3: 'Invalid tool_calls: unknown variant index'

Solution:
- Created messageNormalizer.ts utility for model-specific message formatting
- Integrated into streamChatResponse.ts before Ollama API calls
- Mistral fix: Move system messages before tool interactions
- Gemma fix: Remove 'index' field from tool_calls structure

Testing:
- Build successful (13.66 MB bundle)
- No regression expected for 8 working models (Qwen3, Cogito, GLM, etc.)
- Ready for testing with affected models

Files:
- extensions/cli/src/util/messageNormalizer.ts (NEW)
- extensions/cli/src/stream/streamChatResponse.ts (MODIFIED)
- SHIP_IDE_MODIFICATIONS.md (NEW - tracks all fork changes)

This fix is generic and suitable for upstream PR contribution.
…ults

Testing Complete:
- All priority models working with MCP tools (DeepSeek V3.1, Qwen3 family, Cogito, GLM, Minimax, Kimi)
- Gemma3 confirmed as known limitation (index field added after normalization)
- Debug logging removed from messageNormalizer.ts
- Documentation updated with actual test results

Changes:
- extensions/cli/src/util/messageNormalizer.ts: Removed console.log debug statements
- SHIP_IDE_MODIFICATIONS.md: Added comprehensive test results section

Status:
- Message normalizer ready for Mistral/Gemma if needed in future
- All Ship-IDE priority models confirmed working
- GitHub issue #9249 documented with findings
Prepared comprehensive PR documentation for Continue.dev:
- Problem statement and solution overview
- Testing results with 8 working models
- Implementation details and integration point
- Backward compatibility notes
- Known limitation (Gemma3)

Ready to submit PR to continuedev/continue referencing issue #9249
Complete guide for submitting PR to Continue.dev:
- Step-by-step fork and push instructions
- PR template content ready in PR_DOCUMENTATION.md
- Testing evidence summary
- Post-PR merge actions
- CLA signing reminder

Status: Ready to create fork and submit PR to continuedev/continue
- Add troubleshooting section for Mistral/Gemma MCP tool calling errors
- Document automatic message normalization in Ollama guide
- Add guidance on choosing compatible models for MCP integration
- Include links to troubleshooting from Ollama guide

Related to PR #9253

Generated with Continue (https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Co-authored-by: nate <[email protected]>
@continue continue bot requested a review from a team as a code owner December 21, 2025 20:47
@continue continue bot requested review from Patrick-Erichsen and removed request for a team December 21, 2025 20:47
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 21, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

@continue
Copy link
Contributor Author

continue bot commented Dec 21, 2025

Reviewed the documentation changes in this PR. The documentation updates are comprehensive and appropriate:

Good use of Mintlify components:

  • Accordion components for organizing error-specific solutions
  • Info callout for automatic normalization feature
  • Warning callout for known limitations

Clear and concise:

  • Problem/Solution format for troubleshooting
  • Step-by-step guidance
  • Appropriate cross-references between docs

Maintains consistent documentation style:

  • Same level of detail as existing docs
  • Focused on user-facing information
  • No unnecessary technical implementation details

No additional documentation changes needed. The PR is ready from a documentation perspective.

@continue
Copy link
Contributor Author

continue bot commented Dec 21, 2025

Closing this PR in favor of a clean version that only contains documentation changes (no code from the feature branch). New PR coming shortly.

@continue continue bot closed this Dec 21, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Dec 21, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants