Skip to content

fix(dispatcher): retry 后不应被旧 PR 卡住 - #42

Merged
wangzhizhou merged 1 commit into
mainfrom
fix/retry-rearm
Nov 10, 2026
Merged

wangzhizhou merged 1 commit into
mainfrom
fix/retry-rearm

Conversation

@wangzhizhou

Copy link
Copy Markdown
Contributor

实测文档里的恢复路径发现:ai-decide retry 把 Issue 重新排队后,dispatcher 仍然因为「已有 open PR」而跳过(skip ... (handled/running/pr open)),维护者只能手动关 PR。

改为以标签为准:retry 会移除 ai-pr/ 等并重新加 ai,所以「有 ai 且无 handled 标签」= 要求重跑;重跑会 force-push 同一个分支,直接更新已有 PR(createPr 本来就会回退到已有 PR),并重新 arm auto-merge。

新增 handledByLabels() 导出 + 2 个测试。

Found by running the documented recovery path: `ai-decide retry` on a
conflicting AI PR re-armed the issue, but the dispatcher skipped it with
"handled/running/pr open" because an open PR existed for ai/issue-N. The
maintainer had no way out except closing the PR by hand.

Labels are the source of truth: `retry` removes ai-pr (and friends) and adds
`ai`, so "ai present, no handled label" means "run again". The rerun
force-pushes onto the same branch, which updates the existing PR in place
(createPr already falls back to the open PR), and auto-merge is armed on it.

`handledByLabels()` is exported and covered by a test.
@wangzhizhou
wangzhizhou merged commit a402854 into main Nov 10, 2026
2 checks passed
@wangzhizhou
wangzhizhou deleted the fix/retry-rearm branch November 10, 2026 12:58
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