Repository navigation
Conversation
When running under a Hermes multiplex gateway each profile is scoped via a context-local home override (hermes_constants.get_hermes_home()), not via os.environ["HERMES_HOME"]. The plugin read only the env var, so under multiplex it fell back to the platform default and read the root config.yaml (no github_app section), raising 'missing GitHub App client ID'. Use hermes_constants.get_hermes_home() when available (in-process / multiplex gateway) and fall back to the env var for the standalone CLI. The module is imported via importlib so no hard dependency is introduced.
JWhitleyWork
self-requested a review
November 10, 2026 19:06
Member
|
Sorry I didn't see this until now. Thank you for the fix! |
Member
|
Non-blocking suggestion: please add regression tests in Useful cases:
The implementation looks correct; these tests would protect the multiplex-profile fix from regressions. Written by AI. |
This branch has not been deployed
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
Fixes config resolution so the plugin honors the profile-scoped Hermes home directory (as set by the multiplex gateway) rather than only the process-level
HERMES_HOMEenv var.Problem
config.py'shermes_home()returnedos.environ.get("HERMES_HOME", ...). Under a Hermes gateway running multiplexed profiles, each profile is scoped through a context-local home override (hermes_constants.get_hermes_home()), not throughos.environ["HERMES_HOME"]. Since that env var is not set per profile under multiplex,hermes_home()fell back to the platform default andconfig_path()read the rootconfig.yaml— which has nogithub_appsection. Every multiplexed agent then failed with:even when each profile had a valid
github_appblock in its ownconfig.yaml. This affects any value read from the home-scopedconfig.yaml, not just GitHub App credentials.Solution
Use
hermes_constants.get_hermes_home()when the module is importable (i.e. when the plugin runs inside a Hermes process / multiplex gateway). It resolves in the correct order: context override →HERMES_HOMEenv var → platform default. When the module is unavailable (e.g. the standalone CLI, launched outside the Hermes source tree), fall back to the previous env-var behavior so the CLI is unchanged.The module is loaded via
importliband accessed through a typedcast, so no hard dependency onhermes_constantsis introduced and the existing strict type-checking passes.Why this is safe
hermes_constantsis already on the import path and is what the rest of the codebase uses for home resolution, so this aligns with existing conventions.Testing
hermes-github-app statusstill loads config correctly whenHERMES_HOMEis set (CLI behavior unchanged).load_config()now resolves the correct profile'sgithub_appsection; previously it raised the missing-client-ID error.Checks
ruff format --checkruff checkmypy(strict)pytest(17 passed)