Skip to content

Fix: agent application can not show Cite#14047

Open
zpf121 wants to merge 1 commit intoinfiniflow:mainfrom
zpf121:fix_14018
Open

Fix: agent application can not show Cite#14047
zpf121 wants to merge 1 commit intoinfiniflow:mainfrom
zpf121:fix_14018

Conversation

@zpf121
Copy link
Copy Markdown
Contributor

@zpf121 zpf121 commented Apr 10, 2026

Close #14018

What problem does this PR solve?

Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

Problem

In Agent applications, even with the cite option enabled, only inline [ID: x] citation markers are visible (showing chunk content on hover). The Agent does not display the referenced file cards below the response, unlike Chat applications.

Root Cause

The Agent's Retrieval tool (agent/tools/retrieval.py) calls retriever.retrieval() with aggs=False, which means the retrieval results do not include doc_aggs (document aggregation) data. Without doc_aggs, the frontend ReferenceDocumentList component has no data to render the file cards.

In contrast, the Chat application (api/db/services/dialog_service.py) calls the same retriever.retrieval() method with aggs=True.

Fix

Changed aggs=False to aggs=True in agent/tools/retrieval.py so that document aggregation data is returned along with the retrieved chunks.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 10, 2026
@zpf121 zpf121 added the ci Continue Integration label Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

A single parameter modification in the retrieval tool that enables aggregations during metadata-filtered dataset searches. The aggs argument in settings.retriever.retrieval() changes from False to True, resulting in aggregation-related data being included in the retrieval output.

Changes

Cohort / File(s) Summary
Retrieval Aggregation Enhancement
agent/tools/retrieval.py
Modified _resolve_manual_filter function to request aggregations by changing the aggs parameter from False to True in the retrieval call, altering the output structure to include aggregation results.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A single tweak, a toggle flipped with care,
Aggregations bloom from data thin air,
No public walls were moved, just whispers inside,
The retrieval streams now richer, wider, and wide! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main issue: Agent applications cannot show citations, which matches the root cause and fix described in the PR.
Description check ✅ Passed The pull request description is comprehensive and well-structured, following the template with clear sections including problem statement, root cause analysis, and the specific fix applied.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@dosubot dosubot bot added the 🐞 bug Something isn't working, pull request that fix bug. label Apr 10, 2026
@zpf121 zpf121 marked this pull request as draft April 10, 2026 11:29
@zpf121 zpf121 added ci Continue Integration and removed ci Continue Integration labels Apr 10, 2026
@zpf121 zpf121 marked this pull request as ready for review April 10, 2026 11:29
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.66%. Comparing base (462be53) to head (cfecc6a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14047   +/-   ##
=======================================
  Coverage   96.66%   96.66%           
=======================================
  Files          10       10           
  Lines         690      690           
  Branches      108      108           
=======================================
  Hits          667      667           
  Misses          8        8           
  Partials       15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: agent application can not show Cite

1 participant