ci(cmux-next): DEV handoff dispatches with the glaeda-route App token; GITHUB_TOKEN fallback waits through a rate limit

Merged
TE
25d ago
+97-4

Problem. cmux#24959 hands a finished DEV Release compile straight to the publisher (request-cmux-next-dev-publish in cmux-next.yml). On 2026-10-26 that handoff failed on every source run: 40280000359, 40298830622 and 40306882038. Each one hit gh: API rate limit exceeded for installation (HTTP 403) in the receipt read, before the dispatch step even ran. The shared GITHUB_TOKEN budget (5000/h) resets around :05 past the hour and runs out within about 30 minutes. The five-minute dispatcher uses that same budget, so it only picked these runs up after the reset: the publisher started 5.7, 40.4 and 40.5 minutes after the compile finished.

Change (only the handoff job):

  • The job mints a manaflow-glaeda-route App token (vars.GLAEDA_ROUTE_APP_ID / secrets.GLAEDA_ROUTE_APP_KEY, which this workflow already mints for runner placement) with permission-actions: write. The App's installation already has actions: write on this repo, and the token has its own budget. The receipt read and the dispatch use this token.
  • If the mint or the App dispatch fails, the job dispatches with GITHUB_TOKEN through scripts/ci/gh_budget_wait.sh (cmux#25434): one bounded wait for the reset, at most an hour, and each wait is logged. The job's timeout goes from 5 to 70 minutes to leave room for that wait. The script comes from a sparse checkout of github.sha. Until #25434 lands on feat-cmux-next the file isn't there, and the fallback is a plain gh call, which is today's behaviour.
  • The receipt step and its upload are now continue-on-error. A refused read can no longer stop the dispatch.

Trust. No new secret. No change to workflow or job permissions:, environments, or pull_request_target. The App and its key are the ones this workflow already uses. The new token only asks for actions: write on this repo, which the App's installation already grants. A publisher run started by the App token looks the same to the publisher: it checks github.ref == main and the source run by id, not the actor. No workflow listens for workflow_run of "cmux NEXT DEV daily" on main, so the App token, unlike GITHUB_TOKEN, triggers nothing new.

Risk. Low. The job runs only on dev_daily dispatches of feat-cmux-next. The dispatcher's cron backstop stays as it is.

Test. tests/test_cmux_next_dev_daily_dispatch.py now checks four things: the App token mint, App-first dispatch, the waiting GITHUB_TOKEN fallback, and a non-fatal receipt step.

Measure. After merge, the next DEV publishes should show compile done → sign start under 2 minutes, and no rate-limit failure in the handoff.

Agent session: agent session

šŸ¤– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.