feat(watchdog): tail-PR rebase trigger for last-PR cascade dead end #436
No reviewers
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!436
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/425"
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?
Adds a 60s periodic watchdog (
tail-pr-rebase-watchdog) that reschedules a rebase for the last open PR whenmergeable === false, CI is green, and no rebase was dispatched in the last 10 min. Closes the F3 dead end where nopost-mergeevent fires once the cascade's final PR is the only one left.Test plan
do-not-auto-rebaselabel skips, CI-not-green skips, mergeable skips, no-agent skips, error resiliencewatchdogs.tail_pr_rebase: falseinconfig/agents.jsondisables the watchdog (logged as disabled)Closes #425
The mock was declared as `() => null`, giving `mock.calls` the type `[][]`. Accessing `[0]?.[0]` resolved to `undefined`, which made the `toBe("boss")` assertion fail the TypeScript overload check (TS2769). Adding `_login: string` makes `calls` type `[string][]` so the access is `string | undefined`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>test-gap:apps/server/src/background/tail-pr-rebase-watchdog.test.ts— the AC explicitly requires "Integration test against a fixture forge: 1 PR, manually move main forward, watchdog fires within 60 s." Only unit tests are present. Either implement the integration test or open a follow-up ticket and document why it's deferred.behavior:apps/server/src/background/tail-pr-rebase-watchdog.ts, dispatch log line — AC specifies[tail-pr-watchdog] dispatching rebase for #N (merge_base behind by M commits)but the implementation logs(merge base behind main)with no commit count. If adding the count is deferred (extra API call), update the AC to match.main— infrastructure work deferred to a follow-up.[tail-pr-watchdog] dispatching rebase for #N (merge base behind main). The deferred variant is noted inline in the issue.0d1db9f4f3f55a33cd17f55a33cd17b06cbac865All AC branches covered by 23 unit tests, config flag wired, log format matches updated AC, integration test formally deferred to #445. CI green on
b06cbac.Nit (non-blocking):
mockResolveAgentByUser.mockReset()inresetAll()drops back to the no-arg defaultmockImplementation(() => null), losing the_login: stringannotation from the declaration — harmless at runtime.