Repository navigation
Use a fixed executable for Pi sub-agent launches - #77474
Conversation
Co-authored-by: gh-aw-bot <[email protected]>
PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
❌ PR Specification Reviewer failed to deliver outputs. Please review the logs for details. PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found two blocking issues on the changed launch line: the bare pi name remains PATH-controlled, so the claimed executable hardening is incomplete; and ignoring GH_AW_PI_COMMAND breaks consistency with the parent runtime and custom Pi configurations. Inline comments provide the impact and remediation.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| ); | ||
| return await new Promise((resolve, reject) => { | ||
| const child = launch(process.env.GH_AW_PI_COMMAND || "pi", subagentArgs(agent, promptPath), { | ||
| const child = launch("pi", subagentArgs(agent, promptPath), { |
There was a problem hiding this comment.
This changes delegated execution to ignore the configured GH_AW_PI_COMMAND, even though the parent runtime still uses that setting for its verified/custom Pi binary. Workflows using a custom command will now silently run a different executable for sub-agents (or fail if pi is not on PATH), creating inconsistent behavior between parent and child. Please preserve the configured command via a trusted/validated resolution rather than dropping the setting outright.
There was a problem hiding this comment.
Sub-agents now use the canonical absolute path resolved from the configured Pi command, preserving custom executables. Fixed in 5fc78d5f.
| ); | ||
| return await new Promise((resolve, reject) => { | ||
| const child = launch(process.env.GH_AW_PI_COMMAND || "pi", subagentArgs(agent, promptPath), { | ||
| const child = launch("pi", subagentArgs(agent, promptPath), { |
There was a problem hiding this comment.
spawn("pi", ...) still resolves the executable through PATH; removing GH_AW_PI_COMMAND therefore does not make the binary trusted. A workflow or prior step can prepend a writable directory containing a malicious pi, and this child will execute it with the inherited environment. Please resolve the managed Pi binary to an absolute, validated path during setup and spawn that path (or otherwise explicitly constrain PATH) so this change actually closes the command-selection vulnerability.
There was a problem hiding this comment.
The extension resolves Pi once to its real absolute path during setup and captures it for child launches, so later PATH changes cannot redirect sub-agents. Fixed in 5fc78d5f.
There was a problem hiding this comment.
🟡 Changes recommended
Sub-agent launches bypass the supported GH_AW_PI_COMMAND setting, breaking configurations with custom executables outside PATH and causing the attribution test to fail or invoke the real CLI.
2 open issues
What changed in this PR
This PR hardens executable selection for gh-aw’s Pi sub-agents while preserving separate arguments, disabled shell execution, and task input through stdin.
Changes:
- Launch sub-agents with the fixed
picommand instead ofGH_AW_PI_COMMAND. - Update regression tests to verify overrides are ignored and locate child-process fixtures through
PATH.
| File | Description |
|---|---|
actions/setup/js/pi_subagent_extension.test.cjs |
Checks fixed-command behavior and migrates executable fixtures to PATH. |
actions/setup/js/pi_subagent_extension.cjs |
Replaces the environment-selected executable with literal pi. |
Review effort: Max (dynamic)
| ); | ||
| return await new Promise((resolve, reject) => { | ||
| const child = launch(process.env.GH_AW_PI_COMMAND || "pi", subagentArgs(agent, promptPath), { | ||
| const child = launch("pi", subagentArgs(agent, promptPath), { |
There was a problem hiding this comment.
Migrated the attribution fixture to a pi executable on a stubbed PATH; the real-process attribution test now passes. Fixed in 5fc78d5f.
| ); | ||
| return await new Promise((resolve, reject) => { | ||
| const child = launch(process.env.GH_AW_PI_COMMAND || "pi", subagentArgs(agent, promptPath), { | ||
| const child = launch("pi", subagentArgs(agent, promptPath), { |
There was a problem hiding this comment.
The configured Pi executable is resolved to an absolute path and captured for sub-agent launches, preserving custom commands outside PATH. Fixed in 5fc78d5f.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design and /diagnosing-bugs. The security direction is right: the fixed "pi" plus shell: false and stdin task delivery remove the override from the sub-agent launch path. Requesting changes because the fix has a behavior gap.
📋 Key Themes & Highlights
Key Themes
- Dropped
engine.commandfor sub-agents:pi_engine_config.gosetsGH_AW_PI_COMMANDfromengine.command. The parent still honors it, but sub-agents now launch a differentpifrom PATH. This is inconsistent and undocumented. - Test stub left behind:
awf_caller_attribution.test.cjs(pi_main_and_subagent_caller_attribution) still stubsGH_AW_PI_COMMANDand callsrunPiSubagent. It now runs the realpifrom PATH instead of the fake executable, so it will likely fail or hit the wrong binary. I could not run the suite becausenpm ciis blocked by the sandbox TLS proxy, so this is from static reading. - PATH-based tests: the new tests prepend the temp dir to
PATH, which still depends on environment resolution. They do not exercise a pinned executable.
Positive Highlights
- ✅
shell: falseand stdin-only task text are preserved and well covered by the shell-injection test. - ✅ The attacker-override test asserts the command is exactly
pi, which is a clear regression guard.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| ); | ||
| return await new Promise((resolve, reject) => { | ||
| const child = launch(process.env.GH_AW_PI_COMMAND || "pi", subagentArgs(agent, promptPath), { | ||
| const child = launch("pi", subagentArgs(agent, promptPath), { |
There was a problem hiding this comment.
[/codebase-design] Sub-agents now ignore GH_AW_PI_COMMAND, which pi_engine_config.go sets from engine.command. The parent Pi process still honors it (pi_runtime.cjs version check, pi_session_export.cjs, pi_agent_core_driver.cjs), so a custom engine command runs the parent but launches a different pi from PATH for sub-agents. Bare-name spawn also resolves through env.PATH, which is still environment-controlled, so the override is moved rather than removed.
💡 Suggested fix
Resolve the executable once in the parent to an absolute path (the same binary pi_runtime.cjs verifies) and pass that path to sub-agent launches, so every Pi launch uses one resolved binary. If the engine.command override should not apply to sub-agents, document that explicitly.
@copilot please address this.
There was a problem hiding this comment.
Added a shared executable resolver used by version verification and captured its absolute result during extension setup, keeping custom commands consistent and immune to later PATH changes. Fixed in 5fc78d5f.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "7d68ca441e84701485188a72ea3d5680f9b87e70",
"kind": "requested",
"schema_version": "1",
"state": "4d7eeff6cfb4addd967d0cb8617e404890327dc2b4776f5e6810e91209ac536d",
"work": [
"2ec1c55a56c3bbc3d439b0f0d819e0f964a9c8ea5c8bbe45cc9676c7e7802a18",
"8bba9b96c07d42363ec8c94b98f4bf3c762909b6960b57b3f39adf250466b253",
"b942bebdf0eedc235a53ee8a0ac9bb3a4e173ec17b75259a62774ac1c2bcff83",
"c7cf93e497befdd5e698d00101b0703e4101fe4133d86d433f7c170d07402b7e",
"d9cc08d9273b4c5b8d8d29ecce0602e2a5a0920d5e3db1a3425b6dbafc01d7bc",
"e9c493b14202804e3c442e04e4e87c86cb7acc299d04810453dd4707c6770716"
],
"workflow": "pr-sous-chef"
}
|
…curity-findings Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
Merged latest |
Co-authored-by: gh-aw-bot <[email protected]>
|
🎉 This pull request is included in a new release. Release: |

The scan flagged command-injection risks in pip/uv validation and Pi sub-agent execution. Pi sub-agents now launch a fixed executable; the pip/uv paths already validate executable paths and package names, pass arguments directly, and use
--.