Skip to content

fix(skills): isolate files blocking tool skill directories - #1310

Merged
SaulMoro merged 2 commits into
Tencent:mainfrom
nateEc:fix/1221-blocked-skills-directory
Oct 23, 2026
Merged

SaulMoro merged 2 commits into
Tencent:mainfrom
nateEc:fix/1221-blocked-skills-directory

Conversation

@nateEc

@nateEc nateEc commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A regular file at Hermes's skills path aborts a user-scope pull with ENOTDIR and can stop delivery to other tools. Have the shared directory guard preserve and report the blocker, and let both pull cleanup readers skip it. Mark the blocked team-skill delivery incomplete so moving the file aside followed by a plain pull restores the missing copy even at the same team revision. Add bilingual recovery guidance.

Type of Change

  • Bug fix

Test Plan

  • Focused regression evidence failed before the fix and passed afterward.
  • 359 tests: 268 across pull-skill-dirs, source, source-codex-reconciliation, source-symlink-ownership and skip-uninstalled-tools; 91 skills-handler tests.
  • npm run build, npx tsc --noEmit, npm run lint, and git diff --check passed.
  • Real CLI after build, commit 8b8adad:
npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/blocked-skills-directory.test.ts
1 passed: real CLI pull from an isolated local git team clone keeps a member file at .hermes/skills, reports its path without ENOTDIR, and delivers the team skill to Claude. After unlinking the blocker, plain `teamai pull` (no --force) delivers both the team skill and built-in stub to Hermes.

Related Issues

Related to #1221, one specific item in "Other findings". This PR does not close the umbrella issue or include its descriptor/resolver redesign.

Notes for Reviewers

Uses the existing skill guard and delivery failure ledger; no deletion or automatic replacement of the member's file. Shared-state readers/writers audited: team and built-in skill writers, source guard callers, both cleanup readers, and the revision/target record that gates subsequent pulls. Representative git-provider CLI run on macOS; live agents and additional forge providers left to CI.

Integration verification: all five independent fixes cherry-picked cleanly onto origin/main in a local-only checkout; combined build, typecheck and lint passed, with 174 unit tests and 7 real-CLI cases across 6 E2E files. The Windows test-list guard and moved POSIX command regression also pass together (25 tests).

CI follow-up 0bc1f13: the directory guard now blocks only non-directory parents, leaving a member file at the leaf skill path to the existing ownership/Kept flow. The CI case was reproduced locally before this correction. Afterward all 14 cases in ownership-rules-agents-993 plus the blocked-directory E2E pass (15 real-CLI cases), as do 131 skill-handler/pull tests, build, typecheck and lint. The original member file remains intact and plain-pull recovery works for both leaf and parent blockers.

- Stop the shared skill-directory guard at a regular file and preserve its contents, reporting the exact path and recovery command.
- Skip blocked skill roots in both pull cleanup readers so Hermes cannot abort delivery to the scope's other tools with ENOTDIR.
- Record blocked team-skill deliveries as incomplete so a plain pull retries after the file is moved, even when the team revision is unchanged.
- Document recovery in English and Chinese; verify 359 focused regression tests, build, typecheck and lint, plus a real-CLI pull that preserves the blocker, delivers to Claude and restores Hermes on retry. Related to Tencent#1221.
@github-actions

Copy link
Copy Markdown

I can’t reliably review the exact requested scope: the checkout is shallow, and git diff 2401d047...8b8adad fails with no merge base. The two-endpoint diff includes unrelated changes, so I won’t report findings from it.

The PR description does document sufficient testing: a post-build real-CLI run covers preserving the blocker, delivery to Claude, and retrying Hermes without --force. No missing-testing finding is warranted.

Please provide the requested three-dot diff or a checkout containing its merge-base history. I ran no PR code, builds, or installs.

- Limit the non-directory guard to parent directories; a file occupying the skill itself still reaches the existing ownership checks and Kept diagnostic.
- Preserve the established member-file recovery flow while continuing to isolate a blocked Hermes skills root and retain its retry marker.
- Reproduce the failing CI ownership case locally, then verify all 15 real-CLI ownership and blocked-directory cases, 131 skill regression tests, build, typecheck and lint.
@github-actions

Copy link
Copy Markdown

I can’t complete the scoped review: the exact three-dot diff still fails with no merge base. GitHub retrieval was also unavailable. I did not substitute a two-endpoint diff that could include unrelated changes.

  • Earlier review blocker remains unresolved: the requested diff is still inaccessible.
  • Testing documentation is sufficient: the supplied PR body records post-build real-CLI verification, including blocker preservation, Claude delivery, and plain-pull Hermes recovery, plus follow-up verification for 0bc1f13. No missing-testing finding is warranted.

Please provide the exact three-dot diff or a checkout containing its merge-base history. No PR code, builds, tests, or installs were run.

@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.

@nateEc Thanks, approving. This closes the #1221 item "A file where Hermes's skills directory should be stops the user scope with ENOTDIR".

We ran the same fixture with the built CLI on this head and on main 2401d047. The fixture puts a file at ~/.hermes/skills, then runs pull --force:

  • main: pull exits 0 with an ENOTDIR warning, and Claude's copy is never written. doctor then fails on the raw ENOTDIR.
  • this PR: pull names the blocked path, delivers to Claude, and leaves the file byte-identical. After the file is moved aside, a plain pull restores Hermes.

The new e2e fails on main and passes here. tsc, lint, the unit file and the ownership e2e suite pass.

Not blocking, worth doing here if you agree:

  • [P2 non-blocking] In the blocked state, doctor prints the Skipped … is not a directory warning but exits 0 with "All checks passed!". It drops "Skills delivered to hermes" and still shows "✔ hermes skills are where the last pull wrote them". It reads the same deliveryTargets, which skip the blocked tool. Counting the block as a problem would keep doctor honest for scripts that read its exit code.
  • [P2 non-blocking] teamai uninstall --force still stops with ENOTDIR on the same file. listDirs(skillsDir) at src/uninstall.ts:651 reads it as a directory. This happens on main too, and the body scopes the PR to pull.

@SaulMoro
SaulMoro merged commit e3c6f81 into Tencent:main Oct 23, 2026
18 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
)

* fix(skills): isolate files blocking tool skill directories

- Stop the shared skill-directory guard at a regular file and preserve its contents, reporting the exact path and recovery command.
- Skip blocked skill roots in both pull cleanup readers so Hermes cannot abort delivery to the scope's other tools with ENOTDIR.
- Record blocked team-skill deliveries as incomplete so a plain pull retries after the file is moved, even when the team revision is unchanged.
- Document recovery in English and Chinese; verify 359 focused regression tests, build, typecheck and lint, plus a real-CLI pull that preserves the blocker, delivers to Claude and restores Hermes on retry. Related to Tencent#1221.

* fix(skills): preserve ownership handling at leaf skill paths

- Limit the non-directory guard to parent directories; a file occupying the skill itself still reaches the existing ownership checks and Kept diagnostic.
- Preserve the established member-file recovery flow while continuing to isolate a blocked Hermes skills root and retain its retry marker.
- Reproduce the failing CI ownership case locally, then verify all 15 real-CLI ownership and blocked-directory cases, 131 skill regression tests, build, typecheck and lint.
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