Repository navigation
fix(doctor): report blocked skill directories and preserve them on uninstall - #1335
Conversation
|
No findings in the specified PR diff. The PR description documents sufficient testing, including a built-CLI E2E record covering blocked-directory diagnostics, repair, and targeted uninstall. Deferred provider/agent coverage does not block merge. Review was read-only; no PR code was run, built, or installed. |
There was a problem hiding this comment.
This was generated by AI during triage.
@nateEc Thanks. The doctor half and the ENOTDIR crash are fixed. One thing blocks.
We built this head and its merge-base, and put a file at ~/.hermes/skills:
- doctor: base exits 0 with "All checks passed!". This head exits 1 and names the blocked path.
uninstall --force: base and current main exit 1 with ENOTDIR. This head exits 0 and keeps the file.- After moving the file aside, a plain
pulldelivers Hermes again, and doctor passes.
The new tests fail on base for the intended reason, and tsc and lint pass.
[P1 blocking]The targeted uninstall your e2e runs doesn't clean Hermes.teamai uninstall --agent hermes --forcewith the blocking file present exits 0 with:The Hermes hook script and the instructions plugin stay. The body and the new diagnostics and troubleshooting text say uninstall "continues cleaning the tool's other managed resources".⚠ Kept …/.hermes/skills: …/.hermes/skills is not a directory; the existing file was left unchanged. ℹ Nothing to uninstallisPlanEmpty(src/uninstall.ts:1435) doesn't counthermesCleanup, so the early return at:2483runs before the Hermes cleanup at:2401. The early return predates this PR; main also stops early when Hermes has nothing else in the plan. But this PR turns the blocked case into a silent incomplete uninstall and documents the opposite. CountinghermesCleanupinisPlanEmpty, with an assertion in the e2e that the hook script is gone, would fix it. Narrowing the docs and body to "uninstall no longer fails" is the alternative.[P2 non-blocking]#1265 changeswritesOf()to return objects and conflicts with this PR insrc/doctor-delivery.ts, so whichever lands second needs a rebase.[P3 nit]The new troubleshooting section repeats the diagnostics guide, and the zh-CN diagnostics sentence says the same clause twice.
CI review: it reported no findings and accepted the testing record. We agree the e2e record is real, but not with "no findings": it missed the targeted-uninstall gap above.
@nateEc this now conflicts with |
cf840b8 to
b351302
Compare
|
Addressed the review follow-up at
The PR description contains the updated verification record. Ready for another review. |
|
No findings in the specified PR diff. The earlier review raised no findings to resolve. The PR description documents sufficient testing, including built-CLI E2E verification of blocked-directory diagnostics, repair, and targeted uninstall. Deferred provider/agent coverage does not block merge. Review was read-only; no PR code was run, built, or installed. |
b351302 to
784c693
Compare
|
Addressed the review follow-up at
The PR description contains the updated verification record. Ready for another review. |
|
No findings in the specified PR diff. The earlier reviews raised no findings to resolve. The PR description documents sufficient testing, including built-CLI E2E verification of blocked-directory diagnostics, repair, and targeted uninstall. Deferred provider/agent coverage does not block merge. Review was read-only; no PR code was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@nateEc Thanks, approving at 784c693. The blocking finding is fixed: isPlanEmpty now counts hermesCleanup (src/uninstall.ts:1466). With the built CLI and a file blocking ~/.hermes/skills, uninstall --agent hermes --force exits 0, removes the Hermes hook and the instructions plugin, and keeps the file. The base exits 1 with ENOTDIR and leaves both behind. doctor --json now exits 1 with hermes skills directory is usable failing and the blocked path in its fix, where the base said "All checks passed!". Both halves of the #1221 item are met. The latest push is a rebase onto a26f74d that only keeps #1336's troubleshooting section next to this one.
- [P2 non-blocking] A no-op Hermes uninstall now reports a removal. User scope, Hermes enabled, never pulled:
uninstall --agent hermes --forceprints✔ Removed teamai Hermes hook from …/teamai-status-report.shand✔ teamai uninstalled, while the base saysNothing to uninstall. The hook file is absent before and after.hermesCleanupis true for any user-scope uninstall that includes Hermes, andremoveHermesHooks()logs success unconditionally (src/hermes-hooks.ts:201). Logging only when something Hermes-owned existed would fix it. - [P3 nit] The troubleshooting section repeats
docs/guide/diagnostics.md, and the zh-CN diagnostics sentence states its condition twice. The body's "Follow-up verification (2026-10-25)" and the five-branch "Broad validation" paragraph describe more than this diff.
The CI review reports no findings and says the earlier review raised none. We agree that nothing blocks now, but our earlier review did raise the uninstall finding above. CI at this head is still running.
@nateEc This is approved, but it now conflicts with |
…install - Check each writable tool skill root independently of delivery targets, so a skipped Hermes directory cannot produce a successful doctor report or a green last-pull location check. - Reuse the delivery path guard before uninstall enumerates skill roots; retain blocking files and unsafe links while cleaning the tool's other owned resources. - Update bilingual diagnostics and the troubleshooting reference with the failing check, repair path, and uninstall behavior. - Verify 358 focused lifecycle tests and real built-CLI doctor/repair/uninstall scenarios, with type checking, lint, and build checks.
- 即使技能目录被成员文件占用,Hermes hook 和指令插件清理仍属于有效卸载任务,避免提前返回成功。 - 将技能诊断适配到主分支的路径对象,并保留被阻挡的成员文件及其他工具资源。 - 新断言在修复前复现 hook 残留;修复后 269 个相关单测、2 个真实 CLI 用例及静态检查通过。
- 检查脚本、带所有权标记的插件及遗留 hook 注册与审批,避免空操作误报。 - 将可写入的缺失插件目录与实际存在的托管内容区分。 - 290 项定向单测及两项真实 CLI 场景通过,重复卸载保留成员文件且报告无需清理。
784c693 to
2f41768
Compare
|
No findings in the specified diff ( The PR description documents sufficient testing, including built-CLI E2E verification of blocked-directory diagnostics, repair, and targeted uninstall. Deferred provider/agent coverage does not block merge. The body references a newer head; this review remains limited to the requested commit range. Review was read-only: no PR code was run, built, or installed. |
|
Updated and rebased onto main Verification: 290 focused unit tests passed; types, lint and build passed. Post-build real-CLI Updated head: |
@nateEc Re-checked at 2f41768. Our approval stands. With the built CLI, a targeted It conflicts with Non-blocking notes:
|
…ed-lifecycle Keep main's generated-hook paragraph and Pi troubleshooting section beside this branch's blocked skills directory text. State the zh-CN diagnostics condition once.
|
No findings in the specified diff ( The PR description documents sufficient testing, including built-CLI E2E verification of blocked-directory diagnostics, repair, targeted uninstall, and repeated no-op uninstall. Coverage deferred to CI does not block merge. Review was read-only; no PR code was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
Thanks @nateEc. I merged main into the branch (the troubleshooting and diagnostics conflicts with #1340, keeping both sections) and added the registration-only and approval-only tests for hasHermesHooks. The targeted uninstall still behaves as approved with the built CLI, and CI is green at ef5928b.
A member file blocking Hermes's skills directory made delivery skip the tool, doctor report success, and uninstall fail with ENOTDIR. Check directory usability independently of last-delivery records and guard uninstall traversal. Keep the member file while cleaning the tool's other owned resources; no-op uninstall must not claim a removal.
Review follow-up:
Keep Hermes cleanup in removal-plan emptiness, but only when an owned script/plugin or exact hook registration/approval actually exists. A missing plugin directory is writable, not evidence of an installation. Repeated targeted uninstall now reports Nothing to uninstall and preserves the blocking member file and the other tool's resources.
Merged
mainatf70ce259(after #1337 and #1340). The conflicts were only in the docs andskill-datatroubleshooting: main's generated-hook paragraph and Pi section are kept beside this branch's text, and the zh-CN diagnostics sentence now states its condition once. No commit onmainsince the previous base touches this branch's source files. Added unit tests forhasHermesHooks()with a hook registration left alone and an approval left alone.Test Plan
Head
ef5928b0, macOS, Node 24.21.0:npx tsc --noEmit,npm run lint,npm run build: passed.npx vitest run src/__tests__/doctor-delivery.test.ts src/__tests__/uninstall.test.ts src/__tests__/hermes-hooks.test.ts src/__tests__/hermes-config.test.ts: 293 passed.npx vitest run: 16425 passed. The only failures were 15s timeouts inworkflow-reconciliation.test.tsunder full-suite load; that file passes alone (7 passed) and is not touched here.npm run test:e2e -- src/__tests__/e2e/blocked-skills-directory.test.ts: 2 passed.Built CLI, isolated
HOME/GIT_CONFIG_GLOBAL, local seed repo, user scope with Hermes and Claude enabled,~/.hermes/skillsa regular file:Native Windows, live vendor applications and other provider/agent combinations were not run locally and are left to CI.
Refs #1221; this PR addresses only its stated independent defect.