Repository navigation
fix(ollama): preserve multimodal images - #17663
Conversation
Co-Authored-By: Codex <[email protected]>
📝 WalkthroughWalkthroughOllama requests now map multimodal messages to combined text and image fields. Regular and streaming chat paths use the Ollama-specific builder. HTTP-server tests validate payload mapping and response handling. ChangesOllama multimodal chat
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ChatWithMessages
participant ChatStreamlyWithSender
participant buildOllamaRequestBody
participant OllamaHTTPServer
ChatWithMessages->>buildOllamaRequestBody: multimodal messages
ChatStreamlyWithSender->>buildOllamaRequestBody: multimodal messages
buildOllamaRequestBody->>OllamaHTTPServer: text and ordered images
OllamaHTTPServer-->>ChatWithMessages: chat response
OllamaHTTPServer-->>ChatStreamlyWithSender: streaming response
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/entity/models/ollama_test.go`:
- Around line 46-74: Keep test failures in the httptest handler goroutines by
replacing t.Fatalf with t.Errorf and returning after each failed precondition.
In assertOllamaMultimodalRequest, return after failed message or image structure
checks; in the synchronous handler at internal/entity/models/ollama_test.go
lines 81-83 and streaming handler at lines 109-111, log the decoding failure
with t.Errorf, send an error response, and return.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b5351df6-ecd0-4815-8d38-e9785bde30e7
📒 Files selected for processing (2)
internal/entity/models/ollama.gointernal/entity/models/ollama_test.go
|
Current head 8c23152 is mergeable. The earlier CodeRabbit finding was addressed on this exact head, the thread is resolved, and I do not see any remaining contributor-side follow-up. The visible current-head automation is the skipped sep-tests workflow plus a successful CodeRabbit pass, so this looks ready for maintainer review if that check state is expected for this path. |
|
The current-head |
Summary
Closes #17332
Verification
CGO_ENABLED=0 go test -count=1 ./internal/entity/modelsCGO_ENABLED=0 go vet ./internal/entity/modelsgit diff --checkThe repository
build.sh --testwrapper could not run locally because the requiredoffice_oxidenative library is not installed; it exits before compiling the package.