fix(kanban): resolve worker skill probe against platform default home - #39979
Closed
Dusk1e wants to merge 1 commit into
Closed
fix(kanban): resolve worker skill probe against platform default home#39979Dusk1e wants to merge 1 commit into
Dusk1e wants to merge 1 commit into
Conversation
Contributor
|
Thanks for the focused Windows/profile-home regression analysis. Automated hermes-sweeper review found that current
Closing as implemented on main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
_kanban_worker_skill_available()decides whether the kanban dispatcherinjects
--skills kanban-workerinto a spawned worker. When the probe iscalled with
hermes_home=None, it fell back to a hardcodedPath.home() / ".hermes":This is wrong on native Windows, where the canonical Hermes home is
%LOCALAPPDATA%\hermes(seehermes_constants._get_platform_default_hermes_home),not
%USERPROFILE%\.hermes(an empty husk). It also violates the hardlinerule against hardcoding
Path.home() / ".hermes"(AGENTS.md → Rules forprofile-safe code #1; Known Pitfalls → DO NOT hardcode
~/.hermespaths).Reachability: the
Nonebranch is hit when_default_spawn()callsresolve_profile_env()for a non-existent named profile (raisesFileNotFoundError, soHERMES_HOMEis never written to the child env —kanban_db.py:6652-6659) and the dispatcher process itself has noHERMES_HOMEin its environment.env.get("HERMES_HOME")is thenNoneand the probe scans the wrong directory.
Impact: on native Windows the bundled skill lives under
%LOCALAPPDATA%\hermes\skills\devops\kanban-worker\, but the probe lookedunder
%USERPROFILE%\.hermes\skills\…→ returnsFalse→--skills kanban-workeris silently dropped, so dispatched workers lose thepattern library (silent graceful-degradation regression).
Fix
Replace the hardcoded fallback with
get_default_hermes_root()— the sameplatform-aware helper this module already uses in
kanban_home()and atkanban_db.py:7480. WhenHERMES_HOMEis unset (the precondition for theNonebranch), it returns the platform-native default root, matching whatthe worker actually resolves. It is also side-effect-free (no warning
emission, unlike
get_hermes_home()).The misleading inline comment (which claimed the fallback is
~/.hermes)is updated to state the platform-native behavior.
How to test
Adds 4 regression tests in
tests/hermes_cli/test_kanban_db.py:test_worker_skill_probe_resolves_platform_default_on_windows— withHERMES_HOMEunset on simulated win32, the skill under%LOCALAPPDATA%\hermesresolves (True). Fails on the old code (itscanned the empty
~/.hermeshusk).test_worker_skill_probe_ignores_posix_husk_on_windows— a skill presentonly in
~/.hermesis not consulted on win32 (False).test_worker_skill_probe_resolves_posix_default_when_home_unset— POSIXfallback still resolves
~/.hermes(True).test_worker_skill_probe_honors_explicit_home— an explicithermes_homeis scanned directly, independent of platform.
The existing integration test
test_default_spawn_auto_loads_kanban_worker_skillstill passes.
Platforms tested
test_default_spawn_auto_loads_kanban_worker_skillpass;ruff checkclean. (Other pre-existing failures in the suite on native Windows are
unrelated POSIX-only tests —
os.symlinkprivilege,os.waitpidzombiereaping,
_resolve_hermes_argvshim resolution.)~/.hermes.Related
HERMES_HOMEresolution established in [Bug]: get_hermes_home() silently falls back to ~/.hermes in profile mode and causes cross-profile data corruption #18594 / fix: replace hardcoded ~/.hermes paths with get_hermes_home() for profile support #3575.