Conversation
… path The search delegate subagent runs from workspace root (allowedFolders[0]) but returned paths were being resolved against searchPaths[0] (the project subdirectory). This caused doubled path segments like /workspace/project/project/src/file.go when the subagent returned workspace-relative paths. Fix the resolution base to match where the delegate actually runs, and add a validation layer that detects/repairs doubled segments and tries alternative resolution bases as a safety net for AI path hallucinations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SummaryThis PR fixes a path resolution bug in the search delegate that caused doubled directory segments when subagents returned workspace-relative paths. Files Changed Analysis
Architecture & Impact AssessmentWhat This PR Accomplishes
Key Technical Changes
Flow Diagramflowchart TD
A[Subagent returns paths] --> B[Resolve against delegateBase]
B --> C{existsSync?}
C -->|Yes| D[Use path]
C -->|No| E{Doubled segment?}
E -->|Yes| F[Repair & validate]
F -->|Valid| D
E -->|No| G[Try alternative bases]
G -->|Found| D
G -->|Not found| H[Keep with warning]
Affected Components
Scope Discovery & Context ExpansionRelated Files to Review
Potential Edge Cases
Tags
Metadata
Powered by Visor from Probelabs Last updated: 2026-03-04T15:32:21.873Z | Triggered by: pr_opened | Commit: b5a4a92 💡 TIP: You can chat with Visor using |
Security Issues (3)
Performance Issues (1)
Security Issues (3)
Performance Issues (1)
Powered by Visor from Probelabs Last updated: 2026-03-04T15:32:06.284Z | Triggered by: pr_opened | Commit: b5a4a92 💡 TIP: You can chat with Visor using |
Summary
allowedFolders[0]) but returned paths were being resolved againstsearchPaths[0](the project subdirectory). This caused paths like/workspace/project/project/src/file.gowhen the subagent returned workspace-relative paths (e.g.project/src/file.go).existsSyncand auto-repair doubled directory segments or try alternative resolution bases — catches edge cases and AI path hallucinations.Trace:
cb1bb8d74c4d93fbff8ccaf1e63028ab—explore-codeprobe delegation returns targets with project prefix, which got doubled when joined withsearchPaths[0].Root Cause
searchTool(searchDelegate: true)withpath→searchPaths[0]=/tmp/.../slack-xxx/tyk-analytics-uipath: allowedFolders[0]→ workspace root/tmp/.../slack-xxxtyk-analytics-ui/app/pages/...(relative to workspace root)resolveTargetPath("tyk-analytics-ui/app/...", "/tmp/.../tyk-analytics-ui")→ DOUBLEDdelegateBase(workspace root) instead ofsearchPaths[0]Test plan
🤖 Generated with Claude Code