Skip to content

fix(rag): allow agentic answers with retrieved evidence on 0.27.x - #20647

Merged
wangq8 merged 3 commits into
infiniflow:0.27.xfrom
ccclucky:fix/agentic-empty-response-0.27
Oct 20, 2026
Merged

wangq8 merged 3 commits into
infiniflow:0.27.xfrom
ccclucky:fix/agentic-empty-response-0.27

Conversation

@ccclucky

@ccclucky ccclucky commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Agentic chat can return the configured empty response even after retrieving supporting chunks. formalize_question initializes empty_result to True, so answer composition treats the result as empty when the successful research path does not reset that flag.

Initialize empty_result to False so retrieved evidence can reach answer generation. Existing no-chunks and abstention checks continue to select the empty response when appropriate.

Related to #19516. Related PR #19616 targeted main and was closed without merging; this is a focused fix for 0.27.x.

Validation

  • 16 regression cases passed, as reported by the contributor.
  • Tests exercise real graph initialization and answer composition across low, medium, high, and ultra modes: retrieved evidence, no evidence, abstention, and an unset empty response.
  • Fix commit: f4fb602b8c287e3fd20a6476855129b57e868177.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 66ca4bf5-090d-4180-ac8e-d048ea5be105

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0113aac5-7b1f-4a40-bf46-093606833ea3
📥 Commits

Reviewing files that changed from the base of the PR and between f4fb602 and 5bedecb.

📒 Files selected for processing (1)
  • test/unit_test/rag/advanced_rag/test_agentic_empty_response.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/unit_test/rag/advanced_rag/test_agentic_empty_response.py

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

The graph now initializes empty_result to false during question formalization. A parameterized test checks answer composition across four modes and response cases.

Changes: Agentic RAG empty-response handling

Layer / File(s) Summary
Initialize empty-result state and test composition
rag/advanced_rag/agentic_rag_graph.py, test/unit_test/rag/advanced_rag/test_agentic_empty_response.py
formalize_question initializes empty_result to false. A parameterized test checks model-call counts and queued output for evidence, no evidence, abstention, and an empty configured response across four modes.

Priority: ➖ Normal

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 5bede

No concrete issue remains that would prevent merging after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the focused RAG fix and the affected 0.27.x release line.
Description check Passed The description includes the required Summary section, explains the regression and fix, states expected behavior, and documents validation coverage.
Docstring Coverage Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files.
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.
  • 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 checked the answer queue,
With evidence, the model spoke.
With none, it stayed quiet,
Four modes passed beneath the moon.
The empty flag began anew.

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

@ccclucky

ccclucky commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ccclucky

ccclucky commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Caobaining1 Caobaining1 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 added the ci Continue Integration label Oct 20, 2026
@wangq8
wangq8 merged commit cf122f5 into infiniflow:0.27.x Oct 20, 2026
7 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