Repository navigation
Fix Pi sub-agent smoke workflow model selection and completion #66805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
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>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,11 @@ async function runPiSubagent(agent, task, ctx, signal, launch = spawn) { | |
| const promptPath = path.join(dir, "system.txt"); | ||
| const systemPath = process.env.GH_AW_PI_SYSTEM_PROMPT; | ||
| const system = systemPath ? fs.readFileSync(systemPath, "utf8") + "\n\n" : ""; | ||
| 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. " + | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/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: 💡 Why this matters and a possible structural fixThe root cause of the original bug ("staged report FAIL despite green Actions... aborted compact child") was that children could independently trigger workflow-completion/ 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 @copilot please address this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The child Pi tool policy now blocks |
||
| "Safe-output actions required to perform the delegated task remain permitted."; | ||
| fs.writeFileSync(promptPath, system + agent.prompt + "\n\n" + delegationScope, { mode: 0o600 }); | ||
| process.stdout.write(JSON.stringify({ type: "gh_aw_subagent_dispatch", agent: agent.name, requested_model: agent.declaredModel || agent.modelId, resolved_model: agent.modelId }) + "\n"); | ||
| return await new Promise((resolve, reject) => { | ||
| const child = launch(process.env.GH_AW_PI_COMMAND || "pi", subagentArgs(agent, promptPath), { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deadline steering now runs only when
stopReason === "toolUse"; tests cover stop, error, aborted, unknown, and missing reasons. Pushed as1994aa9.