Skip to content

fix(queue): resolve scheduled target branches - #962

Merged
steipete merged 1 commit into
mainfrom
fix/scheduled-target-branch
Jul 30, 2026
Merged

fix(queue): resolve scheduled target branches#962
steipete merged 1 commit into
mainfrom
fix/scheduled-target-branch

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • resolve each scheduled planner target's live GitHub default_branch once before enqueue, and reject numeric or otherwise implausible branches before admission
  • heal durable empty or numeric branch decisions in the exact-review workflow before checkout, carrying the resolved branch through artifact publication
  • if default-branch resolution is temporarily unavailable, complete the claim as success plus requeue_latest with a five-minute retry so the item does not spend its eight-failure review budget

Root cause

The literal 0 did not come from the current planner candidate tuple. Before #889, legacy intake serialized repo<TAB><empty branch><TAB>0; Bash read treated the adjacent tabs as IFS whitespace and shifted the source-authority flag into target_branch. PR 889 fixed new intake with NUL-delimited fields, but already-durable decisions retained targetBranch: "0". The parked-item recovery in #961 made that latent population execute at volume, as seen in https://github.com/openclaw/clawsweeper/actions/runs/30552037727.

Proof

  • node --test test/repair/scheduled-review-enqueue.test.ts
  • node --test --test-name-pattern='exact event branch guard resolves|exact event review publishes directly|scheduled reviews feed the durable queue' test/sweep-workflow.test.ts
  • node --test --test-name-pattern='admission requeue_latest resets failures' test/dashboard-worker.test.ts
  • pnpm run format:check
  • pnpm run lint
  • pnpm run check
  • local and committed-branch Codex autoreview: clean, no accepted/actionable findings

The workflow behavior test executes the real YAML step with fake GitHub responses and proves both an empty branch and 0 resolve to trunk. The queue test starts at seven review failures and proves admission requeue resets the counters to zero, remains pending, and does not park.

Deployment

No Worker redeploy is needed. This changes the repository workflow and the scheduled producer code built inside that workflow; it does not change the deployed dashboard Worker or queue schema. New runs after merge use the guard, while already-running jobs retain their checked-out workflow revision.

@steipete
steipete requested a review from a team as a code owner July 30, 2026 14:44
@steipete
steipete merged commit 56d32be into main Jul 30, 2026
11 checks passed
@steipete
steipete deleted the fix/scheduled-target-branch branch July 30, 2026 14:52
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