Repository navigation
Fix Pi sub-agent smoke workflow model selection and completion - #66805
Conversation
Use provider-qualified model IDs to avoid alias collisions and replace the unavailable GPT-5 nano model with the advertised GPT-4o mini model. Update the smoke regression to exercise the colliding mini alias and current inventory. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Do not reopen completed turns with time-pressure steering. Scope child reporting to delegated task results while retaining task-required safe outputs and inherited controls. Make smoke answers explicitly plain text and tool-free, with regressions and documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed for PR #66805: the PR does not carry the 'implementation' label (has_implementation_label=false) and has 0 new lines in default business logic directories (threshold: 100, no custom .design-gate.yml). Evidence: /tmp/gh-aw/agent/adr-prefetch-summary.json.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
🧠 Matt Pocock Skills Reviewer failed during the skills-based review.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
There was a problem hiding this comment.
🟡 Changes recommended
Terminal error turns can still be reopened, and audit evidence fails to recognize two pinned models.
2 open findings
What changed in this PR
This PR improves Pi sub-agent smoke-test model selection, completion handling, and reporting ownership.
Changes:
- Pins provider-qualified models and replaces the unavailable nano model.
- Prevents normal completed turns from receiving timeout steering.
- Adds delegation guidance, tests, documentation, and regenerated workflow output.
| File | Description |
|---|---|
docs/src/content/docs/engines/pi.md |
Documents child completion behavior. |
actions/setup/js/pi_subagent_extension.test.cjs |
Tests delegation and model selection. |
actions/setup/js/pi_subagent_extension.cjs |
Adds child reporting boundaries. |
actions/setup/js/pi_steering_extension.test.cjs |
Tests completed-turn steering behavior. |
actions/setup/js/pi_steering_extension.cjs |
Skips steering after normal completion. |
.github/workflows/smoke-pi-sub-agents.md |
Pins smoke models and responses. |
.github/workflows/smoke-pi-sub-agents.lock.yml |
Regenerates the compiled workflow. |
.changeset/fix-pi-smoke-completion.md |
Records the patch release changes. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
| GH_AW_COMPILED_STRICT: "true" | ||
| GH_AW_INFO_FEATURES: '{"gh-aw-detection":false}' | ||
| GH_AW_INFO_SUB_AGENT_MODELS: "[{\"model\":\"claude-haiku-4.5\",\"name\":\"haiku-whoami\",\"patterns\":[\"github-copilot/claude-haiku-4.5\"]},{\"model\":\"gpt-5-mini\",\"name\":\"mini-whoami\",\"patterns\":[\"github-copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"]},{\"model\":\"gpt-5-nano\",\"name\":\"nano-whoami\",\"patterns\":[\"github-copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"]}]" | ||
| GH_AW_INFO_SUB_AGENT_MODELS: "[{\"model\":\"copilot/claude-haiku-4.5\",\"name\":\"haiku-whoami\",\"patterns\":[\"github-copilot/claude-haiku-4.5\"]},{\"model\":\"copilot/gpt-5-mini\",\"name\":\"mini-whoami\",\"patterns\":[\"github-copilot/gpt-5-mini\"]},{\"model\":\"copilot/gpt-4o-mini\",\"name\":\"compact-whoami\",\"patterns\":[\"github-copilot/gpt-4o-mini\"]}]" |
There was a problem hiding this comment.
Audit matching now recognizes the canonical dated Copilot IDs, including Claude’s hyphenated version, and has regression coverage. Pushed as 1994aa9.
| pi.on("turn_end", async (/** @type {any} */ _event, /** @type {any} */ ctx) => { | ||
| if (startTime === undefined) { | ||
| pi.on("turn_end", async (/** @type {any} */ event, /** @type {any} */ ctx) => { | ||
| if (startTime === undefined || event.message?.stopReason === "stop") { |
There was a problem hiding this comment.
Deadline steering now runs only when stopReason === "toolUse"; tests cover stop, error, aborted, unknown, and missing reasons. Pushed as 1994aa9.
There was a problem hiding this comment.
Verdict
Blocking: the child-session completion fix is still prompt-only, and the new smoke regression does not actually assert the prompt constraints that are meant to keep the failure from coming back.
Key issues
actions/setup/js/pi_subagent_extension.cjs:41-44still leaves the completion/noop path technically available inside child sessions, so the original regression can recur when a delegated model ignores or reinterprets the added instruction.actions/setup/js/pi_subagent_extension.test.cjs:177-240only checks the selected model and returned text; it never inspects the generated prompt, so removing the newplain-text only/Do not call toolsconstraints would not fail this test.
The grumpy-coder sub-agent failed before producing output, so this review is based on the diff and local source inspection only.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 45.3 AIC · ⌖ 5.68 AIC · ⊞ 19.8K
Comment /review to run again
There was a problem hiding this comment.
Impeccable review: harden + audit (bug_fix/correctness)
Scope: .github/workflows/smoke-pi-sub-agents.md, pi_steering_extension.cjs, pi_subagent_extension.cjs, docs, changeset, and tests.
Verification performed
- Ran
vitestonpi_steering_extension.test.cjsandpi_subagent_extension.test.cjsat the PR head (fe36b03): all 21 tests pass. - Traced
event.message?.stopReason === "stop"guard inpi_steering_extension.cjsagainst the test added in the same commit — correctly skips steering on a completed assistant turn while still steering ontoolUseturns, matching the documented v1 Pi event schema (stopReasonenum used consistently elsewhere, e.g.pi_agent_core_driver.cjs,pi_rpc_driver.cjs). - Confirmed
copilot/gpt-5-miniandcopilot/gpt-4o-miniare provider-qualified (not bare aliases), soresolveModelAliasinpi_subagent_config.cjscannot resolve them to a newergpt-5.4-mini/similar alias match — this directly fixes the reported model-selection bug. - Confirmed the
delegationScopetext appended to each sub-agent's system prompt inpi_subagent_extension.cjsis only advisory (prompt convention), not an enforced technical control;GH_AW_PI_SUBAGENT_CHILD=1is the actual mechanism that short-circuitspiSubagentExtensionregistration in child sessions (pi_subagent_extension.cjs:161), so the "no noop/completion in child" behavior is backed by code, not only prompt text. No issue — just confirming the design is sound. - Docs update in
docs/src/content/docs/engines/pi.mdaccurately describes the new behavior.
Result: No blocking issues found. Changes are minimal, consistent with existing conventions (logger, test harness patterns), and backed by passing unit tests plus the PR description's hosted Actions verification.
No inline comments added — changed lines are correctness-focused infra/test code with adequate coverage.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 132.8 AIC · ⌖ 13.2 AIC · ⊞ 8.1K
There was a problem hiding this comment.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 175.9 AIC · ⌖ 14.4 AIC · ⊞ 10.1K
Comment /matt to run again
| fs.writeFileSync(promptPath, system + agent.prompt, { mode: 0o600 }); | ||
| const delegationScope = | ||
| "You are a delegated sub-agent, not the workflow's main agent. Complete only the delegated task and return your answer to the parent, following the declared agent's output format exactly. " + | ||
| "The parent is responsible for finalizing the workflow and its required safe-output reporting. Do not emit noop safe outputs or workflow-completion reports for this child session. " + |
There was a problem hiding this comment.
[/diagnosing-bugs] This fix relies entirely on prompt text ("Do not emit noop safe outputs or workflow-completion reports") rather than structural enforcement. The codebase already has a working pattern for this exact scenario one line above: GH_AW_PI_SUBAGENT_CHILD env var gates piSubagentExtension registration structurally. A model can ignore prompt instructions.
💡 Why this matters and a possible structural fix
The root cause of the original bug ("staged report FAIL despite green Actions... aborted compact child") was that children could independently trigger workflow-completion/noop safe outputs. Pinning this down with a text instruction treats the symptom, not the mechanism. Since GH_AW_PI_SUBAGENT_CHILD=1 is already set in the child's env (line 52), consider filtering/disabling the noop/completion-reporting tool(s) from the child's MCP tool list when that env var is set, the same way piSubagentExtension itself is disabled for children. This would make the constraint unbypassable regardless of what the model decides to do with the extra prompt text.
If a structural fix is infeasible for this PR (e.g. tool registration happens in a separate process/extension not easily reached here), it would help to note in the PR description or a code comment why prompt-only mitigation was chosen, and whether gh aw audit/tests can detect a regression if a child does emit a completion report despite the instruction.
@copilot please address this.
There was a problem hiding this comment.
The child Pi tool policy now blocks noop and incomplete-reporting tools while leaving task safe outputs available. The existing prompt assertions remain, with added policy regression coverage. Pushed as 1994aa9.
|
@copilot run or-finisher skill |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Finished the PR-finisher pass: addressed the review feedback and pushed |
|
Hey @pelikhan 👋 — thanks for this fix! This PR is well-aligned with the project guidelines: a focused change with regression tests and a clear description. Ready for review.
|
|
🎉 This pull request is included in a new release. Release: |

Summary
gpt-5-minicannot resolve to the newergpt-5.4-minialias match; replace the unavailable nano target with advertisedgpt-4o-mini.noopreporting to the parent, preserving inherited controls and task-required safe outputs in children.Actions debugging
maingpt-5.4-mini. Pi 1.0.0 installed successfully on Actions.fe36b03733Final hosted assertions confirm exactly one sequential dispatch and one successful answer per child:
claude-haiku-4.5,gpt-5-mini, andgpt-4o-mini. The only safe output was the staged PASS issue report; there were nonoopor incomplete messages and no real issue was created. The final run SHA matches the published PR head.Validation
make recompile: all 328 workflows compiled; generated locks remained in sync.make fmt-cjsandmake lint-cjs: passed; inherited lint warnings remain unchanged.make agent-report-progress: passed, including 21 focused JavaScript regressions, typechecking/lint, schema freshness, and workflow drift. No changed Go files; impacted Go tests were skipped.gh aw compile --dry-run: passed strict validation, native shellcheck and model checks with zero smoke-workflow warnings. Optional Docker scanners were not run.Kept as a draft as requested.