Skip to content

fix(skills): ~ and $HOME in skill config defaults resolve against the tool HOME (#12260, salvage #58227) - #109194

Merged
teknium1 merged 2 commits into
mainfrom
fix/skill-config-home-expansion
Sep 12, 2026
Merged

teknium1 merged 2 commits into
mainfrom
fix/skill-config-home-expansion

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Skill config defaults such as ~/wiki or $HOME/wiki now expand against the HOME Hermes injects into tool subprocesses (get_subprocess_home()), so the path injected into the prompt is the path the tools actually read.

Fixes #12260

Changes

  • agent/skill_utils.py: new _expand_skill_config_path() handles ~, ~/…, ~\…, $HOME and ${HOME} against the subprocess home when one is configured, then falls back to normal expanduser/expandvars (other variables unchanged). resolve_skill_config_values calls it for any value containing ~ or $.

Validation

Default (HERMES_HOME=/data, TERMINAL_HOME_MODE=profile) Before After
~/scratch <process HOME>/scratch /data/home/scratch
$HOME/wiki, ${HOME}/notes process HOME /data/home/wiki, /data/home/notes
${PROJECT_ROOT}/cache /proj/cache /proj/cache (unchanged)

scripts/run_tests.sh tests/agent/test_skill_utils.py → 24 passed; new test red on base.

Credit

Cherry-picked from #58227 by @tianma-if, the only candidate that also handles $HOME/${HOME} (the gap the reporter identified in #12273/#12284/#12331/#12736).

Root cause: os.path.expanduser answers for the control process, not for the tools the value is meant for.

Infographic

skill-config-home-expansion

@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on 93b7503 — fix(skills): literal HOME replacement; ~/$VAR still expand

⚠️ Warnings

OSV vulnerability scan · View job

80 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 5m7s vs 5m8s (-0.3%). 8 job(s) slower, 4 faster, 2 unchanged.

  • OS-specific tests / Windows-only tests: -25.0s
  • Python lints / Windows footguns (blocking): +15.0s
  • OS-specific tests / macOS-only tests: -12.0s
  • Detect affected areas: +6.0s
  • Profile artifact check / Reject profile archives: +5.0s

…iable

`re.sub` with the home path as a template string parsed backslashes as
escapes (re.error dropped the whole injected config block); use a callable.
The early `~/…` return also skipped `expandvars`, leaving `~/$LEAF` half
resolved. Prefix-substitute and fall through to normal expansion instead.
@teknium1
teknium1 merged commit 66dbb65 into main Sep 12, 2026
37 checks passed
@teknium1
teknium1 deleted the fix/skill-config-home-expansion branch September 12, 2026 15:26
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]: resolve_skill_config_values() uses wrong HOME semantics for ~ expansion — expands against Python process HOME instead of Hermes subprocess HOME

2 participants