Skip to content

Pin multiplex session cwd to the serving profile home - #90058

Closed
vKongv wants to merge 1 commit into
NousResearch:mainfrom
pebble-tech:fix/multiplex-session-cwd-profile-home
Closed

vKongv wants to merge 1 commit into
NousResearch:mainfrom
pebble-tech:fix/multiplex-session-cwd-profile-home

Conversation

@vKongv

@vKongv vKongv commented Aug 19, 2026

Copy link
Copy Markdown

Summary

Under gateway.multiplex_profiles, get_hermes_home() already remaps to the serving profile for config, skills, memory, and SOUL. Session cwd did not. TERMINAL_CWD is bridged once from the default profile at process start, so a secondary-profile first prompt injects the default profile's project AGENTS.md.

_set_session_env now passes cwd=str(get_hermes_home()) when multiplexing is on. Single-profile gateways are unchanged (cwd stays unset and still falls through to TERMINAL_CWD / launch cwd).

Changes

  • gateway/run.py: pin session cwd from get_hermes_home() under multiplex
  • tests/gateway/test_session_env.py: multiplex pins to the override home; non-multiplex leaves cwd unset

Tests

  • pytest tests/gateway/test_session_env.py

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery area/profiles Multi-profile isolation, HERMES_HOME scoping sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Aug 19, 2026
@vKongv
vKongv force-pushed the fix/multiplex-session-cwd-profile-home branch from 7b89c56 to 75a8e6c Compare August 20, 2026 03:53
@vKongv
vKongv force-pushed the fix/multiplex-session-cwd-profile-home branch from 75a8e6c to 3a3cb47 Compare August 21, 2026 03:56
@Enough1122

Copy link
Copy Markdown

AI code review — automated review; please use your judgment.

Correct root-cause fix with a tight blast radius: only multiplexed gateways pin cwd to the serving profile home (via the per-turn get_hermes_home() remap), single-profile gateways keep the existing TERMINAL_CWD fall-through untouched, and both behaviors are pinned end-to-end through resolve_context_cwd() including cleanup via _clear_session_env.

No blocking issues found.

Nit (gateway/run.py:~24433–24438): the except Exception: cwd = "" silently reverts to the buggy cross-profile cwd if get_hermes_home() ever raises mid-remap; a logger.debug(..., exc_info=True) would keep such a failure findable, since its symptom (wrong AGENTS.md injected) points nowhere near this line.

— reviewer-a · automated agent review (Hermes week-review)

@vKongv
vKongv force-pushed the fix/multiplex-session-cwd-profile-home branch from 3a3cb47 to ca3c06b Compare August 23, 2026 03:56
@vKongv
vKongv force-pushed the fix/multiplex-session-cwd-profile-home branch from ca3c06b to ce7723c Compare August 25, 2026 03:55
@vKongv
vKongv force-pushed the fix/multiplex-session-cwd-profile-home branch from ce7723c to 50e47c7 Compare August 27, 2026 11:21
@vKongv
vKongv force-pushed the fix/multiplex-session-cwd-profile-home branch from 50e47c7 to 67454e9 Compare August 27, 2026 14:04
TERMINAL_CWD is bridged once from the default profile at process start.
Under multiplex, get_hermes_home() already remaps to the serving profile
for SOUL, config, and skills. Set session cwd from that home so the first
prompt injects the serving profile AGENTS.md instead of the default one.
cursor Bot pushed a commit to pebble-tech/hermes-agent that referenced this pull request Sep 7, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 9, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 9, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 9, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 9, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 10, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 10, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 10, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 10, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 11, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 11, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 11, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 11, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 11, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 11, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 11, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 11, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 14, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 14, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 14, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 14, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 15, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 15, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 15, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 15, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 17, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 17, 2026
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 17, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
vKongv added a commit to pebble-tech/hermes-agent that referenced this pull request Sep 17, 2026
cursor Bot pushed a commit to pebble-tech/hermes-agent that referenced this pull request Sep 19, 2026
…CHES (#62)

Carry Nous NousResearch#90058 so multiplex turns pin session cwd to the serving
profile home instead of the process-wide TERMINAL_CWD bridge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/profiles Multi-profile isolation, HERMES_HOME scoping comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants