fix: gateway respects terminal.cwd config and update preserves WorkingDirectory - #11441
Closed
kagura-agent wants to merge 1 commit into
Closed
fix: gateway respects terminal.cwd config and update preserves WorkingDirectory#11441kagura-agent wants to merge 1 commit into
kagura-agent wants to merge 1 commit into
Conversation
…gDirectory Two fixes for NousResearch#11312: 1. Gateway startup now calls os.chdir() after resolving TERMINAL_CWD so tools and child processes inherit the configured working directory. 2. refresh_systemd_unit_if_needed() reads the existing WorkingDirectory from the installed unit and preserves it when regenerating, so `hermes update` no longer overwrites user-customized paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing to reduce PR volume — I had too many open PRs on this repo. The fix is still valid; happy to resubmit later if there's interest. Apologies for the noise. |
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.
Fixes #11312
Problem
terminal.cwdconfig andTERMINAL_CWD/MESSAGING_CWDenv vars — processes always run in the gateway's own directoryhermes updateoverwrites the systemd service file, resetting any user-customizedWorkingDirectoryChanges
Fix 1 — Gateway CWD (
gateway/run.py)TERMINAL_CWDenv var, callos.chdir()so the gateway process uses the configured working directoryFix 2 — Update preserves WorkingDirectory (
hermes_cli/gateway.py)_read_working_directory_from_unit()to extract custom WorkingDirectory from installed systemd unitsgenerate_systemd_unit()now acceptsworking_dir_overrideparameterrefresh_systemd_unit_if_needed()andsystemd_unit_is_current()preserve existing WorkingDirectory when it differs from PROJECT_ROOTTests