Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
|
| entries = await opendir(directory); | ||
| } catch { | ||
| // Preserve discovery's existing handling of inaccessible directories. | ||
| return true; |
There was a problem hiding this comment.
Inaccessible scans appear complete
When a nested directory cannot be opened, the walk returns true without checking it for instruction files. The new completeness flag therefore remains false, and open_workspace gives no incomplete-inventory warning. Users may treat the omitted instructions as a complete list. This warning gap does not block merging, but access failures should be reported as incomplete scans rather than as scan-limit stops.
Artifacts
Focused denied-directory service check source
- The authored check creates a nested instruction file, confirms `opendir` returns `EACCES`, and invokes `WorkspaceRegistry.openWorkspace` against the selected source tree.
Service output before the incomplete-inventory signal
- Running the check against HEAD^ showed a denied directory, an empty instruction inventory, and no incomplete-inventory signal.
Service output with the incomplete-inventory signal
- Running the same check against HEAD showed a denied directory and empty inventory, but the new incomplete-inventory signal was false.
Opening a large multi-project directory can spend minutes discovering nested instruction files before
open_workspacereturns. In our packaged 1.0.8 deployment, a correlated request spent 230 seconds of its 231-second runtime in discovery. A separate read-only terminal comparison on currentmaintook 10,023 ms without this patch and 44 ms with it; these are single-run observations, not a latency guarantee.This bounds the existing sequential walk across the whole request to 256 directories, 10,000 entries, and a one-second time budget checked between filesystem operations. Small workspaces retain their nested instruction inventory. If scanning stops early, the response explicitly says the inventory is incomplete and asks the host to check applicable ancestor instructions or open the specific project. The warning is also retained on reused workspace responses. A single stalled filesystem operation is not cancelled by this budget.
This is a smaller alternative alongside #197 and #374, following the bounded-discovery direction discussed on #91. It applies to all directory layouts, keeps current bootstrap/reuse behavior, and introduces no configuration, tool schema, or dependency changes. Related to #90; it does not implement that issue's proposed automatic ancestor-instruction loading.
Typecheck, Vite/TypeScript build, 45 focused tests, and the complete source suite passed locally (152 passed, one platform skip;
TMPDIR=/tmp pnpm testavoids macOS Unix-socket path limits). The fresh package-install smoke check remains blocked: the newly resolved Koffi native dependency fails to link on macOS, including with Node 22 and temporary CMake. Package-install success and Windows/Linux execution are unverified, so this PR is a draft. No live MCP host acceptance is claimed for this source patch.