Follow-up to #1453
While fixing #1453 (emitting the prepare-pr-base step in the SafeOutputs
job so the Stage 3 executor's git worktree add origin/<target> resolves), an
external comment on #1453 reported that the Agent-job MCP-preflight also
fails on shallow / detached-HEAD checkouts — i.e. the prepare-pr-base step
running in its own (Agent) job still isn't leaving the diff base resolvable
for the host-side SafeOutputs MCP server.
From the #1453 comment (Agent-job safeoutputs.log):
[WARN] [rmcp::service] ... "Cannot determine diff base: no remote tracking branch found.
This can happen with shallow clones (fetchDepth: 1). Ensure the pipeline fetches full history
or push a tracking branch."
Scope
The #1453 fix covers the SafeOutputs-job executor path only (option a:
the prepare-pr-base bundle is now emitted before ado-aw execute). This
follow-up tracks the Agent-job MCP-preflight path.
Hypotheses to investigate
- The
prepare-pr-base step's fetch/deepen isn't landing
refs/remotes/origin/<target> on a detached-HEAD shallow checkout (ADO's
default checkout mode), OR
src/mcp.rs::find_merge_base wants the current branch's upstream, which a
detached-HEAD checkout doesn't have, rather than resolving purely via
refs/remotes/origin/HEAD → origin/<target>.
Acceptance
- The
create-pull-request diff base resolves at agent time on a
shallow and detached-HEAD checkout (no origin/<current> upstream), and
- the MCP-preflight no longer emits "Cannot determine diff base" in that setup.
Related: #1413, #1425, #1453.
Follow-up to #1453
While fixing #1453 (emitting the
prepare-pr-basestep in the SafeOutputsjob so the Stage 3 executor's
git worktree add origin/<target>resolves), anexternal comment on #1453 reported that the Agent-job MCP-preflight also
fails on shallow / detached-HEAD checkouts — i.e. the
prepare-pr-basesteprunning in its own (Agent) job still isn't leaving the diff base resolvable
for the host-side SafeOutputs MCP server.
From the #1453 comment (Agent-job
safeoutputs.log):Scope
The #1453 fix covers the SafeOutputs-job executor path only (option a:
the
prepare-pr-basebundle is now emitted beforeado-aw execute). Thisfollow-up tracks the Agent-job MCP-preflight path.
Hypotheses to investigate
prepare-pr-basestep's fetch/deepen isn't landingrefs/remotes/origin/<target>on a detached-HEAD shallow checkout (ADO'sdefault checkout mode), OR
src/mcp.rs::find_merge_basewants the current branch's upstream, which adetached-HEAD checkout doesn't have, rather than resolving purely via
refs/remotes/origin/HEAD→origin/<target>.Acceptance
create-pull-requestdiff base resolves at agent time on ashallow and detached-HEAD checkout (no
origin/<current>upstream), andRelated: #1413, #1425, #1453.