fix(gateway): scrub worker scope from Windows root launches - #82964
Open
texasich wants to merge 1 commit into
Open
fix(gateway): scrub worker scope from Windows root launches#82964texasich wants to merge 1 commit into
texasich wants to merge 1 commit into
Conversation
Prevent Windows root gateway processes from inheriting delegated and Kanban worker ownership markers through generated CMD/VBS launchers, direct detached spawning, and the post-update restart watcher. Reuse the authoritative delegation-context marker definitions and preserve unrelated environment values.
Collaborator
texasich
marked this pull request as ready for review
August 10, 2026 06:47
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
agent.delegation_contextso launcher behavior follows the existing ownership authorityProblem
A Windows root gateway can be launched by a process that is currently operating as a delegated child or Kanban worker. The generated launchers, direct detached spawn path, and post-update restart watcher previously inherited those ownership markers unchanged.
The new root gateway could therefore misidentify itself as the parent worker instead of establishing a fresh root process boundary.
A harmless-child probe against current
mainobserved all ten seeded ownership markers in both generated launcher children. The same probe against this change observed none of them while preservingHERMES_HOMEand an unrelated sentinel variable.Changes
DELEGATED_CHILD_ENV_MARKER,KANBAN_ENV_KEYS, and the two legacy Kanban branch/worktree markersroot_gateway_subprocess_env(), which applies the normal gateway overlay and then removes ownership markers_spawn_detached()Verification
tests/hermes_cli/test_gateway_windows.py: 11 passedtests/hermes_cli/test_gateway.py: 10 passed, 5 skippedtests/hermes_cli/test_update_gateway_launcher_refresh.py: 2 passedgit diff --check: passedScope
hermes gateway runfrom inside a worker shell remains outside this change