opencode-mission-control
opencode-mission-control copied to clipboard
feat: Auto-link GitHub issues in PRs created by mc_pr and plan orchestrator
Description
PRs created by Mission Control — both standalone (mc_pr) and plan (createPR()) — have no way to automatically close related GitHub issues. Users must manually edit the PR body to add Closes #N after creation.
This is a gap because:
- Plans are often created to address specific issues (we just ran a 3-job plan for #39, #16, #36 and had to manually edit the PR to add closing refs)
- The AI agent calling
mc_proften knows which issue it's fixing but has no parameter to express that - Without closing refs, issues stay open after the PR merges
Proposed Solution
mc_pr (standalone)
Add an issues parameter:
args: {
// ... existing args
issues: tool.schema
.array(tool.schema.number())
.optional()
.describe('GitHub issue numbers to close when this PR is merged'),
}
When provided, append closing refs to the PR body:
Closes #39, closes #16, closes #36
mc_plan
Add an issues field to the plan spec:
// Top-level plan config
mc_plan(name: "recovery", issues: [39, 16, 36], jobs: [...])
Or per-job:
mc_plan(name: "recovery", jobs: [
{ name: "graceful-retry", issues: [39], ... },
{ name: "touchset-gate", issues: [16], ... },
])
The orchestrator's createPR() collects all issue numbers and adds closing refs to the PR body.
Implementation
Both approaches are straightforward:
- Collect issue numbers (from param or plan spec)
- Generate
Closes #Nline - Insert after
## Summaryin the PR body
Per-job issues could also be shown in the job status table:
| Job | Status | Issues | Merged At |
|-----|--------|--------|-----------|
| graceful-retry | ✅ merged | #39 | 2026-02-12 |
| touchset-gate | ✅ merged | #16 | 2026-02-12 |
Files
src/tools/pr.ts— addissuesparam, append closing refs to bodysrc/lib/orchestrator.ts— collect issues from plan/jobs, append tocreatePR()bodysrc/lib/plan-types.ts— addissuesfield toPlanSpecand/orJobSpecsrc/lib/schemas.ts— addissuesto plan schema
Related
- #42 (PR template loading) — both improve PR body quality