Fix delegate dedup path scoping#567
Conversation
PR Overview: Fix Delegate Dedup Path ScopingSummaryThis PR fixes a bug in the delegate semantic deduplication logic by scoping duplicate detection to the same resolved path instead of across all previous delegations in the parent session. Previously, the system would block semantically similar queries even when they targeted different repositories or root paths, preventing legitimate multi-repo searches. Files Changed
Architecture & Impact AssessmentWhat This PR AccomplishesBefore: Delegate deduplication compared queries against ALL previous delegations in the parent session, regardless of path. This meant asking "FIPS validation" in After: Deduplication now only considers prior delegations with the exact same resolved path ( Key Technical Changes
System Components Affected
Data Flowgraph TD
A[User submits search query] --> B{Has same-path delegations?}
B -->|No| C[Skip dedup check]
B -->|Yes| D[Run LLM semantic dedup]
D --> E{Is duplicate?}
E -->|Yes| F[Block delegation]
E -->|No| G[Allow delegation]
C --> G
G --> H[Execute delegate search]
H --> I[Store in previousDelegations with path]
style B fill:#f9f,stroke:#333,stroke-width:2px
style I fill:#bbf,stroke:#333,stroke-width:2px
Scope Discovery & Context ExpansionDirect Impact
Related Components (Inferred)
Out of Scope (Explicitly)
TestingThe new test (
Review Notes
Metadata
Powered by Visor from Probelabs Last updated: 2026-05-21T17:28:59.087Z | Triggered by: pr_opened | Commit: 9a0686e 💡 TIP: You can chat with Visor using |
✅ Security Check PassedNo security issues found – changes LGTM. Performance Issues (1)
✅ Security Check PassedNo security issues found – changes LGTM. \n\n \n\nPerformance Issues (1)
No quality issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2026-05-21T17:14:26.539Z | Triggered by: pr_opened | Commit: 9a0686e 💡 TIP: You can chat with Visor using |
Summary
search.delegatesemantic dedup to prior delegations with the same resolved path instead of the full parent-session history.Tests
npm test -- tests/unit/search-delegate.test.js --runInBandgit diff --checkOut of scope
Fixes #566