fix(vscode): route worktree permission approvals correctly#10787
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThe fix correctly resolves the race condition where a The approach is sound:
One observation (not a blocker): the filter function now carries side effects (state mutation), which is an unusual contract for a predicate. This is the right trade-off here, but worth a comment noting that the mutation is intentional and must precede the return value — the existing comment already covers this well. Test coverage is solid: new tests in both Files Reviewed (5 files)
Fix these issues in Kilo Cloud Reviewed by claude-4.6-sonnet-20260217 · 1,125,380 tokens Review guidance: REVIEW.md from base branch |
Agent Manager worktree sessions can request permission before their in-memory session mapping is registered. Replies then fall back to the workspace root instead of the worktree backend that owns the request, leaving background agents blocked even after Run is clicked.
Preserve the authoritative SSE directory before session filtering and use it for manual and runtime auto-approve replies. This keeps root worktree sessions and child subagents routed to the backend instance that created the permission request.