Skip to content

fix(pull): support Windows long paths in team repo refresh - #1518

Merged
jeff-r2026 merged 5 commits into
Tencent:mainfrom
ydflow:fix/windows-git-longpaths
Oct 29, 2026
Merged

jeff-r2026 merged 5 commits into
Tencent:mainfrom
ydflow:fix/windows-git-longpaths

Conversation

@ydflow

@ydflow ydflow commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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=true only 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, and npm run lint passed.
  • 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 with Filename too long against untouched upstream 56320abf (also verified on Git 2.56.0.windows.4).
  • Full Windows unit suite (npx vitest run --maxWorkers=4) was attempted and stopped after observing multiple failures; no full-suite pass is claimed. The 9 uninstall.test.ts failures and 33 local-agent.test.ts failures also reproduce on untouched upstream 56320abf. 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:

  • The real-CLI regression is Windows-only; platform-specific factory options are also checked on simulated Windows/Linux/macOS in unit tests.
  • On Git 2.56.0.windows.4, explicitly configured core.longpaths=false can 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 to true, as documented. It does not change role filtering or the existing reset recovery policy.
  • Initial teamai init provider clones do not use these shared clients. The Windows guides document git config --global core.longpaths true for joining a team whose repository already has long paths. This PR remains scoped to refresh.

Validation after syncing main (1d939a20, base 2fa1ab2f):

  • Resolved the Windows CI step conflict by keeping both the long-path regression and upstream's CodeBuddy project-gate regression.
  • npm run build, npx tsc --noEmit, and npm run lint passed.
  • npx vitest run --config vitest.windows.config.ts: 4,380 tests passed.
  • Git-focused unit tests: 80 passed, 7 POSIX-only tests skipped.
  • Built-CLI long-path regression: 1 passed on Git 2.56.0.windows.4.
  • Built-CLI hook shells: 3 passed; project hook isolation (-t 'injects both projects'): 1 passed, 30 not selected.
  • Fresh remote CI is running. The old macOS Node 22 timeout result is not claimed as fixed until the new run completes.

@github-actions

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

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 SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 control git clone with core.longpaths=false exits 0. It only prints warning: unable to access '…/.gitignore': Filename too long, so expect(control.status).not.toBe(0) at windows-longpaths.test.ts:80 fails. 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 pull without 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.
  • [P2 non-blocking, but it fits this PR] The first teamai init clone doesn't get the flag. init clones through provider.cloneRepo (src/init.ts:2071). Each provider runs its own git 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), not createGit. So on a host where the bug occurs, a member who joins after a long path lands still fails at init. We read this from the code and couldn't run it on Windows. Adding -c core.longpaths=true on win32 to those clone arguments would fix it, through one helper next to the factories in git.ts. If you'd rather keep this PR to refresh, one line in both windows.md pages saying a first init needs git config --global core.longpaths true would do.

Optional:

  • [P3 nit] deep-demo has no SKILL.md, so it is never delivered under any role. The "inactive skill not delivered" assertion at line 86 would pass without role filtering. Adding a SKILL.md to 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.

@SaulMoro
SaulMoro self-requested a review October 28, 2026 10:45
@github-actions

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

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.

@SaulMoro

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

@ydflow Thanks. At 02b02b9d, everything from our last review is addressed.

  • Windows e2e. The fixture now writes the long entry straight into the index, checks that the remote holds it, and keeps the control clone with core.longpaths=false failing on this exact tree. With Git 2.56.0.windows.2, windows-longpaths.test.ts passed in the Windows job. So CI now runs the failing case, not one that passes either way. We take the Git 2.56 run against 56320abf from your body, since CI doesn't run main.
  • First init clone. Both windows.md pages now say a first teamai init on such a host needs core.longpaths set to true, and they match.
  • Role filtering. deep-demo has a SKILL.md now, so the "inactive skill not delivered" check tests the filter.
  • Checks. Off Windows nothing changes. With the built CLI on macOS, init and pull --force succeed, and no git command or config file gets core.longpaths. Build, tsc and lint pass, and git.test.ts passes 73/73. CI is green at this head apart from two macOS Lint & Test timeouts in tests this PR does not touch (score-drain.test.ts on Node 22, and a hook timeout-stderr case in team-hooks-dispatch.test.ts on Node 20). The change does nothing off Windows, so we reran those two jobs.

@jeff-r2026 Since 0afda5b3 this PR also changes .github/workflows/ci.yml (one step that runs windows-longpaths.test.ts in the Windows job), so the merge is yours. We have nothing open on it and are dismissing our earlier Request changes.

@SaulMoro
SaulMoro dismissed their stale review October 28, 2026 11:37

Points resolved at 02b02b9; the PR now changes ci.yml, so the merge is jeff-r2026's.

@SaulMoro
SaulMoro requested a review from jeff-r2026 October 28, 2026 11:37
@github-actions

Copy link
Copy Markdown

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.

@jeff-r2026 jeff-r2026 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on main d33a911 merged with 1d939a2: tsc, lint and build pass; git.test.ts 73/73; the pull suites match main (one root-permission failure in pull-skill-dirs that main has too). Off Windows createGit gets no extra config, and the ci.yml step only runs the new Windows e2e. Thanks.

@jeff-r2026
jeff-r2026 merged commit 4aaa38f into Tencent:main Oct 29, 2026
18 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
)

* 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]>
mosifu added a commit to mosifu/teamai-cli that referenced this pull request Nov 24, 2026
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.
mosifu added a commit to mosifu/teamai-cli that referenced this pull request Nov 24, 2026
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.
mosifu added a commit to mosifu/teamai-cli that referenced this pull request Nov 24, 2026
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.
jeff-r2026 pushed a commit that referenced this pull request Nov 26, 2026
#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants