Skip to content

Resolve saved Search App rerankers in the app tenant - #22937

Open
ZKunZhang wants to merge 1 commit into
infiniflow:mainfrom
ZKunZhang:fix/22308-search-rerank-tenant
Open

ZKunZhang wants to merge 1 commit into
infiniflow:mainfrom
ZKunZhang:fix/22308-search-rerank-tenant

Conversation

@ZKunZhang

Copy link
Copy Markdown
Contributor

Refs #22308. Split from #22935.

Changes

  • Resolve the saved Search App reranker in the app's tenant while preserving the authenticated caller and existing model permission checks.
  • Apply the same scope when Ask forwards the saved model and when retrieval retries a saved rerank group.
  • Keep the existing scope for explicit model overrides that differ from the saved selection.

Validation

  • Ran the dataset and chunk Go unit tests with CGO disabled.
  • Regression tests cover distinct app, dataset, and active tenants, saved and forwarded references, and rejected explicit overrides. They resolve the local model configuration without invoking a live rerank service.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

RetrievalTest and SearchDatasets now resolve saved rerankers using the tenant recorded in the saved search. Added integration tests cover reranker lookup, pagination errors, and search permissions.

Changes: Saved reranker resolution

Layer / File(s) Summary
Retrieval reranker lookup
internal/service/chunk/chunk.go, internal/service/chunk/retrieval_params_test.go
RetrievalTest uses the search tenant when the selected reranker matches the saved configuration. Tests check saved and explicitly supplied reranker behavior.
Dataset reranker lookup
internal/service/dataset/search.go, internal/service/dataset/search_test.go
SearchDatasets uses the saved search tenant for reranker lookup and rerank failover. Tests check pagination errors, saved-search permissions, and request-supplied reranker behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Possibly related PRs

  • infiniflow/ragflow#22935: This PR covers the same saved Search App reranker tenant resolution behavior, including Ask forwarding and rerank retry.

Suggested reviewers: buua436, qinling0210, lynn-inf

Merge Risk: Minimal · up to eb688

Saved Search App rerankers now resolve in the app's tenant while the authenticated caller and the existing model permission checks are preserved. No concrete defects were found in the changed code or its new regression tests, so the change looks ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: saved Search App rerankers are now resolved in the app's tenant. The raw summary and objectives confirm this change in chunk.go, search.go, and their tests. The title …
Description check Passed The description gives a summary of the change, the related issue (#22308), the split source (#22935), the scope of the change, and the validation steps. It does not follow the template's exact "Summar…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: saved Search App rerankers are now resolved in the app's tenant. The raw summary and objectives confirm this change in chunk.go, search.go, and their tests. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description gives a summary of the change, the related issue (#22308), the split source (#22935), the scope of the change, and the validation steps. It does not follow the template's exact "Summary" heading, but it covers the purpose and background that the template asks for. The missing heading is minor.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

A rabbit checks the saved search trail,
The rerank model follows the tenant’s tale.
Page two tests where results may go,
Access checks keep the boundaries so.
I nibble greens and hop away,
With saved rerankers set to stay.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c6c5d5c-9a8b-4305-8725-272617593891
Commits

Reviewing files that changed from the base of the PR and between 70ed4c9 and eb6880f.

Files selected for processing: 4

  • internal/service/chunk/chunk.go
  • internal/service/chunk/retrieval_params_test.go
  • internal/service/dataset/search.go
  • internal/service/dataset/search_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants