Repository navigation
fix(worktrees): create workspaces from nested Windows repositories - #164249
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 8:45 AM ET / 12:45 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR shortens Git metadata arguments when creating managed Windows workspaces, preserves relative Git environment paths, and updates regression coverage and documentation. Merge readiness✅ Ready for maintainer review The repair remains necessary on current main and the latest release. The earlier relative-path blocker is resolved, and no blocking correctness findings remain. Priority: P2 Review scores
Verification
How this fits togetherManaged workspaces give OpenClaw sessions isolated Git checkouts. The checkout owner registers each workspace, materializes its files, and preserves registration identity during recovery. flowchart TD
A[Source repository] --> B[Register isolated workspace]
B --> C[Capture Git metadata location]
C --> D[Choose shorter metadata argument]
D --> E[Verify registered checkout]
E --> F[Clone template or use Git checkout]
F --> G[Ready workspace or guarded recovery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +43, Docs +2. Total +44 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the existing checkout owner and use shorter metadata arguments while preserving repository-relative environment semantics and recovery guards. Do we have a high-confidence way to reproduce the issue? Yes: current source exposes the absolute metadata-argument mechanism, and the supplied native Windows evidence records the expected pre-fix failure and after-fix success. This read-only review did not execute it. Is this the best way to solve the issue? Yes: the patch reuses the existing metadata resolver, preserves working-directory semantics, and leaves command ordering and recovery ownership intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3bfa7cd91059. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Run metadata queries from the captured Git directory with a short explicit Git directory argument, and resolve the returned index against that same directory. This preserves registration authority while cloning replaces the destination marker and avoids Git for Windows' metadata argument limit. Extend the existing real-Git acceleration case with a deep source and source-index isolation, and normalize two Windows porcelain expectations. Native regression, whole-file checks, core/test types, and public session creation validate the repair. A separate deep-path fast-import limitation in node-result reconciliation remains documented for a focused follow-up. Production LOC is net -1. Committed with --no-verify because the sparse local worktree has no node_modules. All three changed files passed pnpm exec oxfmt --check on the native Windows lease before commit.
Keep captured registration and index reads at the repository working folder, and pass the shorter UTF-8 representation of the captured Git metadata path. This avoids the Windows metadata argument limit without reinterpreting inherited relative Git environment paths during cloning. Add a real-Git regression that fails on the published implementation. All 31 acceleration and empty-source tests passed on native Windows, along with core types, agents-tools test types, and formatting. The complete PR remains net -1 production line. Committed with --no-verify because this local task worktree has no node_modules. All three changed PR files passed pnpm exec oxfmt --check on the native Windows lease before commit.
d686a5b to
a86185d
Compare
|
Merged via squash.
|
* origin/main: fix(test): restore fixture state and await async completion (#164222) refactor(sessions): stage and settle pending inputs in workers (#164284) fix: speech-only replies fail when models include reasoning (#164285) fix(nextcloud-talk): avoid webhook migration for unconfigured channels fix: guide background skill reviews through Workshop proposals (#164292) test(build): reject AI dependencies in retained config repairs refactor(channels): require canonical private-network settings (#163535) fix(memory): migrate embedding cache in bounded batches and record oversized rows (#164303) feat(state): incognito actor memory and Codex history routing (P5c, inactive) (#164224) refactor(synology-chat): remove unused route account ID (#164280) test(ui): await web push preference publications (#164295) perf(scripts): avoid compiler projects for runtime import parsing (#164243) fix(worktrees): create workspaces from nested Windows repositories (#164249) test(agents,channels,cli): remove low-value tests (batch d173) (#164302) perf(workboard): serve cards per board revision and push changes instead of polling (#164301) refactor(sqlite): deslop sqlite stores (#164271) chore(ui): refresh control ui locales (#164299) refactor(events): deslop listener and disposal plumbing (#164221) fix: canonicalize fresh worker reasoning signatures (#164287)
…penclaw#164249) * fix(worktrees): create workspaces from nested Windows repositories Run metadata queries from the captured Git directory with a short explicit Git directory argument, and resolve the returned index against that same directory. This preserves registration authority while cloning replaces the destination marker and avoids Git for Windows' metadata argument limit. Extend the existing real-Git acceleration case with a deep source and source-index isolation, and normalize two Windows porcelain expectations. Native regression, whole-file checks, core/test types, and public session creation validate the repair. A separate deep-path fast-import limitation in node-result reconciliation remains documented for a focused follow-up. Production LOC is net -1. Committed with --no-verify because the sparse local worktree has no node_modules. All three changed files passed pnpm exec oxfmt --check on the native Windows lease before commit. * fix(worktrees): preserve relative Git environment paths Keep captured registration and index reads at the repository working folder, and pass the shorter UTF-8 representation of the captured Git metadata path. This avoids the Windows metadata argument limit without reinterpreting inherited relative Git environment paths during cloning. Add a real-Git regression that fails on the published implementation. All 31 acceleration and empty-source tests passed on native Windows, along with core types, agents-tools test types, and formatting. The complete PR remains net -1 production line. Committed with --no-verify because this local task worktree has no node_modules. All three changed PR files passed pnpm exec oxfmt --check on the native Windows lease before commit.
What Problem This Solves
Fixes managed workspace creation failing on native Windows with
fatal: '$GIT_DIR' too bigwhen the source repository is deeply nested. Git for Windows rejects an overlong explicit metadata argument before readingcore.longpaths.User Impact
Windows users can create and reuse managed workspaces from nested source repositories while preserving inherited relative Git environment paths.
Why This Change Was Made
Keep metadata reads at their original repository working directory and pass the shorter of the captured absolute and relative metadata paths, measured in UTF-8 bytes. The captured registration remains authoritative while cloning replaces the destination's
.gitpointer, including cancellation and rollback. Index paths still resolve against the original working directory.The real-Git acceleration fixture now covers a deep source, source-index isolation, and relative
GIT_COMMON_DIR. Two existing recovery assertions use Git porcelain's separator convention. No Git command count or ordering changes.Evidence
service.acceleration.test.tsandempty-source.test.ts: 31/31 passed on native Windows, one worker. Combined Vitest time 175.73 s; command wall time 398.88 s, including 214.96 s of compiled-worker preparation. The deep-source case took 3.346 s. Final-head CI ran the whole acceleration file in 29.98 s Vitest / 52.96 s shard wall time. These existing integration files exercise real Git cloning, rollback, cancellation, and snapshot recovery; the new environment case adds no separate process fixture.pnpm exec oxfmt --checkpassed on the Windows lease. Independent local and final committed-branch reviews are scoped-clean through P2. The rebase onto main preserved the patch byte-for-byte.fast-importfailure at deep ref paths is a separate reconciliation defect; this PR covers creation.The prior head's CI run failed in an unchanged session-lifecycle test with
AgentDatabaseRegistryChangedError. On its clean merge-base, the original three-file/two-worker shard on native Windows produced 13 passes and 15 different failures (cleanup handles, CRLF, and a session-authority rejection). The originally failing case then passed alone (19.532 s case; 399.62 s command). These replays do not establish the cause of the Linux CI failure. No GitHub job was rerun. Final-head CI passed, includingopenclaw/ci-gate; ClawSweeper completed its exact-head review with no findings.The sibling
service.capacity.test.tspreviously produced the same 14 failures with original and repaired production (9 passed in each run): 11 CRLF assumptions, two porcelain separator comparisons, and one shell-setup assumption on Windows. These inherited fixtures remain outside this focused repair.External Git metadata on another drive cannot use a shorter relative argument and remains subject to Git's own path limits. Production LOC: +4 / -5, net −1.