Repository navigation
Conversation
📝 WalkthroughWalkthroughReasoning modes now expose web search when local evidence is absent, fall back from empty hybrid retrieval, merge web evidence into the knowledge base, and cache equivalent requests. Tests cover enabled, disabled, failure, fallback, deduplication, and multi-claim scenarios. ChangesWeb reasoning support
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ReasoningOrchestrator
participant Pipeline
participant hybrid_search
participant web_search
participant KnowledgeBase
ReasoningOrchestrator->>Pipeline: execute hybrid_search
Pipeline->>hybrid_search: retrieve local chunks
hybrid_search-->>Pipeline: empty or non-empty result
alt local result is empty and web search is available
ReasoningOrchestrator->>Pipeline: execute web_search
Pipeline->>web_search: retrieve external evidence
web_search-->>Pipeline: web chunks
end
Pipeline-->>ReasoningOrchestrator: search result
ReasoningOrchestrator->>KnowledgeBase: merge deduplicated chunks
KnowledgeBase-->>ReasoningOrchestrator: evidence IDs
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/unit_test/rag/advanced_rag/harness/test_web_only_reasoning.py (1)
6-41: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winIsolate the import stubs.
Lines 6-41 leave synthetic parent modules in
sys.modules. Later tests can import the fakerag.advanced_ragpackage and skip the real package initializer.Move this bootstrap into an isolated fixture. Restore every module entry that the fixture adds after the module tests finish.
🤖 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 `@test/unit_test/rag/advanced_rag/harness/test_web_only_reasoning.py` around lines 6 - 41, Move the synthetic module setup currently at module scope into an autouse fixture for the tests in this module, preserving the existing stubs for rag.advanced_rag and infinity.rag_tokenizer. Track each sys.modules entry added or replaced by the fixture and restore its prior value, or remove it when absent, during fixture teardown so later tests can import the real package initializer.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.
Inline comments:
In `@rag/advanced_rag/harness/pipeline.py`:
- Around line 46-68: Add structured logs in _execute_web_search for cache hits,
creation of a new provider task, and joining an existing in-flight task; use the
cache key or other non-sensitive metadata, never raw queries. In
rag/advanced_rag/harness/orchestrator/decompose.py lines 40-49, log local-search
fallback to web search and web-cache reuse without including raw claim text.
---
Nitpick comments:
In `@test/unit_test/rag/advanced_rag/harness/test_web_only_reasoning.py`:
- Around line 6-41: Move the synthetic module setup currently at module scope
into an autouse fixture for the tests in this module, preserving the existing
stubs for rag.advanced_rag and infinity.rag_tokenizer. Track each sys.modules
entry added or replaced by the fixture and restore its prior value, or remove it
when absent, during fixture teardown so later tests can import the real package
initializer.
🪄 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 Plus
Run ID: 7af5c027-8232-4a4b-8d1b-9bdf8a2d698a
📒 Files selected for processing (8)
rag/advanced_rag/harness/agent.pyrag/advanced_rag/harness/config.pyrag/advanced_rag/harness/orchestrator/agentic.pyrag/advanced_rag/harness/orchestrator/decompose.pyrag/advanced_rag/harness/orchestrator/direct.pyrag/advanced_rag/harness/pipeline.pyrag/advanced_rag/harness/tools/gating.pytest/unit_test/rag/advanced_rag/harness/test_web_only_reasoning.py
KevinHuSh
left a comment
There was a problem hiding this comment.
But CI faild. Could you fix it?
|
Thanks for the review. I investigated the CI failure. The two failing wiki tests pass in isolation on the CI merge ref, and they also pass on upstream I also tried to rerun the failed workflow, but GitHub requires repository admin permissions for the rerun. Could you please rerun the failed job once? If the same failure reproduces, I’ll continue investigating the full-suite test ordering/import isolation under Python 3.13. |
|
Thanks for the review. I see that #17789 has been merged and closes #17638, with overlapping Web-search changes in the same agentic-search paths. Since this PR is now conflicting and superseded by the upstream implementation, I’m closing it to avoid duplicate work. Thanks again for the review and approval. |
Summary
Reasoning-enabled chats could not reliably reach Web search when no usable local knowledge-base evidence was available.
What problem does this PR solve?
The failure differed by reasoning mode:
web_searchthrough phase-based tool gating when local evidence was absent.This caused Internet-enabled, web-only chats to skip the configured Web search provider.
What is changed?
Testing
22 passedgit diff --check: passedLocal validation used Python 3.12.8 because Python 3.13 was unavailable in the local environment; the repository declares Python
>=3.13,<3.14.Closes #17638