Skip to content

fix(skills): mirror deleted files during push - #651

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
dvd233:codex/fix/teamai-skill-delete-650
Sep 20, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
dvd233:codex/fix/teamai-skill-delete-650

Conversation

@dvd233

@dvd233 dvd233 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Mirror the local skill file set into the team repository during teamai push. Previously, copyDir merged files but never removed files deleted locally, so the CLI reported success while the team repository retained stale files and the skill stayed (modified) forever.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (feature causing existing behavior to change)
  • Documentation only
  • Refactor / internal cleanup

Test Plan

  • npx tsc --noEmit passes
  • npx vitest run passes
  • Added/updated tests for the change

Focused tests:

  • npx vitest run src/__tests__/skills.test.ts src/__tests__/fs-compare.test.ts — 94/94 passed
  • npm run build — passed
  • git diff --check — passed

Real CLI E2E used a temporary local bare Git remote and the built CLI:

  • teamai push --skill ... --all pushed a real local branch.
  • Deleted references/old.md was absent from the pushed branch.
  • Added references/new.md was present.
  • CONTRIBUTORS was preserved and updated.
  • Automatic PR creation failed only because the isolated generic Git provider intentionally has no PR API.

The full suite reached 3,434/3,507 tests on Windows; the remaining failures are existing environment-sensitive POSIX path, permissions, shell, symlink, process, and network cases unrelated to this change.

Related Issues

Fixes #650

Notes for Reviewers

The mirror step reuses the existing recursive file walker, which already excludes ignored files such as .git, node_modules, .DS_Store, and *.pyc. The root CONTRIBUTORS file is explicitly preserved. Empty directories are pruned using the existing helper.

@jeff-r2026 jeff-r2026 self-assigned this Sep 19, 2026
@github-actions

Copy link
Copy Markdown
  • [P1 blocking] src/resources/skills.ts:539 — The copy-before-delete algorithm breaks case-only renames on case-insensitive filesystems. If foo.md becomes Foo.md, copyDir may retain the destination’s old casing; teamFiles then reports foo.md, which is absent from the case-sensitive sourceFiles set, so line 543 deletes the newly copied file. Delete stale entries before copying, or compare paths using filesystem-aware casing.
  • [P1 blocking] src/resources/skills.ts:540listFilesRecursive skips symbolic links, so a symlink deleted locally remains in the team repository. Git and the existing copyDir support symlinks, meaning this does not fully mirror the skill file set. The cleanup must enumerate and remove stale symlink entries too.

The PR description includes a concrete test plan and real-CLI E2E record, so it satisfies the testing-documentation requirement.

@jeff-r2026
jeff-r2026 merged commit 6e47059 into Tencent:main Sep 20, 2026
10 checks passed
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.

[bug] A file deleted from a skill is never removed from the team repo: push reports success and the skill re-flags as (modified) on every scan

2 participants