Skip to content

fix(orch): make PR follow-ups land their fixes on the PR#19

Merged
nathanwhit merged 1 commit into
mainfrom
fix-pr-followup-wiring
Jun 15, 2026
Merged

fix(orch): make PR follow-ups land their fixes on the PR#19
nathanwhit merged 1 commit into
mainfrom
fix-pr-followup-wiring

Conversation

@nathanwhit

Copy link
Copy Markdown
Owner

Problem

A manager-spawned pr_followup for PR #17 hit store: not found on update_pr(pr_id="17"), and the review-fix commit (f8db995) was left stranded in a scratch checkout — never pushed to the PR. Tracing it on the host showed three layered root causes, all fixed here.

Root causes & fixes

RC1 — PR identifier mismatch. update_pr/comment_pr required the internal Orcha pr_id (a UUID), but the GitHub PR number (#17) is the identifier agents see everywhere (gh, PR comments). A follow-up that didn't learn the UUID guessed "17"store: not found.
→ New resolvePR helper accepts either the UUID or the GitHub number (a bare number is resolved within the caller's objective). On a miss it returns an error listing the objective's PRs and their ids instead of a bare "not found".

RC2 — manual follow-up spawns got no PR-branch workspace or pr_id (the true root cause). The PR-branch checkout + correct goal were only wired up in the automatic ProcessFeedback path. A manager spawning pr_followup/ci_followup via spawn_session got none of it, so the worker ran in a scratch dir and committed to a stranded branch.
→ Extracted spawnPRFollowup as the single creation path. Added an address_pr_feedback manager tool. Removed the follow-up roles from spawn_session's enum and reject them there, so the special wiring can't be bypassed.

RC3 — update_pr pushed from an unresolved checkout silently. With no workspace, forgeForWorkspace(nil) fell back to the orchestrator's own forge/cwd and pushed the wrong branch (or nothing).
UpdatePR now resolves the checkout from the PR's own branch workspace and refuses to push when none exists, instead of running git in the orchestrator cwd.

Manager steering/guidance updated to point at address_pr_feedback.

Tests

  • TestUpdatePR_AcceptsGitHubNumberupdate_pr works with the GitHub number
  • TestResolvePR_UnknownNumberListsPRs — unknown number → helpful listing
  • TestSpawnSession_RejectsFollowupRolesspawn_session refuses follow-up roles
  • TestAddressPRFeedback_ProvisionsPRBranchWorkspace — follow-up gets a PR-branch checkout + pr_id
  • TestUpdatePR_NoCheckoutRefuses — no checkout → loud error, no push

go build ./..., go vet ./..., and go test ./... all pass.

A manager-spawned pr_followup (#17) hit 'store: not found' on update_pr and
its fix commit was stranded — three layered root causes, all fixed here.

RC1 (id mismatch): update_pr/comment_pr required the internal Orcha pr_id but
agents naturally pass the GitHub PR number they see everywhere. Add resolvePR:
accept either, resolving a bare number within the caller's objective, and on
miss return an error listing the objective's PRs and ids instead of a bare
'not found'.

RC2 (no workspace): a follow-up's PR-branch checkout + pr_id were only wired up
in the automatic ProcessFeedback path. A manager spawning pr_followup/ci_followup
via spawn_session got none of it, so the worker ran in a scratch dir and its
commit went to a stranded branch. Extract spawnPRFollowup as the single creation
path; add an address_pr_feedback manager tool; remove the follow-up roles from
spawn_session and reject them there so the wiring can't be bypassed.

RC3 (silent wrong push): UpdatePR fell back to the orchestrator's own cwd when
no workspace resolved, pushing the wrong branch (or nothing) silently. Resolve
the checkout from the PR's own branch workspace and refuse to push when none
exists.

Updates manager steering/guidance to point at address_pr_feedback. Adds tests
covering id resolution, the spawn_session guard, address_pr_feedback wiring, and
the no-checkout refusal.
@nathanwhit nathanwhit merged commit 4a2936d into main Jun 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant