Skip to content

fix(agent): clamp dataset navigation max_docs to the default budget - #21755

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
flyingwhit:fix/dataset-navigation-max-docs
Nov 2, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
flyingwhit:fix/dataset-navigation-max-docs

Conversation

@flyingwhit

Copy link
Copy Markdown
Contributor

Fix

Clamp dataset navigation max_docs to the default budget so the model cannot raise it

@flyingwhit
flyingwhit requested a review from buua436 October 30, 2026 06:39
@flyingwhit flyingwhit added the ci Continue Integration label Oct 30, 2026
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

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: d314ae0a-e705-4d92-966d-2e86c6d04e50
Commits

Reviewing files that changed from the base of the PR and between c90fe46 and fe48a89.

Files selected for processing: 2
  • internal/agent/tool/dataset_navigation.go
  • internal/agent/tool/dataset_navigation_test.go

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

Walkthrough

InvokableRun now limits max_docs to the default maximum. A regression test checks that requests above the cap use the default and that smaller positive requests remain unchanged.

Changes: Dataset navigation document limit

Layer / File(s) Summary
Apply and test the document limit
internal/agent/tool/dataset_navigation.go, internal/agent/tool/dataset_navigation_test.go
InvokableRun caps max_docs at the default maximum. The regression test checks a request of 5000 and a request of 2.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: 🐞 bug, 🧪 test, go

Suggested reviewers: yuzhichang

Merge Risk: Minimal · up to fe48a

Requests cannot raise the document limit above the default. No merge-blocking risk remains established.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: clamping dataset navigation max_docs to the default budget.
Description check Passed The description clearly states the purpose of the change, but it uses a different heading and omits the requested background context from the Summary template.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

  • 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 document count,
And keeps requests within bounds.
Five thousand hops become the cap,
Two small hops stay on the map.
The tests confirm each measured leap.

Comment @coderabbitai help to get the list of available commands.

@buua436 buua436 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wangq8
wangq8 merged commit b6b4531 into infiniflow:main Nov 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants