Repository navigation
fix(chat): a question the planner splits keeps the chat's restrictions - #538
Merged
Merged
Conversation
Multi-hop retrieval passed neither source_ids nor additional_workspace_ids to its sub-questions, so a chat narrowed to chosen documents searched the whole workspace whenever the planner judged a question multi-hop, and extra workspaces were silently dropped (ADR-6, recorded as a live defect). Its citations also lacked knowledge_tier and low_relevance, so a global contribution was cited as a workspace document. Both paths now build citations with one helper. Workspace isolation itself was never affected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er sub-question Answers the two Low findings of the #538 review: the tests now set AGGREGATOR_AGENT_ENABLED and MCP_ENABLED off themselves, and one test asserts scope, knowledge_scope, filename_filter, source_ids and additional_workspace_ids on every sub-question call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Separate agent-session review (CONTRIBUTING.md, QP-9)Reviewed head: No finding at Medium or above. The change narrows retrieval to what the caller already chose and was authorised for; it cannot widen what any caller reads. Every sub-question's
Checklist
Findings
🤖 Generated with Claude Code |
Owner
Author
|
Thanks for the review. Nothing at Medium or above.
🤖 Generated with Claude Code |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
ADR-6 recorded a live defect on the default chat path:
get_rag_context_multi_hoptook neithersource_idsnoradditional_workspace_ids. So a chat narrowed to chosen documents searched the whole workspace whenever the planner judged a ≥ 7-word question multi-hop, and a chat spanning additional workspaces silently lost them. Workspace isolation itself held —scopewas always passed.Found while writing the test: multi-hop citations also lacked
knowledge_tierandlow_relevance, so a global contribution in a multi-hop answer was cited as a workspace document (GKB-3 regression on that path).Change
retrieve_contextspasses both restrictions toget_rag_context_multi_hop, which hands them to every sub-question'sretrieve_context._citation()helper builds a source entry for both paths; multi-hop adds itscombined_score.Fixed; file-map row for the new test.Tests
tests/unit/test_multi_hop_keeps_the_request_scope.py— 5 of its 6 tests fail onmain; the sixth (the single-query path, as a control) passes both ways. The chat-related unit suites: 373 passed. ruff, mypy,lint-importsclean.src/services/is a security-critical path (CONTRIBUTING.md), so this gets the separate agent-session review before merging.🤖 Generated with Claude Code