fix(hermes): run launched hermes in the user's real ~/.hermes (not isolated)#20
Merged
Conversation
#17 launched hermes against an isolated HERMES_HOME, which ignored the user's own skills, toolsets, agent preferences, and other providers. Run in the real ~/.hermes instead and add the opper model/provider block + the provider plugin transiently: snapshot config.yaml (whole-file backup via the backup util, restored on exit) and save/restore the plugin files, so a launch leaves the user's config exactly as it was while still giving session grouping + provider affinity via the plugin. Verified live: a one-shot launch over a real ~/.hermes preserved the user's config.yaml (model + toolsets) and removed the plugin on exit, and still produced a `session` root trace. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
opper launch hermesnow runs in the user's real~/.hermesinstead of an isolatedHERMES_HOME, so the user's own skills, toolsets, agent preferences, and other providers all load. The Opper bits (theoppermodel/provider block and the provider plugin) are added transiently and restored on exit.How
hermesHome()resolvesprocess.env.HERMES_HOME ?? ~/.hermesand we run hermes against it (no isolated dir, noHERMES_HOMEoverride to a managed path).config.yamlis whole-file snapshotted (viautil/backup.tstakeSnapshot/restoreSnapshot, withrotateBackups) before we write theoppermodel+providers.opperblocks, and restored on exit. If there was no config, the one we write is deleted. The api key goes viaOPPER_API_KEYenv, never to disk.~/.hermes/plugins/model-providers/opper/and restored on exit: pre-existing files are captured and put back; a dir we created is removed. So a one-off launch leaves the user's plugins untouched.unconfiguredrops a leftover plugin dir defensively (in case a launch was killed before restore).The session grouping + provider affinity (the #17 plugin emitting
X-Opper-Trace-Id/X-Opper-Parent-Span-Id) are unchanged.Test
tsc --noEmitclean; full suite green (372). Hermes tests assert: oppermodel+providers.opper+ plugin written mid-launch, realHERMES_HOME+OPPER_API_KEYon the env, a one-off launch leaves nothing behind, and a pre-existing config.yaml + plugin are restored verbatim (including whenrun()throws).~/.hermes(seeded with a usermodel+toolsets) preserved that config, removed the plugin on exit, and still produced asessionroot trace.Related
Companion to the pi change (#19), which applies the same "use the user's real home" principle to
opper launch pi.🤖 Generated with Claude Code