Repository navigation
Conversation
contentToText has no callers anywhere in the repository. Both ChatWithMessages and ChatStreamlyWithSender build their payload through the shared buildRequestBody -> buildChatMessages path, which passes Message.Content straight through, so the helper is never reached. staticcheck reports it as U1000; there is no Go linter wired into CI, which is why it went unnoticed. Verified: gofmt clean, go vet clean, go test ./internal/entity/models/ passes, and staticcheck -checks=U1000 on the package drops from 18 to 17 findings with the ollama.go entry gone. Co-Authored-By: Claude Opus 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe Ollama model implementation removes the private ChangesOllama content handling
Estimated code review effort: 1 (Trivial) | ~2 minutes 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 |
Second ragflow PR (#17639 merged 2026-07-31). Docstrings only, no behavior change. --- 🤖 Written with [Claude Code](https://claude.com/claude-code). Each site was opened and read, and each description was checked against the line that consumes the value. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Summary
contentToTextininternal/entity/models/ollama.gohas no callers anywhere in the repository. This PR deletes it.Both
OllamaModel.ChatWithMessagesandOllamaModel.ChatStreamlyWithSenderbuild their request payload through the sharedbuildRequestBody→buildChatMessagespath (internal/entity/models/base_model.go:324,:373), which copiesMessage.Contentstraight into the payload. Neither path reaches the helper.staticcheckflags it asU1000. There is no Go linter wired into CI, which is presumably why it went unnoticed.1 file, -20 lines. Pure deletion — no behavior change, no signature change, no test touched.
stringsis still used elsewhere in the file, so no import change either.How I verified it's dead
Only the declaration and its own doc comment. I also swept the package for unreferenced package-private functions with comments and string literals stripped first (so a name appearing only in prose doesn't count as a use), and cross-checked against
staticcheck; both agree.Verification
I re-ran the package tests with the parent version of the file checked back in (
git checkout 36ae39b -- internal/entity/models/ollama.go) and they pass identically, so theokabove isn't an artifact of the edit.One caveat about my local setup, stated plainly:
bash build.sh --test(the commandCLAUDE.mdprescribes) does not run on this machine — the native static libs it fetches ship asnative-linux-x86_64and I'm on darwin/arm64. I builtlibrag_tokenizer_c_api.afrominternal/binding/cpplocally and ran the one package directly instead.internal/entity/modelshas nooffice_oxide/pdfium/pdf_oxide/import "C"references, so I believe the direct package run is equivalent here, but CI is the authority on that, not me. For the same reason I did not try to produce a repo-wideU1000count — several packages don't compile locally without those libs, so any total I quoted would be wrong.Notes for the reviewer
Scope. There are 17 other
U1000findings in this same package: unused*ModelInfo/*ModelCatalogItemresponse types inavian.go,cometapi.go,futurmix.go,gpustack.go,groq.go,longcat.go,n1n.go,perplexity.go,ppio.go,togetherai.go,model.go, plus a test helper inmodel_test.go. I deliberately kept this PR to the single symbol rather than bundling them, because the response structs in particular may be intentional documentation of provider API shapes — that's your call, not mine. Happy to open follow-ups, or a wider sweep, if you'd like. Wiringgolangci-lint/staticcheckinto CI would stop this class from accumulating, if that's of interest.Relationship to #17332. I found this while looking into that issue, but this PR does not fix it and I'm not claiming it. #17332 reports that Ollama vision requests drop images and points at
contentToTextas the mechanism, citing it as "used at:98,:218". On currentmainthose two lines are thebuildRequestBodycall and the SSE-parsing loop respectively — not calls to the helper. My clone is shallow (2 commits), so I can't tell you when or in which commit the call sites went away, only that they aren't there now.That means the mechanism described in #17332 is stale, but the symptom may well be real:
buildChatMessagesemits onlyrole/content, so there is still no Ollama-nativeimagesfield on either path. I didn't want to bundle a speculative vision feature into a dead-code deletion, so #17332 deserves a separate look by someone who can test against a real multimodal Ollama model.I used an AI assistant (Claude Code) to help find and verify this change. I reviewed every line and ran the checks above myself.