fix(skills): keep inline shell in the routed profile env - #113975
Open
poijygfdyy wants to merge 2 commits into
Open
poijygfdyy wants to merge 2 commits into
poijygfdyy wants to merge 2 commits into
Conversation
poijygfdyy
marked this pull request as ready for review
September 17, 2026 08:11
Contributor
Swaps
|
10 tasks
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.
Invariant
A SKILL.md inline-shell expansion executed for a routed profile must spawn under that profile's child-process environment. It must not inherit the gateway/Desktop process-launch profile's
HERMES_HOME, credentials, or profile-specific.envsettings.Current-main RED
Audited against upstream
mainatbbaf7af5c83546d19f8060f4097d3bb25cd1a3c3; a final refresh after implementation still showed the same main SHA.agent.skill_preprocessing.run_inline_shell()currently callssubprocess.run(..., env=delegated_child_subprocess_env()). Outside a delegation/Kanban context,delegated_child_subprocess_env()returnsNone, sosubprocess.run()inherits the process-wideos.environ. In a multiplexed gateway/Desktop backend, that environment belongs to the launch profile even while the caller is scoped to another served profile.The first commit adds a focused regression for the real
run_inline_shell()spawn seam. It binds processHERMES_HOMEto a launch home, adds a launch-profile-only.envmarker, enters a different context-local served-home override, and captures the environment passed tosubprocess.run(). The contract requires an explicit child env with the servedHERMES_HOMEand without launch-profile-only residue. Current main passesenv=None, so the regression is deterministically RED from the current production mechanism.Merged #111617 independently identified this exact
agent/skill_preprocessing.pyspawn as an unfixed residual in its full subprocess/profile audit; it did not modify this path.Fix
Route the inline shell through the repository's existing served-profile child-env builder:
inherit_credentials=Trueis deliberate here. Inline shell is an explicitly enabled user skill feature and historically inherited the process environment; the fix preserves access to the active profile's intended credentials/settings while stripping launch-profile residue and pinningHERMES_HOMEto the routed profile. The builder also finalizes throughdelegated_child_subprocess_env(...), so existing delegation/Kanban environment fencing is preserved.Command execution, cwd, timeout, stdout/stderr handling, Windows creation flags, and inline-shell error semantics are otherwise unchanged.
Collision audit
Refreshed both before implementation and immediately before publication across open/recent/historical PRs, issues, commits, exact function names, root-cause terms, and the affected file.
run_inline_shell().served_profile_child_envarchitecture used here.CREATE_NO_WINDOW, not the child environment.A final PR search after the fix found no second implementation of the profile-env correction.
Final diff
Two commits, preserving
RED regression → production fix, and two files only:agent/skill_preprocessing.py: 2 additions / 2 deletions; replace the nullable delegation-only env with the served-profile child-env builder.tests/agent/test_skill_inline_shell_profile_env.py: 38-line focused regression for launch-home residue vs routed-profile ownership.The branch is 2 commits ahead and 0 behind the audited main SHA. No unrelated runtime behavior is included.
Validation
bbaf7af5c83546d19f8060f4097d3bb25cd1a3c3)env=Noneoutside delegation)Repository pytest/Ruff are not claimed: this execution environment does not have a repository checkout available for canonical test execution. For exact head
a6882652fd2abaccd7cfc4ad59f4141ad4d4440e, upstreamCI,Nix flake check, andDocker Build, Test, and Publishall currently concludeaction_required; no jobs executed behind the external-contributor approval gate, so no hosted-CI pass or failure is claimed.