You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
consult: project auto-detect fails in slugless builder worktrees (.builders/bugfix-N) and dumps every project name #1898
From a builder worktree named .builders/bugfix-<N> (no slug), consult -m codex --protocol bugfix --type pr --output <file> exits 1 without running a review. The only output is:
Model: codex
Review type: pr (protocol: bugfix)
Multiple projects found: <every directory under codev/projects/, comma-separated, on one line>
In a repo with ~2300 project directories that line is ~95,000 characters. It gives no hint to pass --issue and does not name the worktree it failed to match. The same command with --issue <N> works. Reported by an adopter on consult 3.3.7, hit twice in one evening by two builders. The consult skill says a builder context auto-detects, so builders trust it.
Root cause
getBuilderProjectState() in packages/codev/src/commands/consult/index.ts (around line 341) disambiguates with:
cwd.match(/\.builders\/[^/]*?-?(\d+)-([^/]+)/)
This requires a -<slug> after the number. Current worktrees are slugless (.builders/bugfix-1880, .builders/spir-12), so the match fails and the code falls through to the bare Multiple projects found: ${projectDirs.join(', ')} throw. Verified:
cwd
matches
.builders/bugfix-7438
no
.builders/bugfix-7438/packages/x
no
.builders/bugfix-7438-some-slug
yes
.builders/spir-12
no
The tracker-key branch (ISSUE_KEY_SOURCE) does not catch it either. Porch-driven runs are unaffected because porch passes --project-id; only hand-run consults in a builder worktree hit this.
Fix
Make the worktree-ID match accept a slugless folder: number followed by -, / or end of string. Better still, resolve the builder's project the same way porch does for the worktree, rather than a second regex.
Never print the project list. All three throws at lines 348 to 359, and the Available: list at line 334, should print one short line: the worktree ID that was tried (if any), the count of projects, and "pass --issue or --project-id ".
Testing
Unit tests for getBuilderProjectState with cwd at a slugless worktree root, a subdirectory of it, a slugged worktree, and a tracker-key worktree, each with multiple project dirs. One test asserting the no-match error stays under a small length bound with 2000+ project dirs.
Fixed by PR #1899 (merge commit d3ffaa1). Consult now resolves the worktree's project with porch's detector, and not-found errors are one short line. On main; not yet in a published release.
Activity
waleedkadous commentedon Nov 14, 2026
On it! Working on a fix now.
Fix #1898: consult auto-detects slugless builder worktrees; errors ne…
[Bugfix #1898] CMAP: count only dirs with status.yaml as projects; co…
waleedkadous commentedon Nov 15, 2026
Fixed by PR #1899 (merge commit d3ffaa1). Consult now resolves the worktree's project with porch's detector, and not-found errors are one short line. On main; not yet in a published release.
[Spec 1658] Merge main (#1898 consult worktree project id, #1880 cons…