Conversation
When a multiplexed gateway routes a turn to a secondary profile, only hermes_home and secret scope were switched — TERMINAL_* env vars still carried the gateway profile's backend. A profile with terminal.backend: docker silently ran commands on the gateway's local backend. Bridge the routed profile's terminal: section into os.environ inside _profile_runtime_scope, save the originals, and restore them when the scope exits so the next turn's profile sees its own terminal config.
|
Heads up — this and #79117 both target #68559 (terminal config leaking across routed profiles), and a reviewer asked us to consolidate around one approach. I've folded the coverage here into #79117: it uses a ContextVar terminal-config scope and routes every |
|
Thanks for this PR. Merged via #101242 (4a7f228) on current main — routed multiplex profiles get their own terminal cwd/backend/docker config; container boot honors config multiplex_profiles. #101242 won as the consolidated fix because it covers the whole multiplex-profile bug class in one change (with tests) rather than the single symptom addressed here; this PR is superseded by it. If anything from your original change is still missing on main >= 4a7f228, please open a fresh PR/issue against main and tag it. Thanks again. |
Bug
When a multiplexed gateway routes a turn to a secondary profile, only
hermes_homeand the secret scope were switched. TheTERMINAL_*env vars still carried the gateway profile's backend. A routed profile withterminal.backend: dockersilently ran commands on the gateway's local backend — the sandbox was never entered.Fix
Bridge the routed profile's
terminal:section from itsconfig.yamlintoos.environinside_profile_runtime_scope. Save the originalTERMINAL_*values before bridging and restore them when the scope exits, so the next turn's profile sees its own terminal config.