fix(skills): profile-aware skills resolution in long-lived runtimes (#40677) - #60180
Merged
Conversation
…cal skill discovery (#40677) Profile-local skills are unavailable in Dashboard/TUI/Desktop GUI because the _SlashWorker subprocess is spawned with os.environ.copy() but does NOT receive the profile-specific HERMES_HOME from the parent session. This causes the subprocess to search ~/.hermes instead of the active profile's skills directory. 1. Modify _SlashWorker.__init__ to accept optional profile_home parameter 2. When profile_home is provided, set env['HERMES_HOME'] = profile_home before spawning the subprocess 3. Update all 4 call sites to pass profile_home=session.get('profile_home') 4. Add regression tests for profile-home propagation - Full TUI gateway test suite: 107 tests pass - New tests cover: - profile_home parameter acceptance - backward compatibility (None, omitted) - argv correctness Fixes #40677
Same bug class as skills_tool: module-level SKILLS_DIR pinned at import under the launch HERMES_HOME makes skill_manage() write/edit against the wrong profile in long-lived multi-profile runtimes. Apply the same _skills_dir() call-time resolution (honoring explicit test patches of SKILLS_DIR) to _containing_skills_root, _resolve_skill_dir, _find_skill_in_other_profiles, and create-result path reporting. Refs #40677
_SlashWorker call sites now pass profile_home=; the fakes' 2-arg __init__ raised TypeError inside the spawn guard, leaving slash_worker=None and failing the orphan-race regression tests.
teknium1
force-pushed
the
hermes/hermes-bae45bfd
branch
from
July 7, 2026 11:32
18b0e0a to
604d6ab
Compare
This was referenced Jul 7, 2026
This was referenced Jul 7, 2026
1 task
19 tasks
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.
Summary
Profile-local skills now resolve correctly in long-lived multi-profile runtimes (Dashboard/TUI/Desktop backend): the skills tools resolve the active profile's skills directory at call time, and slash-command worker subprocesses inherit the session's profile
HERMES_HOME. Fixes #40677.Root cause:
tools/skills_tool.pyandtools/skill_manager_tool.pypinnedSKILLS_DIRat module import (backend boot, launch profile), and_SlashWorkerspawned children with the gateway's env — so every session read/wrote the launch profile's skills regardless of the profile bound to the session.Salvages PR #56689 (@jplew) and PR #40959 (@iamlukethedev) with authorship preserved, plus a widening commit for the sibling site.
Changes
tools/skills_tool.py:_skills_dir()resolves from liveget_hermes_home()per call (honors explicitSKILLS_DIRmonkeypatches); wired throughskills_list,skill_view, category detection, trusted-dir check, rel-path reporting. (@jplew, cherry-picked)tui_gateway/server.py:_SlashWorkeracceptsprofile_homeand setsHERMES_HOMEin the child env; all 4 spawn sites passsession.get("profile_home"). Reapplied onto the currenthermes_subprocess_env(inherit_credentials=True)env builder. (@iamlukethedev, cherry-picked)tools/skill_manager_tool.py: same call-time resolution applied toskill_managepaths (_containing_skills_root,_resolve_skill_dir,_find_skill_in_other_profiles, create-result path) — sibling-site widening.tests/tools/test_skills_tool_profile_scope.py(3),tests/tui_gateway/test_slash_worker_profile_home.py(4).Validation
tests/tools/skills suites (6 files)tests/tui_gateway/full directoryset_hermes_home_overrideContextVar path both resolve profile skills;skill_manage createwrites to active profile homeInfographic