Repository navigation
fix(pull): support Windows long paths in team repo refresh - #1518
Conversation
|
No findings in the specified PR diff. The PR description satisfies the testing requirement: it documents a representative Windows real-CLI run with the built CLI, verifies the long-path failure before the fix, and checks active-role delivery and unchanged Git configuration afterward. I only read the diff; I did not run, build, or install PR code. |
|
No findings in the specified PR diff. The PR description satisfies the testing requirement: it records a representative Windows run with the built CLI, reproduces the pre-fix long-path failure, and verifies active-skill delivery, inactive-skill exclusion, and unchanged Git configuration. The earlier review raised no findings; none require resolution. I only read the diff and did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@ydflow Thanks for this. The change is small and goes where it should. Off Windows nothing changes: with the built CLI on macOS, init and pull --force under GIT_TRACE run the same git commands on this head and on main. No command gets core.longpaths, and no config file gains it. tsc and lint pass. git.test.ts passes 73/73, and the new unit tests fail on main. Two things block approval:
- [P1 blocking] The new Windows e2e fails in CI before it reaches
teamai pull. In the Windows job at this head (Git 2.56.0.windows.2), the controlgit clonewithcore.longpaths=falseexits 0. It only printswarning: unable to access '…/.gitignore': Filename too long, soexpect(control.status).not.toBe(0)atwindows-longpaths.test.ts:80fails. Your red-to-green run was on Git 2.33.1. On CI's Git the fixture never reproduces the failure, so CI can't tell this head from main. Two questions:- On Git 2.56, does
teamai pullwithout the fix actually fail, or does it finish and leave the long-path files missing? - Can the test reproduce the failure there? If not, the test could skip with a stated reason when the control clone succeeds, and the body could say that the fix is verified only on Git 2.33.
- On Git 2.56, does
- [P2 non-blocking, but it fits this PR] The first
teamai initclone doesn't get the flag.initclones throughprovider.cloneRepo(src/init.ts:2071). Each provider runs its owngit clone(src/providers/git/index.ts:92,github/gh-cli.ts:399,gitlab/gitlab-api.ts:211,gitcode/gitcode-api.ts:214,tgit/gf-cli.ts:462,cnb/cnb-cli.ts:251), notcreateGit. So on a host where the bug occurs, a member who joins after a long path lands still fails atinit. We read this from the code and couldn't run it on Windows. Adding-c core.longpaths=trueon win32 to those clone arguments would fix it, through one helper next to the factories ingit.ts. If you'd rather keep this PR to refresh, one line in bothwindows.mdpages saying a firstinitneedsgit config --global core.longpaths truewould do.
Optional:
- [P3 nit]
deep-demohas noSKILL.md, so it is never delivered under any role. The "inactive skill not delivered" assertion at line 86 would pass without role filtering. Adding aSKILL.mdto it would make the assertion test the filter.
This conflicts with #1450 in src/utils/git.ts (the simple-git factory rewrite). The conflict is textual. The Lint & Test jobs and the fork-safe E2E shards were still running when we checked.
|
No findings in the specified PR diff. The PR description satisfies the testing requirement: it records a representative Windows real-CLI run, reproduces the pre-fix failure, and verifies active-skill delivery, inactive-skill exclusion, and unchanged Git configuration. Earlier reviews raised no findings; none require resolution. I only read the diff and did not run, build, or install PR code. |
|
No findings in the specified PR diff. The PR description satisfies the testing requirement: it records a representative Windows real-CLI run, reproduces the pre-fix failure, and verifies active-skill delivery, inactive-skill exclusion, and unchanged Git configuration. Earlier reviews raised no findings; none require resolution. I only read the diff and did not run, build, or install PR code. |
@ydflow Thanks. At
@jeff-r2026 Since |
Points resolved at 02b02b9; the PR now changes ci.yml, so the merge is jeff-r2026's.
|
No findings in the specified PR diff. The PR description satisfies the testing requirement: it records a representative Windows real-CLI run, reproduces the pre-fix failure, and verifies active-skill delivery, inactive-skill exclusion, and unchanged Git configuration. Full-suite limitations are explicitly disclosed. Earlier reviews raised no findings; none require resolution. I only read the diff and did not run, build, or install PR code. |
) * fix(pull): support Windows long paths in team repo refresh * test(pull): run long-path regression in Windows CI * test(pull): seed long-path fixtures without directory scans * test(pull): exercise a valid inactive skill and clarify init scope --------- Co-authored-by: ydflow <[email protected]>
The shared Git clients carry core.longpaths since Tencent#1518, but all seven clone sites start git through spawnSync, so the first `teamai init` still failed with "Filename too long" for a team repo holding a path past MAX_PATH, and the Windows guide asked the member to set the option globally first. longPathConfig() and longPathArgs() keep the two spellings in one place: the clients take the config, and a clone takes `-c core.longpaths=true` ahead of the subcommand, where a git-level option has to sit.
The shared Git clients carry core.longpaths since Tencent#1518, but all seven clone sites start git through spawnSync, so the first `teamai init` still failed with "Filename too long" for a team repo holding a path past MAX_PATH, and the Windows guide asked the member to set the option globally first. longPathConfig() and longPathArgs() keep the two spellings in one place: the clients take the config, and a clone takes `-c core.longpaths=true` ahead of the subcommand, where a git-level option has to sit.
The shared Git clients carry core.longpaths since Tencent#1518, but all seven clone sites start git through spawnSync, so the first `teamai init` still failed with "Filename too long" for a team repo holding a path past MAX_PATH, and the Windows guide asked the member to set the option globally first. longPathConfig() and longPathArgs() keep the two spellings in one place: the clients take the config, and a clone takes `-c core.longpaths=true` ahead of the subcommand, where a git-level option has to sit.
#1954) The shared Git clients carry core.longpaths since #1518, but all seven clone sites start git through spawnSync, so the first `teamai init` still failed with "Filename too long" for a team repo holding a path past MAX_PATH, and the Windows guide asked the member to set the option globally first. longPathConfig() and longPathArgs() keep the two spellings in one place: the clients take the config, and a clone takes `-c core.longpaths=true` ahead of the subcommand, where a git-level option has to sit.
On Windows, a deeply nested path in an inactive skill namespace can make the team-repo refresh fail with
Filename too long, blocking delivery of the active role's skills too. Refresh checks out the repository before role filtering.Pass
core.longpaths=trueonly to the shared Git clients on Windows, including the timeout variant. This keeps repository/global Git config unchanged. Add bilingual Windows guidance and run the regression in Windows CI.Validation (Windows, Node 24.19.0):
npm run build,npx tsc --noEmit, andnpm run lintpassed.npx vitest run src/__tests__/git.test.ts src/__tests__/git-binary.test.ts src/__tests__/git-silent-commands.test.ts --maxWorkers=2: 80 passed, 7 POSIX-only tests skipped.npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/windows-longpaths.test.ts --retry=0: 1 passed with the built CLI on Git 2.33.1.windows.1 and 2.56.0.windows.4. In an isolated home, the fixture's long entry is verified in the remote tree and an ordinary Git control clone with long paths disabled fails. TeamAI pulls that asset, updates the active Cursor skill, leaves inactive skills undelivered, and preserves both config files. The same real-CLI test fails withFilename too longagainst untouched upstream56320abf(also verified on Git 2.56.0.windows.4).npx vitest run --maxWorkers=4) was attempted and stopped after observing multiple failures; no full-suite pass is claimed. The 9uninstall.test.tsfailures and 33local-agent.test.tsfailures also reproduce on untouched upstream56320abf. Other failures observed so far (including MCP/environment/workflow tests) have not been individually baseline-checked. Linux/macOS full-suite validation is left to CI.Limits:
core.longpaths=falsecan still defeat process overrides in some operations. This patch is verified with normal default configuration; users with an explicit disabling setting may need to change it totrue, as documented. It does not change role filtering or the existing reset recovery policy.teamai initprovider clones do not use these shared clients. The Windows guides documentgit config --global core.longpaths truefor joining a team whose repository already has long paths. This PR remains scoped to refresh.Validation after syncing main (
1d939a20, base2fa1ab2f):npm run build,npx tsc --noEmit, andnpm run lintpassed.npx vitest run --config vitest.windows.config.ts: 4,380 tests passed.-t 'injects both projects'): 1 passed, 30 not selected.