Repository navigation
Go: add context to lots of interface - #17253
Conversation
Signed-off-by: Jin Hai <[email protected]>
📝 WalkthroughWalkthroughThis PR threads ChangesContext Propagation
Estimated code review effort: 4 (Complex) | ~75 minutes Sequence Diagram(s)sequenceDiagram
participant Handler
participant ChatPipelineService
participant ModelProviderService
participant ModelDriver
Handler->>ChatPipelineService: AsyncChat(ctx, ...)
ChatPipelineService->>ModelProviderService: Chat(ctx, ...)
ModelProviderService->>ModelDriver: ChatWithMessages(ctx, ...)
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 20
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (7)
internal/entity/models/gpustack.go (1)
55-110: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftPreserve the caller’s context on outbound requests.
ChatWithMessagesacceptsctxbut drops it by rooting new timeouts atcontext.Background()or by creating requests without a context, so cancellation and deadlines never reach the provider calls ininternal/entity/models/gpustack.go,internal/entity/models/groq.go,internal/entity/models/huaweicloud.go,internal/entity/models/huggingface.go,internal/entity/models/hunyuan.go,internal/entity/models/jiekouai.go, andinternal/entity/models/jina.go. Pass the incomingctxthroughcontext.WithTimeoutandhttp.NewRequestWithContextinstead.🤖 Prompt for 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. In `@internal/entity/models/gpustack.go` around lines 55 - 110, Preserve the caller’s context when creating outbound requests: in ChatWithMessages and the corresponding request flows in internal/entity/models/gpustack.go (55-110), internal/entity/models/groq.go (128-152), internal/entity/models/huaweicloud.go (177-216), internal/entity/models/huggingface.go (52-126), internal/entity/models/hunyuan.go (54-106), internal/entity/models/jiekouai.go (65-130), and internal/entity/models/jina.go (58-113), derive timeouts with context.WithTimeout(ctx, ...) rather than context.Background() and pass that derived context to http.NewRequestWithContext, ensuring caller cancellation and deadlines reach provider calls.internal/entity/models/astraflow.go (1)
71-123: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftPropagate the caller context into every outbound request.
The new
ctxcontract is currently signature-only: these paths derive contexts fromcontext.Background()or create requests withoutctx. Client disconnects and upstream cancellation therefore do not stop provider calls, streams, OCR polling, or result downloads.
internal/entity/models/astraflow.go#L71-L123: derive timeout contexts fromctx; usectxfor stream, embed, rerank, and TTS requests.internal/entity/models/avian.go#L117-L141: derive chat, stream, and list-model timeout contexts fromctx.internal/entity/models/baidu.go#L53-L152: derive chat, stream, embed, rerank, OCR, and list-model timeout contexts fromctx.internal/entity/models/bedrock.go#L508-L543: derive non-stream chat, list-model, and embed contexts fromctx, as the stream path already does.internal/entity/models/modelscope.go#L144-L169: derive non-stream and list contexts fromctx; make the stream idle-cancellation context a child ofctx.internal/entity/models/moonshot.go#L61-L149: derive all HTTP timeout contexts fromctx.internal/entity/models/openai.go#L61-L145: usectxfor chat, stream, embed, list, ASR, and TTS requests instead of background contexts.internal/entity/models/openrouter.go#L57-L124: derive all HTTP timeout contexts fromctx.internal/entity/models/orcarouter.go#L51-L112: derive chat, stream, TTS, and list-model timeout contexts fromctx.internal/entity/models/paddleocr.go#L119-L158: derive the OCR operation deadline fromctxso cancellation terminates polling and download requests.🤖 Prompt for 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. In `@internal/entity/models/astraflow.go` around lines 71 - 123, Propagate caller cancellation through all provider operations. In internal/entity/models/astraflow.go lines 71-123, update AstraflowModel.ChatWithMessages and its stream, embed, rerank, and TTS request paths to derive timeout contexts from ctx and attach ctx to requests. Apply the same context propagation in internal/entity/models/avian.go lines 117-141, baidu.go lines 53-152, bedrock.go lines 508-543, modelscope.go lines 144-169, moonshot.go lines 61-149, openai.go lines 61-145, openrouter.go lines 57-124, orcarouter.go lines 51-112, and paddleocr.go lines 119-158; preserve the existing timeout behavior while making the modelscope idle-cancellation context a child of ctx and ensuring OCR polling and downloads stop when ctx is canceled.internal/entity/models/stepfun.go (1)
56-109: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftPropagate the caller context into these HTTP requests. Using
context.Background()(or omitting a context) breaksModelDrivercancellation and deadlines, so canceled calls keep running until the provider timeout. Derive eachWithTimeout/NewRequestWithContextfromctxin these chat/stream/list/TTS paths.🤖 Prompt for 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. In `@internal/entity/models/stepfun.go` around lines 56 - 109, Propagate the caller’s ctx through every affected HTTP request instead of replacing it with context.Background(). Update the timeout and request construction in StepFunModel.ChatWithMessages, and apply the same change to the chat, stream, list, or TTS paths in internal/entity/models/togetherai.go (130-154), tokenhub.go (62-119), tokenpony.go (55-107), upstage.go (55-111), vllm.go (56-136), volcengine.go (76-186), voyage.go (66-102), and xai.go (66-125), deriving each WithTimeout/NewRequestWithContext from the incoming context while preserving the existing provider timeout behavior.Sources: Coding guidelines, Learnings
internal/service/graph/search_test.go (1)
347-360: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winUpdate the test call for the new
buildDenseExprsignature.
buildDenseExprnow requirescontext.Context, but Line 360 still calls it without that argument. Pass a test context such ascontext.Background()and importcontext; otherwise this test package will not compile.🤖 Prompt for 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. In `@internal/service/graph/search_test.go` around lines 347 - 360, Update TestBuildKGDenseExpr_WithModel’s buildDenseExpr call to pass context.Background() as the new context argument, and add the context import to the test file. Preserve the existing model, query, and limit arguments.internal/service/file/file_content.go (1)
225-237: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftPropagate parser cancellation instead of treating it as a successful fallback.
ParseWithResult(ctx, ...)can now returncontext.Canceledorcontext.DeadlineExceeded, butparseFileContentconverts every error to raw file content andGetFileContentsreturnsnilerror. A canceled request can therefore continue with unparsed content and appear successful. Propagate context errors throughparseFileContentandGetFileContents, while retaining the raw-content fallback only for non-context parse failures.🤖 Prompt for 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. In `@internal/service/file/file_content.go` around lines 225 - 237, Update parseFileContent and its GetFileContents call path to propagate context.Canceled and context.DeadlineExceeded from ParseWithResult instead of returning raw content. Preserve the raw-content fallback for non-context parser failures and ensure GetFileContents returns the propagated context error to the caller.internal/parser/parser/xlsx_parser.go (1)
94-103: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftForward
ctxinto the TCADP parser path.The new parameter is unused. In particular, the remote TCADP branch calls
parseSpreadsheetWithTCADPwithout context, so cancellation and deadlines stop atXLSXParser. Addctxto that helper and use it when creating its outbound request.🤖 Prompt for 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. In `@internal/parser/parser/xlsx_parser.go` around lines 94 - 103, Propagate ctx through the TCADP branch of XLSXParser.ParseWithResult into parseSpreadsheetWithTCADP, update that helper’s signature and all callers, and use the context when constructing the outbound TCADP request so cancellation and deadlines are honored.internal/parser/parser/csv_parser.go (1)
117-126: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftPropagate
ctxthrough the TCADP spreadsheet path. The helper currently hardcodescontext.Background()for both HTTP requests, so cancellations/timeouts from CSV/XLS/XLSX parsing never reach the remote TCADP calls.
internal/parser/parser/csv_parser.gointernal/parser/parser/xls_parser.gointernal/parser/parser/xlsx_parser.gointernal/parser/parser/xls_tcadp.go🤖 Prompt for 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. In `@internal/parser/parser/csv_parser.go` around lines 117 - 126, Propagate the caller’s ctx through the TCADP parsing flow: update ParseWithResult in internal/parser/parser/csv_parser.go and internal/parser/parser/xls_parser.go, the corresponding XLSX parser path in internal/parser/parser/xlsx_parser.go, and parseSpreadsheetWithTCADP in internal/parser/parser/xls_tcadp.go so both remote HTTP requests use the propagated context instead of context.Background().
🟡 Minor comments (1)
internal/entity/models/302ai.go-670-672 (1)
670-672: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRemove the stale TODO.
AudioSpeechintentionally remains unsupported; delete the deferred implementation note until the feature is actually added.As per coding guidelines, remove stale documentation and “move later” notes.
🤖 Prompt for 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. In `@internal/entity/models/302ai.go` around lines 670 - 672, Remove the stale TODO comment from the AI302Model.AudioSpeech method while preserving its current unsupported behavior and error return unchanged.Source: Coding guidelines
🧹 Nitpick comments (1)
internal/entity/models/llm.go (1)
136-150: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the obsolete Phase 0 context comment.
Generatenow callsChatWithMessageswithctx, but lines 136-138 still claim the method has no context and describe this as future work. Delete or rewrite that stale comment; retain the cancellation guard if needed.As per coding guidelines, remove stale documentation and migration-history comments.
🤖 Prompt for 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. In `@internal/entity/models/llm.go` around lines 136 - 150, Remove the obsolete Phase 0 migration-history comment above the ctx.Err() guard in Generate, since ChatWithMessages now receives ctx. Retain the cancellation guard and its behavior unchanged.Source: Coding guidelines
🤖 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/302ai_test.go`:
- Line 288: Complete the migration of tests in 302ai_test.go by adding the
leading ctx argument to every remaining ChatWithMessages,
ChatStreamlyWithSender, ListModels, and ShowTask call, matching the updated
method signatures while preserving all existing arguments and assertions.
In `@internal/entity/models/302ai.go`:
- Line 74: Preserve the public request context when constructing all provider
calls instead of replacing it with context.Background or omitting it. In
internal/entity/models/302ai.go:74-74, derive operation deadlines from ctx for
chat, streaming, embedding, reranking, ASR, OCR, parsing, model listing, and
task lookup; apply the same context propagation to chat, stream, embed, rerank,
and model-list requests in internal/entity/models/aliyun.go:56-56,
internal/entity/models/anthropic.go:64-64, and
internal/entity/models/qiniu.go:143-143; use http.NewRequestWithContext(ctx,
...) in Embed in internal/entity/models/builtin.go:60-60; pass ctx through all
request helpers and streaming paths in internal/entity/models/ragcon.go:130-130,
prediction creation, polling, and SSE reads in
internal/entity/models/replicate.go:328-328, and every outbound request in
internal/entity/models/siliconflow.go:70-70.
In `@internal/entity/models/azure_openai.go`:
- Line 64: Preserve the caller’s context across all listed outbound-request
methods: replace context.Background()-based context.WithTimeout/WithCancel calls
with the incoming ctx in internal/entity/models/azure_openai.go:64, 185, 316,
394; baichuan.go:52, 168, 293; paddleocr_local.go:101; perplexity.go:117, 184,
287, 353; ppio.go:115, 183, 282; xiaomi.go:56, 227, 398, 433, 644, 670;
xinference.go:146, 216, 345, 453, 544, 657, 733; xunfei.go:51, 183, 356; and
zhipu-ai.go:90, 250, 510, 586, 637, 713, 795, 927, 969, 1067. For Xinference and
Xiaomi ASR/TTS methods, also pass ctx to http.NewRequestWithContext so
cancellations and deadlines propagate.
In `@internal/entity/models/cohere.go`:
- Line 56: Propagate the supplied context through every outbound model request
instead of using context.Background(). In internal/entity/models/cohere.go:56,
derive existing chat, stream, embed, rerank, ASR, and ListModels timeouts from
ctx; in internal/entity/models/cometapi.go:238, use ctx for chat, stream, embed,
list, balance, ASR, and TTS; in internal/entity/models/deepinfra.go:58,
deepseek.go:55, fishaudio.go:74, and funasr.go:72, retain timeout limits with
context.WithTimeout(ctx, ...); in internal/entity/models/futurmix.go:149, pass
ctx to both request constructors; in internal/entity/models/gitee.go:58,
propagate ctx through requests and getParseFile polling; and in
internal/entity/models/google.go:299 and :353-359, derive the embed timeout from
ctx and call googleListModels(ctx, ...).
In `@internal/entity/models/cometapi_test.go`:
- Line 314: The CometAPI test still calls methods using removed signatures. In
internal/entity/models/cometapi_test.go lines 314-314, update the
ChatWithMessages, ChatStreamlyWithSender, and both Embed table callbacks to pass
ctx; also update the subsequent empty-model Embed call at lines 659-659 to pass
ctx.
In `@internal/entity/models/groq_test.go`:
- Line 381: Update the unsupported-method test calls for Rerank, Balance,
ParseFile, and ListTasks to use the ctx-first argument signature, matching the
existing Embed invocation. Preserve the current error assertions while passing
ctx as the first argument to each method.
In `@internal/entity/models/hunyuan_test.go`:
- Around line 472-475: Update the remaining Embed invocations in
hunyuan_test.go, including the calls around the empty-input and
required-model-name cases, to pass ctx as the first argument and shift the
existing arguments accordingly. Preserve each test’s current assertions and
inputs.
In `@internal/entity/models/jiekouai_test.go`:
- Line 317: Update the remaining calls in the test file to use the ctx-first
signatures: migrate Embed, Rerank, ChatWithMessages, ChatStreamlyWithSender, and
ListModels calls, including the shown newJieKouAIForTest invocation, by moving
the context argument to the required first position while preserving all other
arguments and assertions.
In `@internal/entity/models/lmstudio.go`:
- Line 56: Thread the caller context through every outbound request: in
internal/entity/models/lmstudio.go at lines 56, 207, 354, and 471; localai.go at
84, 198, 373, 475, and 556; longcat.go at 55, 170, and 312; mineru.go at 108 and
199; mineru_local.go at 101 and 194; minimax.go at 63, 227, 399, 476, and 566;
mistral.go at 58, 211, 346, 435, and 522; n1n.go at 162, 227, 325, 419, and 500;
novita.go at 191, 335, 496, 565, 669, and 759; nvidia.go at 54, 187, 327, 444,
and 567; and ollama.go at 76, 198, 333, and 462. Replace context.Background()
parents with the method ctx when creating deadlines, and replace any plain
http.NewRequest call with http.NewRequestWithContext using ctx, preserving each
request’s existing timeout and behavior.
In `@internal/entity/models/mistral_test.go`:
- Line 535: Update the second Embed invocation in the affected test to use the
current Embed signature, passing the required context and arguments consistently
with the preceding call. Ensure no remaining call in the test uses the removed
signature so the package compiles.
In `@internal/entity/models/modelscope_test.go`:
- Line 308: Update the test’s CheckConnection call to pass the existing ctx
argument alongside apiConfig, matching the current method signature. Locate the
call within the test around m.ListModels and preserve the rest of the test
behavior.
In `@internal/entity/models/perplexity_test.go`:
- Line 352: Complete the context-aware test-call migration: in
internal/entity/models/perplexity_test.go lines 341 and 352, pass ctx to the
Embed calls; in internal/entity/models/ppio_test.go lines 480-507, pass ctx to
all remaining unsupported-method calls in TestPPIOUnsupportedMethods; and in
internal/entity/models/xinference_test.go line 274, call x.CheckConnection with
ctx and apiConfig.
In `@internal/entity/models/sse_scanner_buffer_test.go`:
- Line 16: Update the ChatStreamlyWithSender test usage by importing the context
package and passing context.Background() (or an equivalent test context) as the
first argument before "test-model" at the call site around line 74, matching the
method signature.
In `@internal/entity/models/tokenhub_test.go`:
- Around line 283-286: Update the remaining Embed invocation in the tokenhub
test to pass ctx as the first argument, matching the current TokenHubModel.Embed
signature while preserving the existing error assertion.
In `@internal/ingestion/component/tokenizer.go`:
- Around line 489-490: Update the Encode call inside the runtime.WithTimeout
callback to pass timeoutCtx instead of the parent ctx, ensuring the embedder
request is cancelled when tokenizerTimeout expires.
In `@internal/parser/parser/parse_result.go`:
- Line 89: Complete the context-signature rollout for ParseWithResult by
updating every stale caller, including tests such as the 302ai model callers, to
pass a context.Context and adding the missing context import in
sse_scanner_buffer_test.go. Remove any resulting typecheck errors, then validate
the changes using the repository’s bash build.sh --test ... flow.
In `@internal/parser/parser/pdf_parser_docling.go`:
- Around line 39-42: Preserve the caller’s request context for outbound
PDF-service calls: in internal/parser/parser/pdf_parser_docling.go, update
parsePDFWithDocling’s models.PostJSONRequest call to use ctx instead of
context.Background(); likewise, in
internal/parser/parser/pdf_parser_opendataloader.go, update the HTTP request
creation to pass ctx to http.NewRequestWithContext. No direct change is needed
at the cited anchor lines beyond tracing these helpers to their request calls.
In `@internal/parser/parser/pdf_parser_mineru.go`:
- Around line 69-76: Update pollMinerUTask to stop immediately when the request
context is canceled: after ShowTask returns an error, check ctx.Err() and return
it instead of recording and retrying context errors. Replace the unconditional
polling sleep with a select between the timer and ctx.Done(), preserving the
existing timeout and retry behavior for non-context errors.
In `@internal/service/chunk/chunk.go`:
- Line 1248: Preserve request cancellation in downstream engine work: in
internal/service/chunk/chunk.go lines 1248-1248, update AddChunk to derive its
600-second insert timeout from ctx instead of context.Background(); in
internal/service/dataset/index.go lines 422-422, pass ctx to
sampleRandomChunksWithVectors and docEngine.GetChunk rather than replacing it
with a background context.
In `@internal/service/nlp/reranker.go`:
- Line 72: Update the call to RerankByModel in the reranking branch so it does
not pass nil alignment metadata; provide IDs and corresponding field data
derived from chunks, or revise RerankByModel to explicitly handle chunks-only
input while still producing scores. Preserve the existing reranking parameters
and ensure the docs list is populated before invoking the model.
---
Outside diff comments:
In `@internal/entity/models/astraflow.go`:
- Around line 71-123: Propagate caller cancellation through all provider
operations. In internal/entity/models/astraflow.go lines 71-123, update
AstraflowModel.ChatWithMessages and its stream, embed, rerank, and TTS request
paths to derive timeout contexts from ctx and attach ctx to requests. Apply the
same context propagation in internal/entity/models/avian.go lines 117-141,
baidu.go lines 53-152, bedrock.go lines 508-543, modelscope.go lines 144-169,
moonshot.go lines 61-149, openai.go lines 61-145, openrouter.go lines 57-124,
orcarouter.go lines 51-112, and paddleocr.go lines 119-158; preserve the
existing timeout behavior while making the modelscope idle-cancellation context
a child of ctx and ensuring OCR polling and downloads stop when ctx is canceled.
In `@internal/entity/models/gpustack.go`:
- Around line 55-110: Preserve the caller’s context when creating outbound
requests: in ChatWithMessages and the corresponding request flows in
internal/entity/models/gpustack.go (55-110), internal/entity/models/groq.go
(128-152), internal/entity/models/huaweicloud.go (177-216),
internal/entity/models/huggingface.go (52-126),
internal/entity/models/hunyuan.go (54-106), internal/entity/models/jiekouai.go
(65-130), and internal/entity/models/jina.go (58-113), derive timeouts with
context.WithTimeout(ctx, ...) rather than context.Background() and pass that
derived context to http.NewRequestWithContext, ensuring caller cancellation and
deadlines reach provider calls.
In `@internal/entity/models/stepfun.go`:
- Around line 56-109: Propagate the caller’s ctx through every affected HTTP
request instead of replacing it with context.Background(). Update the timeout
and request construction in StepFunModel.ChatWithMessages, and apply the same
change to the chat, stream, list, or TTS paths in
internal/entity/models/togetherai.go (130-154), tokenhub.go (62-119),
tokenpony.go (55-107), upstage.go (55-111), vllm.go (56-136), volcengine.go
(76-186), voyage.go (66-102), and xai.go (66-125), deriving each
WithTimeout/NewRequestWithContext from the incoming context while preserving the
existing provider timeout behavior.
In `@internal/parser/parser/csv_parser.go`:
- Around line 117-126: Propagate the caller’s ctx through the TCADP parsing
flow: update ParseWithResult in internal/parser/parser/csv_parser.go and
internal/parser/parser/xls_parser.go, the corresponding XLSX parser path in
internal/parser/parser/xlsx_parser.go, and parseSpreadsheetWithTCADP in
internal/parser/parser/xls_tcadp.go so both remote HTTP requests use the
propagated context instead of context.Background().
In `@internal/parser/parser/xlsx_parser.go`:
- Around line 94-103: Propagate ctx through the TCADP branch of
XLSXParser.ParseWithResult into parseSpreadsheetWithTCADP, update that helper’s
signature and all callers, and use the context when constructing the outbound
TCADP request so cancellation and deadlines are honored.
In `@internal/service/file/file_content.go`:
- Around line 225-237: Update parseFileContent and its GetFileContents call path
to propagate context.Canceled and context.DeadlineExceeded from ParseWithResult
instead of returning raw content. Preserve the raw-content fallback for
non-context parser failures and ensure GetFileContents returns the propagated
context error to the caller.
In `@internal/service/graph/search_test.go`:
- Around line 347-360: Update TestBuildKGDenseExpr_WithModel’s buildDenseExpr
call to pass context.Background() as the new context argument, and add the
context import to the test file. Preserve the existing model, query, and limit
arguments.
---
Minor comments:
In `@internal/entity/models/302ai.go`:
- Around line 670-672: Remove the stale TODO comment from the
AI302Model.AudioSpeech method while preserving its current unsupported behavior
and error return unchanged.
---
Nitpick comments:
In `@internal/entity/models/llm.go`:
- Around line 136-150: Remove the obsolete Phase 0 migration-history comment
above the ctx.Err() guard in Generate, since ChatWithMessages now receives ctx.
Retain the cancellation guard and its behavior unchanged.
🪄 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
Run ID: 999b3b33-2427-4eb5-9275-388c7b4880f8
📒 Files selected for processing (147)
internal/agent/audio/tts_dispatch.gointernal/entity/models/302ai.gointernal/entity/models/302ai_test.gointernal/entity/models/aliyun.gointernal/entity/models/anthropic.gointernal/entity/models/astraflow.gointernal/entity/models/astraflow_test.gointernal/entity/models/avian.gointernal/entity/models/azure_openai.gointernal/entity/models/baichuan.gointernal/entity/models/baidu.gointernal/entity/models/bedrock.gointernal/entity/models/bedrock_test.gointernal/entity/models/builtin.gointernal/entity/models/chat_tools.gointernal/entity/models/cohere.gointernal/entity/models/cometapi.gointernal/entity/models/cometapi_test.gointernal/entity/models/deepinfra.gointernal/entity/models/deepseek.gointernal/entity/models/dummy.gointernal/entity/models/fishaudio.gointernal/entity/models/funasr.gointernal/entity/models/futurmix.gointernal/entity/models/gitee.gointernal/entity/models/gitee_test.gointernal/entity/models/google.gointernal/entity/models/gpustack.gointernal/entity/models/groq.gointernal/entity/models/groq_test.gointernal/entity/models/huaweicloud.gointernal/entity/models/huggingface.gointernal/entity/models/hunyuan.gointernal/entity/models/hunyuan_test.gointernal/entity/models/jiekouai.gointernal/entity/models/jiekouai_test.gointernal/entity/models/jina.gointernal/entity/models/llm.gointernal/entity/models/lmstudio.gointernal/entity/models/localai.gointernal/entity/models/longcat.gointernal/entity/models/mineru.gointernal/entity/models/mineru_local.gointernal/entity/models/minimax.gointernal/entity/models/mistral.gointernal/entity/models/mistral_test.gointernal/entity/models/modelscope.gointernal/entity/models/modelscope_test.gointernal/entity/models/moonshot.gointernal/entity/models/n1n.gointernal/entity/models/novita.gointernal/entity/models/nvidia.gointernal/entity/models/ollama.gointernal/entity/models/openai.gointernal/entity/models/openrouter.gointernal/entity/models/orcarouter.gointernal/entity/models/paddleocr.gointernal/entity/models/paddleocr_local.gointernal/entity/models/perplexity.gointernal/entity/models/perplexity_test.gointernal/entity/models/ppio.gointernal/entity/models/ppio_test.gointernal/entity/models/qiniu.gointernal/entity/models/ragcon.gointernal/entity/models/replicate.gointernal/entity/models/siliconflow.gointernal/entity/models/sse_scanner_buffer_test.gointernal/entity/models/stepfun.gointernal/entity/models/togetherai.gointernal/entity/models/tokenhub.gointernal/entity/models/tokenhub_test.gointernal/entity/models/tokenpony.gointernal/entity/models/types.gointernal/entity/models/upstage.gointernal/entity/models/vllm.gointernal/entity/models/volcengine.gointernal/entity/models/voyage.gointernal/entity/models/voyage_test.gointernal/entity/models/xai.gointernal/entity/models/xiaomi.gointernal/entity/models/xinference.gointernal/entity/models/xinference_test.gointernal/entity/models/xunfei.gointernal/entity/models/zhipu-ai.gointernal/handler/chat_audio.gointernal/handler/chat_recommendation.gointernal/handler/chunk.gointernal/handler/dataset.gointernal/handler/providers.gointernal/handler/searchbot.gointernal/ingestion/component/docx_vision_dispatch.gointernal/ingestion/component/markdown_vision_dispatch.gointernal/ingestion/component/media_dispatch.gointernal/ingestion/component/parser.gointernal/ingestion/component/parser_dispatch.gointernal/ingestion/component/parser_dispatch_test.gointernal/ingestion/component/pdf_vision_dispatch.gointernal/ingestion/component/tokenizer.gointernal/ingestion/task/embedder.gointernal/ingestion/task/embedder_test.gointernal/parser/parser/audio_parser.gointernal/parser/parser/csv_parser.gointernal/parser/parser/doc_parser.gointernal/parser/parser/docx_parser.gointernal/parser/parser/email_parser.gointernal/parser/parser/epub_parser.gointernal/parser/parser/html_parser.gointernal/parser/parser/json_parser.gointernal/parser/parser/markdown_parser.gointernal/parser/parser/parse_result.gointernal/parser/parser/pdf_parser_cgo.gointernal/parser/parser/pdf_parser_docling.gointernal/parser/parser/pdf_parser_mineru.gointernal/parser/parser/pdf_parser_opendataloader.gointernal/parser/parser/pdf_parser_paddleocr.gointernal/parser/parser/picture_parser.gointernal/parser/parser/ppt_parser.gointernal/parser/parser/pptx_parser.gointernal/parser/parser/text_parser.gointernal/parser/parser/xls_parser.gointernal/parser/parser/xlsx_parser.gointernal/service/agent.gointernal/service/ask_service.gointernal/service/chat_pipeline.gointernal/service/chunk/chunk.gointernal/service/citation.gointernal/service/dataset/index.gointernal/service/dataset/utils.gointernal/service/deep_researcher.gointernal/service/file/file_content.gointernal/service/generator.gointernal/service/graph/pipeline.gointernal/service/graph/retrieval.gointernal/service/graph/search.gointernal/service/graph/search_test.gointernal/service/memory.gointernal/service/memory_message_service.gointernal/service/metadata_filter.gointernal/service/model_chat.gointernal/service/model_chat_test.gointernal/service/model_service.gointernal/service/nlp/reranker.gointernal/service/nlp/retrieval.gointernal/service/related_question.gointernal/service/skill_indexer.gointernal/service/skill_search.gointernal/service/toc_enhancer.go
| // contract. Every parser returned by GetParser must implement it. | ||
| type ParseResultProducer interface { | ||
| ParseWithResult(filename string, data []byte) ParseResult | ||
| ParseWithResult(ctx context.Context, filename string, data []byte) ParseResult |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift
Complete the context-signature rollout before merging.
The current typecheck still fails on stale callers such as internal/entity/models/302ai_test.go and a missing context import in internal/entity/models/sse_scanner_buffer_test.go. Update all affected callers/imports, then validate with the repository’s bash build.sh --test ... flow.
🤖 Prompt for 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.
In `@internal/parser/parser/parse_result.go` at line 89, Complete the
context-signature rollout for ParseWithResult by updating every stale caller,
including tests such as the 302ai model callers, to pass a context.Context and
adding the missing context import in sse_scanner_buffer_test.go. Remove any
resulting typecheck errors, then validate the changes using the repository’s
bash build.sh --test ... flow.
Sources: Coding guidelines, Linters/SAST tools
| func parsePDFWithDocling(ctx context.Context, filename string, data []byte, parser *PDFParser) ParseResult { | ||
| if len(data) == 0 { | ||
| return emptyPDFResult(filename) | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Do not discard request context before outbound PDF-service calls.
Both helpers accept ctx but replace it with context.Background() for the actual HTTP request, preventing cancellation and deadlines from propagating.
internal/parser/parser/pdf_parser_docling.go#L39-L42: passctxtomodels.PostJSONRequestat Line 91.internal/parser/parser/pdf_parser_opendataloader.go#L16-L16: passctxtohttp.NewRequestWithContextat Line 36.
📍 Affects 2 files
internal/parser/parser/pdf_parser_docling.go#L39-L42(this comment)internal/parser/parser/pdf_parser_opendataloader.go#L16-L16
🤖 Prompt for 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.
In `@internal/parser/parser/pdf_parser_docling.go` around lines 39 - 42, Preserve
the caller’s request context for outbound PDF-service calls: in
internal/parser/parser/pdf_parser_docling.go, update parsePDFWithDocling’s
models.PostJSONRequest call to use ctx instead of context.Background();
likewise, in internal/parser/parser/pdf_parser_opendataloader.go, update the
HTTP request creation to pass ctx to http.NewRequestWithContext. No direct
change is needed at the cited anchor lines beyond tracing these helpers to their
request calls.
| func pollMinerUTask(ctx context.Context, driver *models.MinerULocalModel, taskID string, apiConfig *models.APIConfig, timeout time.Duration) (string, error) { | ||
| if timeout <= 0 { | ||
| timeout = minerUPollTimeout | ||
| } | ||
| deadline := time.Now().Add(timeout) | ||
| var lastErr error | ||
| for { | ||
| task, err := driver.ShowTask(taskID, apiConfig) | ||
| task, err := driver.ShowTask(ctx, taskID, apiConfig) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Stop MinerU polling when the context is canceled.
When ShowTask returns a context error, the loop records it and retries; time.Sleep also ignores cancellation. A canceled request can therefore keep polling for up to 30 seconds. Return on ctx.Err() and use a select on ctx.Done() instead of unconditional sleep.
Proposed fix
for {
+ if err := ctx.Err(); err != nil {
+ return "", err
+ }
task, err := driver.ShowTask(ctx, taskID, apiConfig)
if err == nil {
...
} else {
+ if ctxErr := ctx.Err(); ctxErr != nil {
+ return "", ctxErr
+ }
lastErr = err
}
...
- time.Sleep(minerUPollInterval)
+ timer := time.NewTimer(minerUPollInterval)
+ select {
+ case <-ctx.Done():
+ timer.Stop()
+ return "", ctx.Err()
+ case <-timer.C:
+ }
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| func pollMinerUTask(ctx context.Context, driver *models.MinerULocalModel, taskID string, apiConfig *models.APIConfig, timeout time.Duration) (string, error) { | |
| if timeout <= 0 { | |
| timeout = minerUPollTimeout | |
| } | |
| deadline := time.Now().Add(timeout) | |
| var lastErr error | |
| for { | |
| task, err := driver.ShowTask(taskID, apiConfig) | |
| task, err := driver.ShowTask(ctx, taskID, apiConfig) | |
| func pollMinerUTask(ctx context.Context, driver *models.MinerULocalModel, taskID string, apiConfig *models.APIConfig, timeout time.Duration) (string, error) { | |
| if timeout <= 0 { | |
| timeout = minerUPollTimeout | |
| } | |
| deadline := time.Now().Add(timeout) | |
| var lastErr error | |
| for { | |
| if err := ctx.Err(); err != nil { | |
| return "", err | |
| } | |
| task, err := driver.ShowTask(ctx, taskID, apiConfig) | |
| if err == nil { | |
| ... | |
| } else { | |
| if ctxErr := ctx.Err(); ctxErr != nil { | |
| return "", ctxErr | |
| } | |
| lastErr = err | |
| } | |
| ... | |
| timer := time.NewTimer(minerUPollInterval) | |
| select { | |
| case <-ctx.Done(): | |
| timer.Stop() | |
| return "", ctx.Err() | |
| case <-timer.C: | |
| } | |
| } | |
| } |
🤖 Prompt for 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.
In `@internal/parser/parser/pdf_parser_mineru.go` around lines 69 - 76, Update
pollMinerUTask to stop immediately when the request context is canceled: after
ShowTask returns an error, check ctx.Err() and return it instead of recording
and retrying context errors. Replace the unconditional polling sleep with a
select between the timer and ctx.Done(), preserving the existing timeout and
retry behavior for non-context errors.
| } | ||
|
|
||
| func (s *ChunkService) AddChunk(req *service.AddChunkRequest, userID string) (*service.AddChunkResponse, error) { | ||
| func (s *ChunkService) AddChunk(ctx context.Context, req *service.AddChunkRequest, userID string) (*service.AddChunkResponse, error) { |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Request cancellation is still discarded in downstream engine work. Both methods accept a request context but replace it with context.Background() before expensive or persistent operations.
internal/service/chunk/chunk.go#L1248-L1248: derive the 600-second insert timeout fromctx, notcontext.Background().internal/service/dataset/index.go#L422-L422: passctxtosampleRandomChunksWithVectorsanddocEngine.GetChunk.
📍 Affects 2 files
internal/service/chunk/chunk.go#L1248-L1248(this comment)internal/service/dataset/index.go#L422-L422
🤖 Prompt for 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.
In `@internal/service/chunk/chunk.go` at line 1248, Preserve request cancellation
in downstream engine work: in internal/service/chunk/chunk.go lines 1248-1248,
update AddChunk to derive its 600-second insert timeout from ctx instead of
context.Background(); in internal/service/dataset/index.go lines 422-422, pass
ctx to sampleRandomChunksWithVectors and docEngine.GetChunk rather than
replacing it with a background context.
| // If reranker model is provided and there are results, use model reranking | ||
| if rerankModel != nil && total > 0 { | ||
| return RerankByModel(rerankModel, chunks, nil, nil, query, tkWeight, vtWeight, cfield, qb, rankFeature) | ||
| return RerankByModel(ctx, rerankModel, chunks, nil, nil, query, tkWeight, vtWeight, cfield, qb, rankFeature) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Do not invoke model reranking with empty alignment metadata.
RerankByModel builds docs by ranging over ids; passing nil, nil means it sends an empty document list and returns empty scores whenever this branch is used. Supply IDs/field data here, or make RerankByModel explicitly support chunks-only input.
🤖 Prompt for 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.
In `@internal/service/nlp/reranker.go` at line 72, Update the call to
RerankByModel in the reranking branch so it does not pass nil alignment
metadata; provide IDs and corresponding field data derived from chunks, or
revise RerankByModel to explicitly handle chunks-only input while still
producing scores. Preserve the existing reranking parameters and ensure the docs
list is populated before invoking the model.
Signed-off-by: Jin Hai <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
internal/service/user_beta_test.go (1)
37-135: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winComplete the model-test context migration before merge.
Static analysis reports
internal/entity/models/localai_test.gohas multiple undefinedctxreferences and an obsoleteBalancecall lacking its required context argument, sointernal/entity/modelstests do not compile. Fix those call sites and validate withbash build.sh --test internal/entity/models.🤖 Prompt for 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. In `@internal/service/user_beta_test.go` around lines 37 - 135, Complete the context migration in the LocalAI model tests by defining or passing the appropriate test context at every currently undefined ctx reference, and update the obsolete Balance call to supply its required context argument. Ensure all affected test call sites compile, then validate with the model test suite.Source: Linters/SAST tools
internal/entity/models/ppio_test.go (1)
480-507: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winFinish migrating the remaining unsupported-method calls.
Lines 486-507 still use pre-context signatures, so this test file cannot compile. Pass
ctxtoTranscribeAudio,TranscribeAudioWithSender,AudioSpeech,AudioSpeechWithSender,OCRFile, andShowTask.Proposed fix
- if _, err := m.TranscribeAudio(nil, nil, nil, nil, nil); err == nil { + if _, err := m.TranscribeAudio(ctx, nil, nil, nil, nil, nil); err == nil { // ... } - if err := m.TranscribeAudioWithSender(nil, nil, nil, nil, nil, nil); err == nil { + if err := m.TranscribeAudioWithSender(ctx, nil, nil, nil, nil, nil, nil); err == nil { // ... } - if _, err := m.AudioSpeech(nil, nil, nil, nil, nil); err == nil { + if _, err := m.AudioSpeech(ctx, nil, nil, nil, nil, nil); err == nil { // ... } - if err := m.AudioSpeechWithSender(nil, nil, nil, nil, nil, nil); err == nil { + if err := m.AudioSpeechWithSender(ctx, nil, nil, nil, nil, nil, nil); err == nil { // ... } - if _, err := m.OCRFile(nil, nil, nil, nil, nil, nil); err == nil { + if _, err := m.OCRFile(ctx, nil, nil, nil, nil, nil, nil); err == nil { // ... } - if _, err := m.ShowTask("", nil); err == nil { + if _, err := m.ShowTask(ctx, "", nil); err == nil { // ... }🤖 Prompt for 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. In `@internal/entity/models/ppio_test.go` around lines 480 - 507, Update the remaining unsupported-method calls in the test block to use the current context-aware signatures: pass ctx to TranscribeAudio, TranscribeAudioWithSender, AudioSpeech, AudioSpeechWithSender, OCRFile, and ShowTask. Preserve the existing error assertions and arguments while adding the context parameter in the correct position for each method.
♻️ Duplicate comments (1)
internal/entity/models/modelscope_test.go (1)
308-308: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winFinish the remaining context-signature migration in
internal/entity/models/modelscope_test.go. The sharedModelDrivercontract is ctx-first, but several calls still use the removed signatures, so the test package will not compile.
internal/entity/models/modelscope_test.go#L308-L308: changeCheckConnection(apiConfig)toCheckConnection(ctx, apiConfig).internal/entity/models/modelscope_test.go#L334-L343: update the followingTranscribeAudioWithSender,AudioSpeech,AudioSpeechWithSender, andOCRFilecalls to passctxfirst.🤖 Prompt for 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. In `@internal/entity/models/modelscope_test.go` at line 308, Complete the context-first signature migration in internal/entity/models/modelscope_test.go: update CheckConnection at lines 308-308 and the TranscribeAudioWithSender, AudioSpeech, AudioSpeechWithSender, and OCRFile calls at lines 334-343 to pass ctx as the first argument, preserving all other arguments and test behavior.
🧹 Nitpick comments (4)
internal/ingestion/component/parser_dispatch_pdf_vision_cgo_test.go (1)
38-38: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert that PDF-vision dispatch preserves the caller context.
Each mock accepts
ctxbut ignores it, so these tests still pass if dispatch drops or replaces the request context. Invoke the component with a sentinel context value and assert that each mock receives it.
internal/ingestion/component/parser_dispatch_pdf_vision_cgo_test.go#L38-L38: validate the context received by the fixture invoker.internal/ingestion/component/parser_dispatch_test.go#L433-L433: validate context propagation in the tenant-aware test.internal/ingestion/component/parser_dispatch_test.go#L511-L511: validate context propagation in the empty-page test.🤖 Prompt for 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. In `@internal/ingestion/component/parser_dispatch_pdf_vision_cgo_test.go` at line 38, Update the mock invokers in internal/ingestion/component/parser_dispatch_pdf_vision_cgo_test.go:38-38, internal/ingestion/component/parser_dispatch_test.go:433-433, and internal/ingestion/component/parser_dispatch_test.go:511-511 to assert that the received ctx matches a sentinel context supplied by each test; ensure the corresponding PDF-vision dispatch test setups invoke the component with that sentinel so context propagation is verified.internal/service/user.go (1)
635-635: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the unused
ctxparameter fromGetUserProfile.
This is a pure formatter overentity.User; dropctxfrom the service method and update the handler call sites accordingly.🤖 Prompt for 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. In `@internal/service/user.go` at line 635, Remove the unused ctx parameter from UserService.GetUserProfile, keeping it as a formatter over entity.User. Update all five call sites in internal/handler/user.go at lines 94, 175, 261, 385, and 727 to invoke the method with only the user argument.Source: Coding guidelines
internal/handler/searchbot.go (1)
382-384: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep the handler documentation runtime-focused.
Remove “matching Python’s AUTH_BETA flow”; describe the Go endpoint’s beta-token requirement directly.
🤖 Prompt for 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. In `@internal/handler/searchbot.go` around lines 382 - 384, Update the SearchBotDetail documentation comment to state directly that the endpoint requires a beta token, and remove the comparison to Python’s AUTH_BETA flow.Source: Coding guidelines
internal/service/citation_test.go (1)
248-260: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert context propagation in the driver fakes. Both fakes accept
ctxbut discard it, so replacing the forwarded context withcontext.Background()would still pass.
internal/service/citation_test.go#L248-L260: retain the received context or a sentinel value infakeEmbedder, then assertInsertCitationsforwarded it.internal/service/graph/retrieval_test.go#L327-L328: retain the received context inspyEmbedDriver.internal/service/graph/retrieval_test.go#L415-L426: assertbuildSearchExprsforwards the caller context toEmbed.🤖 Prompt for 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. In `@internal/service/citation_test.go` around lines 248 - 260, Update fakeEmbedder in internal/service/citation_test.go:248-260 and spyEmbedDriver in internal/service/graph/retrieval_test.go:327-328 to retain the received context, then add assertions that InsertCitations and buildSearchExprs, respectively, forward the caller’s context to Embed; ensure the tests fail if context.Background() is substituted.
🤖 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/agent/audio/tts_dispatch_test.go`:
- Line 54: Update the fake dispatcher in the test around its fn callback to
retain the received ctx instead of discarding it, then assert that the stored
context contains the expected sentinel value from the request context. Ensure
the test verifies context propagation through the dispatcher.
In `@internal/dao/user.go`:
- Around line 39-41: Propagate request contexts through the user DAO paths so
GORM honors cancellation and deadlines: update internal/dao/user.go lines 39-41
in UserDAO.GetByID to use DB.WithContext(ctx), and update the DAO calls used by
LoginByEmail, GetUserByToken, UpdateUserSettings, ChangePassword, SetTenantInfo,
GetUserByAPIToken, GetAPITokenByBeta, and GetUserByBetaAPIToken in
internal/service/user.go lines 392-417, 424-426, 589-609, 740-801, 808-826,
878-899, 1004-1029, 1048-1069, and 1081-1110 to pass their existing ctx through.
In `@internal/entity/models/localai_test.go`:
- Line 81: Complete the context-signature migration across all affected tests:
in internal/entity/models/localai_test.go:81-81, define and reuse t.Context() at
updated call sites and migrate the remaining Balance call at line 221; in
internal/entity/models/moonshot_test.go:296-296 and 369-369, pass ctx to the
remaining Balance calls at lines 326 and 447; in
internal/entity/models/xunfei_test.go:16-20, pass ctx to the audio, OCR,
parsing, balance, task-list, and task-status calls; and in
internal/entity/models/xunfei_test.go:50-50, keep CheckConnection ctx-first
while migrating the other legacy calls in that table.
In `@internal/entity/models/novita_test.go`:
- Line 452: Update the affected test call sites to match the context-aware APIs:
in internal/entity/models/novita_test.go:452 and
internal/entity/models/nvidia_rerank_test.go:137, prepend the missing ctx
argument; in internal/entity/models/ollama_test.go:43, ragcon_test.go:261,
tokenhub_test.go:137, vllm_rerank_test.go:136, volcengine_test.go:80,
voyage_test.go:88, xiaomi_test.go:148, and xinference_test.go:93, declare ctx
with t.Context() in each affected test and pass it to the calls. In
internal/entity/models/xinference_test.go:93, also update Balance to use the new
leading-context signature.
In `@internal/handler/auth.go`:
- Around line 41-44: The user-service methods GetUserByToken, GetUserByAPIToken,
GetUserByBetaAPIToken, and GetAPITokenByBeta currently discard request
cancellation; update their service and DAO query paths to execute with the
supplied ctx, such as via GORM WithContext(ctx), or remove ctx only if
cancellation cannot be supported. In internal/handler/auth.go lines 41-44, make
the resolver contract match the implementation; in internal/handler/searchbot.go
lines 393-394, retain the existing request-context call because the beta-token
lookup must consume it.
In `@internal/parser/parser/docx_parser_cgo_test.go`:
- Around line 12-16: Update the no-CGO office parser stubs, including DOCX
ParseWithResult and the sibling methods in office_parsers_no_cgo.go, to match
the context-aware shared parser signatures by accepting a context argument and
ignoring it where unused. Preserve their existing stub behavior and return
values.
In `@internal/parser/parser/ppt_parser_cgo_test.go`:
- Around line 29-32: Update the !cgo ParseWithResult methods on DOCXParser,
DOCParser, PPTParser, and PPTXParser in office_parsers_no_cgo.go to accept ctx,
filename, and data in the new order, matching ParseResultProducer while
preserving stub behavior. Update the !cgo tests, including the call in
office_parsers_nocgo_test.go, to pass the context as the first argument.
---
Outside diff comments:
In `@internal/entity/models/ppio_test.go`:
- Around line 480-507: Update the remaining unsupported-method calls in the test
block to use the current context-aware signatures: pass ctx to TranscribeAudio,
TranscribeAudioWithSender, AudioSpeech, AudioSpeechWithSender, OCRFile, and
ShowTask. Preserve the existing error assertions and arguments while adding the
context parameter in the correct position for each method.
In `@internal/service/user_beta_test.go`:
- Around line 37-135: Complete the context migration in the LocalAI model tests
by defining or passing the appropriate test context at every currently undefined
ctx reference, and update the obsolete Balance call to supply its required
context argument. Ensure all affected test call sites compile, then validate
with the model test suite.
---
Duplicate comments:
In `@internal/entity/models/modelscope_test.go`:
- Line 308: Complete the context-first signature migration in
internal/entity/models/modelscope_test.go: update CheckConnection at lines
308-308 and the TranscribeAudioWithSender, AudioSpeech, AudioSpeechWithSender,
and OCRFile calls at lines 334-343 to pass ctx as the first argument, preserving
all other arguments and test behavior.
---
Nitpick comments:
In `@internal/handler/searchbot.go`:
- Around line 382-384: Update the SearchBotDetail documentation comment to state
directly that the endpoint requires a beta token, and remove the comparison to
Python’s AUTH_BETA flow.
In `@internal/ingestion/component/parser_dispatch_pdf_vision_cgo_test.go`:
- Line 38: Update the mock invokers in
internal/ingestion/component/parser_dispatch_pdf_vision_cgo_test.go:38-38,
internal/ingestion/component/parser_dispatch_test.go:433-433, and
internal/ingestion/component/parser_dispatch_test.go:511-511 to assert that the
received ctx matches a sentinel context supplied by each test; ensure the
corresponding PDF-vision dispatch test setups invoke the component with that
sentinel so context propagation is verified.
In `@internal/service/citation_test.go`:
- Around line 248-260: Update fakeEmbedder in
internal/service/citation_test.go:248-260 and spyEmbedDriver in
internal/service/graph/retrieval_test.go:327-328 to retain the received context,
then add assertions that InsertCitations and buildSearchExprs, respectively,
forward the caller’s context to Embed; ensure the tests fail if
context.Background() is substituted.
In `@internal/service/user.go`:
- Line 635: Remove the unused ctx parameter from UserService.GetUserProfile,
keeping it as a formatter over entity.User. Update all five call sites in
internal/handler/user.go at lines 94, 175, 261, 385, and 727 to invoke the
method with only the user argument.
🪄 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
Run ID: b427339b-29c0-4d29-a89b-9146e7387692
📒 Files selected for processing (87)
internal/admin/handler.gointernal/agent/audio/tts_dispatch_test.gointernal/cli/user_command.gointernal/dao/user.gointernal/entity/models/302ai.gointernal/entity/models/302ai_test.gointernal/entity/models/aliyun_test.gointernal/entity/models/anthropic_test.gointernal/entity/models/astraflow_test.gointernal/entity/models/avian_test.gointernal/entity/models/bedrock_test.gointernal/entity/models/cometapi_test.gointernal/entity/models/deepinfra_test.gointernal/entity/models/deepseek_test.gointernal/entity/models/fishaudio_test.gointernal/entity/models/gitee_test.gointernal/entity/models/google_test.gointernal/entity/models/gpustack_test.gointernal/entity/models/groq_test.gointernal/entity/models/hunyuan_test.gointernal/entity/models/jiekouai_test.gointernal/entity/models/jina_test.gointernal/entity/models/llm_test.gointernal/entity/models/localai_test.gointernal/entity/models/longcat_test.gointernal/entity/models/minimax_test.gointernal/entity/models/mistral_test.gointernal/entity/models/modelscope_test.gointernal/entity/models/moonshot_test.gointernal/entity/models/novita_test.gointernal/entity/models/nvidia_rerank_test.gointernal/entity/models/ollama_test.gointernal/entity/models/perplexity_test.gointernal/entity/models/ppio_test.gointernal/entity/models/ragcon_test.gointernal/entity/models/replicate_test.gointernal/entity/models/sse_scanner_buffer_test.gointernal/entity/models/togetherai_test.gointernal/entity/models/tokenhub_test.gointernal/entity/models/tokenpony_test.gointernal/entity/models/upstage_test.gointernal/entity/models/vllm_rerank_test.gointernal/entity/models/volcengine_test.gointernal/entity/models/voyage_test.gointernal/entity/models/xai_test.gointernal/entity/models/xiaomi_test.gointernal/entity/models/xinference_test.gointernal/entity/models/xunfei_test.gointernal/handler/auth.gointernal/handler/bot_test.gointernal/handler/chunk_test.gointernal/handler/searchbot.gointernal/handler/searchbot_detail_test.gointernal/handler/user.gointernal/ingestion/component/parser_dispatch_pdf_vision_cgo_test.gointernal/ingestion/component/parser_dispatch_test.gointernal/ingestion/component/tokenizer_unit_test.gointernal/ingestion/pipeline/template_integration_test.gointernal/ingestion/task/embedder_test.gointernal/parser/parser/audio_parser_test.gointernal/parser/parser/docx_parser.gointernal/parser/parser/docx_parser_cgo_test.gointernal/parser/parser/email_parser_test.gointernal/parser/parser/markdown_parser_test.gointernal/parser/parser/parse_result_test.gointernal/parser/parser/parse_with_result_test.gointernal/parser/parser/pdf_parser_cgo_test.gointernal/parser/parser/pdf_parser_docling_test.gointernal/parser/parser/pdf_parser_fixture_cgo_test.gointernal/parser/parser/pdf_parser_mineru_test.gointernal/parser/parser/pdf_parser_opendataloader_test.gointernal/parser/parser/pdf_parser_paddleocr_test.gointernal/parser/parser/pdf_parser_somark_test.gointernal/parser/parser/pdf_parser_tcadp_test.gointernal/parser/parser/picture_parser_test.gointernal/parser/parser/ppt_parser_cgo_test.gointernal/parser/parser/xls_tcadp_test.gointernal/router/router.gointernal/service/chunk/chunk_test.gointernal/service/citation_test.gointernal/service/file/file_content_test.gointernal/service/file/file_test.gointernal/service/graph/retrieval_test.gointernal/service/graph/search_test.gointernal/service/memory.gointernal/service/user.gointernal/service/user_beta_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
- internal/service/memory.go
- internal/parser/parser/docx_parser.go
- internal/ingestion/task/embedder_test.go
- internal/service/graph/search_test.go
| } | ||
|
|
||
| func (f *fakeTTSDispatcher) AudioSpeech( | ||
| ctx context.Context, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert that the request context reaches the dispatcher.
The fake accepts ctx but discards it, so this test cannot detect broken context propagation. Store the context and assert a sentinel value from the context passed to fn.
🤖 Prompt for 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.
In `@internal/agent/audio/tts_dispatch_test.go` at line 54, Update the fake
dispatcher in the test around its fn callback to retain the received ctx instead
of discarding it, then assert that the stored context contains the expected
sentinel value from the request context. Ensure the test verifies context
propagation through the dispatcher.
| func (dao *UserDAO) GetByID(ctx context.Context, id uint) (*entity.User, error) { | ||
| var user entity.User | ||
| err := DB.First(&user, id).Error |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C2 'func \(.*UserDAO\) (GetByID|GetByEmail|GetByAccessToken|GetByTenantID|Update)' internal/dao
rg -n -C2 'func \(.*(APITokenDAO|TenantDAO)\)' internal/dao
rg -n -C2 'WithContext\(ctx\)' internal/dao internal/service
rg -n 'gorm.io/gorm' go.mod go.sumRepository: infiniflow/ragflow
Length of output: 15649
🏁 Script executed:
#!/bin/bash
set -euo pipefail
ast-grep outline internal/service/user.go --view expanded >/tmp/user_service_outline.txt
ast-grep outline internal/dao/user.go --view expanded >/tmp/user_dao_outline.txt
ast-grep outline internal/dao/api_token.go --view expanded >/tmp/api_token_dao_outline.txt
ast-grep outline internal/dao/tenant.go --view expanded >/tmp/tenant_dao_outline.txt
ast-grep outline internal/dao/user_tenant.go --view expanded >/tmp/user_tenant_dao_outline.txt
printf '\n== internal/service/user.go ==\n'
sed -n '1,220p' /tmp/user_service_outline.txt
printf '\n== internal/dao/user.go ==\n'
sed -n '1,220p' /tmp/user_dao_outline.txt
printf '\n== internal/dao/api_token.go ==\n'
sed -n '1,220p' /tmp/api_token_dao_outline.txt
printf '\n== internal/dao/tenant.go ==\n'
sed -n '1,220p' /tmp/tenant_dao_outline.txt
printf '\n== internal/dao/user_tenant.go ==\n'
sed -n '1,260p' /tmp/user_tenant_dao_outline.txtRepository: infiniflow/ragflow
Length of output: 14112
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the exact service methods and nearby DAO calls mentioned in the review note.
sed -n '360,450p' internal/service/user.go
printf '\n----\n'
sed -n '580,620p' internal/service/user.go
printf '\n----\n'
sed -n '730,835p' internal/service/user.go
printf '\n----\n'
sed -n '870,930p' internal/service/user.go
printf '\n----\n'
sed -n '998,1118p' internal/service/user.go
printf '\n----\n'
sed -n '1,130p' internal/dao/user.go
printf '\n----\n'
sed -n '1,110p' internal/dao/api_token.go
printf '\n----\n'
sed -n '1,130p' internal/dao/tenant.go
printf '\n----\n'
sed -n '55,95p' internal/dao/user_tenant.goRepository: infiniflow/ragflow
Length of output: 28153
Propagate ctx into the DAO layer
GetByID still drops its ctx, and the other request-scoped paths here still call context-less DAO reads/updates. Cancellation and deadlines never reach GORM.
internal/dao/user.go: useDB.WithContext(ctx)inGetByID.- Thread
ctxthrough the DAO calls inLoginByEmail,GetUserByToken,UpdateUserSettings,ChangePassword,SetTenantInfo,GetUserByAPIToken,GetAPITokenByBeta, andGetUserByBetaAPIToken.
📍 Affects 2 files
internal/dao/user.go#L39-L41(this comment)internal/service/user.go#L392-L417internal/service/user.go#L424-L426internal/service/user.go#L589-L609internal/service/user.go#L740-L801internal/service/user.go#L808-L826internal/service/user.go#L878-L899internal/service/user.go#L1004-L1029internal/service/user.go#L1048-L1069internal/service/user.go#L1081-L1110
🤖 Prompt for 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.
In `@internal/dao/user.go` around lines 39 - 41, Propagate request contexts
through the user DAO paths so GORM honors cancellation and deadlines: update
internal/dao/user.go lines 39-41 in UserDAO.GetByID to use DB.WithContext(ctx),
and update the DAO calls used by LoginByEmail, GetUserByToken,
UpdateUserSettings, ChangePassword, SetTenantInfo, GetUserByAPIToken,
GetAPITokenByBeta, and GetUserByBetaAPIToken in internal/service/user.go lines
392-417, 424-426, 589-609, 740-801, 808-826, 878-899, 1004-1029, 1048-1069, and
1081-1110 to pass their existing ctx through.
| GetUserByToken(ctx context.Context, authorization string) (*entity.User, common.ErrorCode, error) | ||
| GetUserByAPIToken(ctx context.Context, token string) (*entity.User, common.ErrorCode, error) | ||
| GetUserByBetaAPIToken(ctx context.Context, token string) (*entity.User, common.ErrorCode, error) | ||
| GetAPITokenByBeta(ctx context.Context, authorization string) (*entity.APIToken, error) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
The request context is discarded by the user-service layer. The supplied implementations of GetUserByToken, GetUserByAPIToken, GetUserByBetaAPIToken, and GetAPITokenByBeta accept ctx but never use it; their DAO queries therefore continue after client cancellation.
internal/handler/auth.go#L41-L44: make the resolver contract meaningful by updating the corresponding user-service/DAO queries to execute withctx(for example, GORMWithContext(ctx)), or remove context from methods that cannot honor cancellation.internal/handler/searchbot.go#L393-L394: retain this request-context call once the beta-token lookup path consumes it.
📍 Affects 2 files
internal/handler/auth.go#L41-L44(this comment)internal/handler/searchbot.go#L393-L394
🤖 Prompt for 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.
In `@internal/handler/auth.go` around lines 41 - 44, The user-service methods
GetUserByToken, GetUserByAPIToken, GetUserByBetaAPIToken, and GetAPITokenByBeta
currently discard request cancellation; update their service and DAO query paths
to execute with the supplied ctx, such as via GORM WithContext(ctx), or remove
ctx only if cancellation cannot be supported. In internal/handler/auth.go lines
41-44, make the resolver contract match the implementation; in
internal/handler/searchbot.go lines 393-394, retain the existing request-context
call because the beta-token lookup must consume it.
| ctx := t.Context() | ||
| p := NewDOCXParser() | ||
| p.outputFormat = "json" | ||
| data := minimalDOCX(t, "Hello from JSON path") | ||
| res := p.ParseWithResult("sample.docx", data) | ||
| res := p.ParseWithResult(ctx, "sample.docx", data) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Update the no-CGO DOCX stub to the context-aware signature.
internal/parser/parser/office_parsers_no_cgo.go still exposes ParseWithResult(filename string, _ []byte), while these tests now call ParseWithResult(ctx, filename, data). The non-CGO parser path will therefore fail to compile once the shared parser contract is context-aware. Update the DOCX stub, and the sibling office stubs, to accept and ignore ctx.
Also applies to: 37-48, 61-68, 81-84
🤖 Prompt for 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.
In `@internal/parser/parser/docx_parser_cgo_test.go` around lines 12 - 16, Update
the no-CGO office parser stubs, including DOCX ParseWithResult and the sibling
methods in office_parsers_no_cgo.go, to match the context-aware shared parser
signatures by accepting a context argument and ignoring it where unused.
Preserve their existing stub behavior and return values.
| ctx := t.Context() | ||
| p := NewPPTXParser() | ||
| data := buildPPTX(t, "Hello World") | ||
| res := p.ParseWithResult("test.pptx", data) | ||
| res := p.ParseWithResult(ctx, "test.pptx", data) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n -A2 'func \(p \*(DOCXParser|DOCParser|PPTParser|PPTXParser)\) ParseWithResult' internal/parser/parser/office_parsers_no_cgo.goRepository: infiniflow/ragflow
Length of output: 763
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== parser interface ==\n'
rg -n -A4 -B2 'type ParseResultProducer|ParseWithResult\(' internal/parser/parser | sed -n '1,220p'
printf '\n== no-cgo stubs ==\n'
cat -n internal/parser/parser/office_parsers_no_cgo.go | sed -n '1,220p'Repository: infiniflow/ragflow
Length of output: 19691
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== no-cgo test header and calls ==\n'
cat -n internal/parser/parser/office_parsers_nocgo_test.go | sed -n '1,120p'
printf '\n== interface declaration ==\n'
rg -n -A3 -B3 'type ParseResultProducer interface|ParseWithResult\(ctx context.Context' internal/parser/parser | sed -n '1,120p'Repository: infiniflow/ragflow
Length of output: 10573
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== parser factory and interface uses ==\n'
rg -n -A4 -B4 'GetParser|ParseResultProducer|NewDOCXParser\(|NewDOCParser\(|NewPPTParser\(|NewPPTXParser\(' internal/parser/parser | sed -n '1,260p'Repository: infiniflow/ragflow
Length of output: 18728
Update the !cgo office parser stubs and tests to the ctx-first signature.
internal/parser/parser/office_parsers_no_cgo.go still defines ParseWithResult(filename, []byte) on DOCXParser, DOCParser, PPTParser, and PPTXParser, while ParseResultProducer now requires ParseWithResult(ctx, filename, data). The !cgo test in internal/parser/parser/office_parsers_nocgo_test.go still calls the old form too. Bring both over to the new contract so !cgo builds keep compiling.
🤖 Prompt for 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.
In `@internal/parser/parser/ppt_parser_cgo_test.go` around lines 29 - 32, Update
the !cgo ParseWithResult methods on DOCXParser, DOCParser, PPTParser, and
PPTXParser in office_parsers_no_cgo.go to accept ctx, filename, and data in the
new order, matching ParseResultProducer while preserving stub behavior. Update
the !cgo tests, including the call in office_parsers_nocgo_test.go, to pass the
context as the first argument.
Signed-off-by: Jin Hai <[email protected]>
Signed-off-by: Jin Hai <[email protected]>
Signed-off-by: Jin Hai <[email protected]>
Signed-off-by: Jin Hai <[email protected]>
Signed-off-by: Jin Hai <[email protected]>
Signed-off-by: Jin Hai <[email protected]>
Signed-off-by: Jin Hai <[email protected]>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
internal/entity/models/togetherai.go (1)
441-517: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winAttach
ctxto the TogetherAI requests.
Rerank,TranscribeAudio,AudioSpeech, andAudioSpeechWithSenderacceptctxbut still build context-less requests, so caller cancellation and deadlines are ignored. Usehttp.NewRequestWithContext(ctx, ...)in each path.🤖 Prompt for 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. In `@internal/entity/models/togetherai.go` around lines 441 - 517, Update TogetherAIModel.Rerank, TranscribeAudio, AudioSpeech, and AudioSpeechWithSender in internal/entity/models/togetherai.go (Rerank lines 441-517; TranscribeAudio lines 519-624; AudioSpeech lines 630-688; AudioSpeechWithSender lines 690-774) to construct each HTTP request with http.NewRequestWithContext(ctx, ...), preserving the existing request behavior while ensuring caller cancellation and deadlines reach the TogetherAI API calls.Source: Coding guidelines
internal/entity/models/jina.go (1)
242-242: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winAttach
ctxto Jina rerank and model-list requests.These methods now accept
ctx, but their bodies were not changed to use it. Rerank andListModelstherefore continue after request cancellation;CheckConnectionforwardingctxcannot fix that downstream. Build their HTTP requests with the supplied context. Based on learnings, retain the existing client-level timeout rather than adding another overall request timeout.Also applies to: 320-320
🤖 Prompt for 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. In `@internal/entity/models/jina.go` at line 242, Update JinaModel.Rerank and the corresponding ListModels method to build their HTTP requests with the supplied ctx, ensuring cancellation propagates through rerank and model-list calls. Preserve the existing client-level timeout and do not add a separate request timeout; keep CheckConnection’s ctx forwarding unchanged.Source: Learnings
🤖 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.
Outside diff comments:
In `@internal/entity/models/jina.go`:
- Line 242: Update JinaModel.Rerank and the corresponding ListModels method to
build their HTTP requests with the supplied ctx, ensuring cancellation
propagates through rerank and model-list calls. Preserve the existing
client-level timeout and do not add a separate request timeout; keep
CheckConnection’s ctx forwarding unchanged.
In `@internal/entity/models/togetherai.go`:
- Around line 441-517: Update TogetherAIModel.Rerank, TranscribeAudio,
AudioSpeech, and AudioSpeechWithSender in internal/entity/models/togetherai.go
(Rerank lines 441-517; TranscribeAudio lines 519-624; AudioSpeech lines 630-688;
AudioSpeechWithSender lines 690-774) to construct each HTTP request with
http.NewRequestWithContext(ctx, ...), preserving the existing request behavior
while ensuring caller cancellation and deadlines reach the TogetherAI API calls.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bb931719-8d9f-4df8-a589-9bfa83e94c28
📒 Files selected for processing (98)
internal/entity/models/302ai.gointernal/entity/models/aliyun.gointernal/entity/models/anthropic.gointernal/entity/models/astraflow.gointernal/entity/models/avian.gointernal/entity/models/azure_openai.gointernal/entity/models/baichuan.gointernal/entity/models/baidu.gointernal/entity/models/bedrock.gointernal/entity/models/cohere.gointernal/entity/models/cometapi.gointernal/entity/models/deepinfra.gointernal/entity/models/deepseek.gointernal/entity/models/fishaudio.gointernal/entity/models/funasr.gointernal/entity/models/futurmix.gointernal/entity/models/gitee.gointernal/entity/models/google.gointernal/entity/models/gpustack.gointernal/entity/models/groq.gointernal/entity/models/huaweicloud.gointernal/entity/models/huggingface.gointernal/entity/models/hunyuan.gointernal/entity/models/jina.gointernal/entity/models/jina_test.gointernal/entity/models/lmstudio.gointernal/entity/models/localai.gointernal/entity/models/localai_test.gointernal/entity/models/longcat.gointernal/entity/models/longcat_test.gointernal/entity/models/mineru.gointernal/entity/models/mineru_local.gointernal/entity/models/minimax.gointernal/entity/models/minimax_test.gointernal/entity/models/mistral.gointernal/entity/models/mistral_test.gointernal/entity/models/modelscope.gointernal/entity/models/modelscope_test.gointernal/entity/models/moonshot.gointernal/entity/models/moonshot_test.gointernal/entity/models/n1n.gointernal/entity/models/novita.gointernal/entity/models/novita_test.gointernal/entity/models/nvidia.gointernal/entity/models/nvidia_rerank_test.gointernal/entity/models/ollama.gointernal/entity/models/ollama_test.gointernal/entity/models/openai.gointernal/entity/models/openai_test.gointernal/entity/models/openrouter.gointernal/entity/models/openrouter_test.gointernal/entity/models/orcarouter.gointernal/entity/models/paddleocr.gointernal/entity/models/paddleocr_local.gointernal/entity/models/perplexity.gointernal/entity/models/perplexity_test.gointernal/entity/models/ppio.gointernal/entity/models/ppio_test.gointernal/entity/models/qiniu.gointernal/entity/models/qiniu_test.gointernal/entity/models/ragcon.gointernal/entity/models/ragcon_test.gointernal/entity/models/reasoning_family_provider_test.gointernal/entity/models/replicate.gointernal/entity/models/replicate_test.gointernal/entity/models/siliconflow.gointernal/entity/models/siliconflow_test.gointernal/entity/models/stepfun.gointernal/entity/models/timeout_test.gointernal/entity/models/togetherai.gointernal/entity/models/togetherai_test.gointernal/entity/models/tokenhub.gointernal/entity/models/tokenhub_test.gointernal/entity/models/tokenpony.gointernal/entity/models/tokenpony_test.gointernal/entity/models/tool_call_test.gointernal/entity/models/upstage.gointernal/entity/models/upstage_test.gointernal/entity/models/vllm.gointernal/entity/models/vllm_rerank_test.gointernal/entity/models/volcengine.gointernal/entity/models/volcengine_test.gointernal/entity/models/voyage.gointernal/entity/models/voyage_test.gointernal/entity/models/xai.gointernal/entity/models/xai_test.gointernal/entity/models/xiaomi.gointernal/entity/models/xiaomi_test.gointernal/entity/models/xinference.gointernal/entity/models/xinference_test.gointernal/entity/models/xunfei.gointernal/entity/models/xunfei_test.gointernal/entity/models/zhipu-ai.gointernal/entity/models/zhipu-ai_test.gointernal/entity/models/zhipu_ai_test.gointernal/parser/parser/xlsx_parse_method_test.gointernal/service/agent.gointernal/service/memory.go
🚧 Files skipped from review as they are similar to previous changes (32)
- internal/service/agent.go
- internal/entity/models/ollama_test.go
- internal/entity/models/vllm_rerank_test.go
- internal/entity/models/futurmix.go
- internal/entity/models/modelscope_test.go
- internal/entity/models/gpustack.go
- internal/entity/models/deepseek.go
- internal/entity/models/fishaudio.go
- internal/entity/models/avian.go
- internal/entity/models/xai_test.go
- internal/entity/models/paddleocr.go
- internal/entity/models/jina_test.go
- internal/entity/models/baichuan.go
- internal/entity/models/mineru_local.go
- internal/service/memory.go
- internal/entity/models/anthropic.go
- internal/entity/models/google.go
- internal/entity/models/moonshot.go
- internal/entity/models/voyage_test.go
- internal/entity/models/hunyuan.go
- internal/entity/models/modelscope.go
- internal/entity/models/xinference.go
- internal/entity/models/upstage_test.go
- internal/entity/models/ppio.go
- internal/entity/models/replicate.go
- internal/entity/models/localai_test.go
- internal/entity/models/bedrock.go
- internal/entity/models/cohere.go
- internal/entity/models/xiaomi.go
- internal/entity/models/longcat_test.go
- internal/entity/models/mistral_test.go
- internal/entity/models/xinference_test.go
No description provided.