Keep PR refreshes anchored to cached review numbers (#2541)

- Use fallback PR numbers after branch lookup misses, including detached HEAD
- Preserve review cards for forked or deleted-head PRs across manual refreshes
- Clear stale GitHub PR cache entries when unlinking worktree review metadata
This commit is contained in:
Jinjing
2026-05-21 12:12:10 -07:00
committed by GitHub
parent 2e3627fd8e
commit fca5f498db
27 changed files with 537 additions and 96 deletions
+8 -2
View File
@@ -46,7 +46,8 @@ const SlugAssignableUsers = SlugRepo.extend({
const PrForBranch = RepoSelector.extend({
branch: requiredString('Missing branch'),
linkedPRNumber: z.number().int().positive().nullable().optional()
linkedPRNumber: z.number().int().positive().nullable().optional(),
fallbackPRNumber: z.number().int().positive().nullable().optional()
})
const Issue = RepoSelector.extend({
@@ -313,7 +314,12 @@ export const GITHUB_METHODS: RpcMethod[] = [
name: 'github.prForBranch',
params: PrForBranch,
handler: async (params, { runtime }) =>
runtime.getRepoPRForBranch(params.repo, params.branch, params.linkedPRNumber)
runtime.getRepoPRForBranch(
params.repo,
params.branch,
params.linkedPRNumber,
params.fallbackPRNumber
)
}),
defineMethod({
name: 'github.issue',