diff --git a/entry b/entry index 2e2104d..9b4a0ac 100755 --- a/entry +++ b/entry @@ -141043,7 +141043,9 @@ async function checkoutPrBranch(pullNumber, params) { log.debug(`already on PR branch ${localBranch}, skipping checkout`); } else { log.debug(`\xBB fetching base branch (${baseBranch})...`); - $git("fetch", ["--no-tags", "origin", baseBranch], { + const isShallow = $("git", ["rev-parse", "--is-shallow-repository"], { log: false }).trim(); + const baseFetchArgs = isShallow === "true" ? ["--deepen=1000", "--no-tags", "origin", baseBranch] : ["--no-tags", "origin", baseBranch]; + $git("fetch", baseFetchArgs, { token: gitToken, restricted: shell !== "enabled" }); @@ -141058,7 +141060,9 @@ async function checkoutPrBranch(pullNumber, params) { } if (alreadyOnBranch) { log.debug(`\xBB fetching base branch (${baseBranch})...`); - $git("fetch", ["--no-tags", "origin", baseBranch], { + const isShallow = $("git", ["rev-parse", "--is-shallow-repository"], { log: false }).trim(); + const baseFetchArgs = isShallow === "true" ? ["--deepen=1000", "--no-tags", "origin", baseBranch] : ["--no-tags", "origin", baseBranch]; + $git("fetch", baseFetchArgs, { token: gitToken, restricted: shell !== "enabled" }); @@ -143145,7 +143149,7 @@ var SetOutputParams = type({ function SetOutputTool(ctx) { return tool({ name: "set_output", - description: "Set the action output. When called by a subagent, returns a summary result to the orchestrator. When called in standalone mode, exposes the value as the 'result' GitHub Action output.", + description: "Set the action output. When called by a subagent, returns a summary result to the orchestrator \u2014 this is the ONLY way to pass results back. When called by the orchestrator in standalone mode (trigger: unknown), exposes the value as the 'result' GitHub Action output for downstream workflow steps. Do NOT use this for progress reporting \u2014 use report_progress instead.", parameters: SetOutputParams, execute: execute(async (params) => { const selfId = ctx.toolState.selfSubagentId; @@ -147359,8 +147363,6 @@ To investigate questions, prefer \`${ghPullfrogMcpName}/ask_question\` over \`${ After each \`delegate\` call, you receive a \`results\` array \u2014 one entry per task with \`label\`, \`success\`, \`summary\` (from set_output), and \`stdoutFile\` (inspectable via \`${ghPullfrogMcpName}/file_read\`). Follow the post-delegation steps from the select_mode guidance. -When all delegations are complete, call \`${ghPullfrogMcpName}/set_output\` with the final result. This makes it available as the GitHub Action output. - ### Subagent capabilities Subagents have: file operations, shell (for local git, tests, builds), read-only GitHub queries, and upload_file. They do NOT have: \`git\`, \`checkout_pr\`, \`push_branch\`, \`create_pull_request\`, \`create_pull_request_review\`, \`report_progress\`, \`create_issue_comment\`, \`reply_to_review_comment\`, \`resolve_review_thread\`, \`delegate\`, \`ask_question\`, or any dependency/remote-mutating tools. All GitHub-write and state-mutating operations are your responsibility. diff --git a/mcp/checkout.ts b/mcp/checkout.ts index ac0c864..2237a23 100644 --- a/mcp/checkout.ts +++ b/mcp/checkout.ts @@ -214,9 +214,17 @@ export async function checkoutPrBranch( if (alreadyOnBranch) { log.debug(`already on PR branch ${localBranch}, skipping checkout`); } else { - // fetch base branch so origin/ exists for diff operations + // fetch base branch so origin/ exists for diff operations. + // deepen if shallow — actions/checkout uses depth=1 by default, which + // breaks rebase/log operations because git can't find the merge base + // between the shallow base and the fully-fetched PR branch. log.debug(`» fetching base branch (${baseBranch})...`); - $git("fetch", ["--no-tags", "origin", baseBranch], { + const isShallow = $("git", ["rev-parse", "--is-shallow-repository"], { log: false }).trim(); + const baseFetchArgs = + isShallow === "true" + ? ["--deepen=1000", "--no-tags", "origin", baseBranch] + : ["--no-tags", "origin", baseBranch]; + $git("fetch", baseFetchArgs, { token: gitToken, restricted: shell !== "enabled", }); @@ -241,7 +249,12 @@ export async function checkoutPrBranch( // fetch if we skipped checkout (already on branch) - otherwise already fetched above if (alreadyOnBranch) { log.debug(`» fetching base branch (${baseBranch})...`); - $git("fetch", ["--no-tags", "origin", baseBranch], { + const isShallow = $("git", ["rev-parse", "--is-shallow-repository"], { log: false }).trim(); + const baseFetchArgs = + isShallow === "true" + ? ["--deepen=1000", "--no-tags", "origin", baseBranch] + : ["--no-tags", "origin", baseBranch]; + $git("fetch", baseFetchArgs, { token: gitToken, restricted: shell !== "enabled", }); diff --git a/mcp/output.ts b/mcp/output.ts index 0e25bb4..8a3704a 100644 --- a/mcp/output.ts +++ b/mcp/output.ts @@ -11,7 +11,7 @@ export function SetOutputTool(ctx: ToolContext) { return tool({ name: "set_output", description: - "Set the action output. When called by a subagent, returns a summary result to the orchestrator. When called in standalone mode, exposes the value as the 'result' GitHub Action output.", + "Set the action output. When called by a subagent, returns a summary result to the orchestrator — this is the ONLY way to pass results back. When called by the orchestrator in standalone mode (trigger: unknown), exposes the value as the 'result' GitHub Action output for downstream workflow steps. Do NOT use this for progress reporting — use report_progress instead.", parameters: SetOutputParams, execute: execute(async (params) => { const selfId = ctx.toolState.selfSubagentId; diff --git a/test/agnostic/delegate.ts b/test/agnostic/delegate.ts index 3c9070c..068a273 100644 --- a/test/agnostic/delegate.ts +++ b/test/agnostic/delegate.ts @@ -12,7 +12,9 @@ import { defineFixture, getAgentOutput, getStructuredOutput } from "../utils.ts" const fixture = defineFixture( { prompt: `Select the Plan mode via select_mode, then delegate with mini effort. Your subagent instructions should be: -"This is a delegation test. Your only task is to call set_output with the value 'DELEGATE_BASIC_PASSED'. Do not create plans, branches, or PRs. Just call set_output."`, +"This is a delegation test. Your only task is to call set_output with the value 'DELEGATE_BASIC_PASSED'. Do not create plans, branches, or PRs. Just call set_output." + +When all delegations are complete, call set_output with the final result. This makes it available as the GitHub Action output.`, effort: "mini", timeout: "5m", }, diff --git a/test/agnostic/delegateEffort.ts b/test/agnostic/delegateEffort.ts index 03dcd61..1241eda 100644 --- a/test/agnostic/delegateEffort.ts +++ b/test/agnostic/delegateEffort.ts @@ -16,7 +16,9 @@ const fixture = defineFixture( { prompt: `This is a simple task. Select the Plan mode via select_mode, then delegate with MINI effort (this is a trivial task). Your subagent instructions should be: -"Call set_output with the value 'EFFORT_TEST_PASSED'. Do not create plans or PRs. Just call set_output."`, +"Call set_output with the value 'EFFORT_TEST_PASSED'. Do not create plans or PRs. Just call set_output." + +When all delegations are complete, call set_output with the final result. This makes it available as the GitHub Action output.`, effort: "auto", timeout: "5m", }, diff --git a/test/agnostic/delegateMulti.ts b/test/agnostic/delegateMulti.ts index 35023de..3920a71 100644 --- a/test/agnostic/delegateMulti.ts +++ b/test/agnostic/delegateMulti.ts @@ -19,7 +19,9 @@ Phase 1: Select Plan mode via select_mode, then delegate with tasks: [{ label: " Phase 2: After Phase 1 completes, select Plan mode again and delegate with tasks: [{ label: "phase-2", instructions: "Your task is to call set_output with the value 'MULTI_DELEGATE_PASSED'. Do not create plans or PRs.", effort: "mini" }]. Include the result from Phase 1 in the instructions if you want. -Both delegations must complete successfully.`, +Both delegations must complete successfully. + +When all delegations are complete, call set_output with the final result. This makes it available as the GitHub Action output.`, effort: "mini", timeout: "8m", }, diff --git a/utils/instructions.ts b/utils/instructions.ts index efbbdda..f7bc99c 100644 --- a/utils/instructions.ts +++ b/utils/instructions.ts @@ -384,8 +384,6 @@ To investigate questions, prefer \`${ghPullfrogMcpName}/ask_question\` over \`${ After each \`delegate\` call, you receive a \`results\` array — one entry per task with \`label\`, \`success\`, \`summary\` (from set_output), and \`stdoutFile\` (inspectable via \`${ghPullfrogMcpName}/file_read\`). Follow the post-delegation steps from the select_mode guidance. -When all delegations are complete, call \`${ghPullfrogMcpName}/set_output\` with the final result. This makes it available as the GitHub Action output. - ### Subagent capabilities Subagents have: file operations, shell (for local git, tests, builds), read-only GitHub queries, and upload_file. They do NOT have: \`git\`, \`checkout_pr\`, \`push_branch\`, \`create_pull_request\`, \`create_pull_request_review\`, \`report_progress\`, \`create_issue_comment\`, \`reply_to_review_comment\`, \`resolve_review_thread\`, \`delegate\`, \`ask_question\`, or any dependency/remote-mutating tools. All GitHub-write and state-mutating operations are your responsibility.