fix(ai-ollama): forward systemPrompts to Ollama API#389
fix(ai-ollama): forward systemPrompts to Ollama API#389Spiralis wants to merge 1 commit intoTanStack:mainfrom
Conversation
The `mapCommonOptionsToOllama()` method was silently dropping the `systemPrompts` field from chat options. System prompts passed via `chat({ systemPrompts: [...] })` now correctly reach the Ollama API as the `system` parameter on the chat request. This is how other adapters (e.g. Anthropic) handle it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Ollama adapter's Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
There was a problem hiding this comment.
Pull request overview
This PR fixes the @tanstack/ai-ollama adapter so systemPrompts provided via core chat options are forwarded to Ollama’s Chat API as the system field, matching behavior of other adapters and resolving #388.
Changes:
- Forward
options.systemPromptsto OllamaChatRequest.system(joined with\n) inmapCommonOptionsToOllama().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #388
The
mapCommonOptionsToOllama()method was silently dropping thesystemPromptsfield from chat options. System prompts passed viachat({ systemPrompts: [...] })now correctly reach the Ollama API as thesystemparameter on the chat request. This is how other adapters (e.g. Anthropic) handle it.🎯 Changes
Forward
systemPromptsas thesystemfield on the OllamaChatRequestinmapCommonOptionsToOllama().✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit