fix(orch): make PR follow-ups land their fixes on the PR#19
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A manager-spawned
pr_followupfor PR #17 hitstore: not foundonupdate_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_prrequired the internal Orchapr_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
resolvePRhelper 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 automaticProcessFeedbackpath. A manager spawningpr_followup/ci_followupviaspawn_sessiongot none of it, so the worker ran in a scratch dir and committed to a stranded branch.→ Extracted
spawnPRFollowupas the single creation path. Added anaddress_pr_feedbackmanager tool. Removed the follow-up roles fromspawn_session's enum and reject them there, so the special wiring can't be bypassed.RC3 —
update_prpushed 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).→
UpdatePRnow 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_AcceptsGitHubNumber—update_prworks with the GitHub numberTestResolvePR_UnknownNumberListsPRs— unknown number → helpful listingTestSpawnSession_RejectsFollowupRoles—spawn_sessionrefuses follow-up rolesTestAddressPRFeedback_ProvisionsPRBranchWorkspace— follow-up gets a PR-branch checkout +pr_idTestUpdatePR_NoCheckoutRefuses— no checkout → loud error, no pushgo build ./...,go vet ./..., andgo test ./...all pass.