[meta] Epic: stacked-PR dispatch — agents branch off open parent PRs #461
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#461
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As an operator, I want agents to branch off an open parent PR's head (rather than
main) when an issue's blocker has an open PR, so that the agent fleet can stack PRs end-to-end without waiting for blockers to merge — the existing PR-cascade rebase machinery already handles the rest.Why: today
agent-runneralways branches offmain. Issue deps propagate viaissues.closed(assign next when blocker closes). PR stacking machinery exists (pr-deps.ts,event-handlers.ts:982-1055) but only triggers when a human or agent manually marksstacked on #Nin the PR body. The missing link: dispatch-time detection of an open blocker PR + automatic stacking.Sub-stories
pr/<parent>(latest head SHA), and the agent is instructed (via prompt or env) that its base is the parent PR. Auto-fillsstacked on #parentin the new PR's body./ready-stackoperator command — issue-comment slash command that explicitly says "dispatch this even though blockers are open, and stack the PR." For cases where the operator wants to skip the wait. Honours existing/holdprecedence.${parent_pr}var; when set, the prompt informs the agent its base ispr/<N>, notmain, and that rebase will auto-fire on parent merge.Out of scope
pr-deps.tsbody parserReferences
docs/dependencies.mdapps/server/src/domain/workflow/pr-deps.tsapps/server/src/domain/workflow/event-handlers.ts:982-1055#451🤖 Auto-assigned to boss (heuristic: area:webhook → boss (architecture-touching)). Reply
/unassignto reroute.Audit: meta epic fully delivered — all three sub-stories shipped, nothing left to implement.
bce9504 feat(dispatch): branch off parent PR when blocker has open PRclosed #462. Resolver inapps/server/src/domain/workflow/parent-pr.ts;event-handlers.tsplumbsbase_ref+parent_pronto theTaskRequestand prependsrenderParentPrPreambleto the skill body./ready-stackoperator command) →7d8b942 feat(commands): /ready-stack — dispatch with stacking despite open blockersclosed #463. Trust-gated, honours/holdprecedence, falls back to "no parent PR found, will branch off main".${parent_pr}var) →8b93a8f feat(agents): per-type system_prompt_template in agents.jsonclosed #451.agent-runner.ts::interpolatePromptTemplateinterpolates${parent_pr}fromtask.parent_pr; the auto-stack guidance ("base = parent headRef, includeStacked on #N") is delivered viarenderParentPrPreambleat dispatch time.Out-of-scope items (long stacks, cycle detection, agent-to-agent stack negotiation) remain explicitly deferred. Safe to close — no follow-up PR needed against this meta.
Closing — all 3 sub-stories merged: #462 (dispatch parent-PR detection), #463 (
/ready-stackslash command), #464 (agent prompt update with${parent_pr}template var). Verified 2026-04-28.