GeezerVison is showing github.com — fleet(dispatch-test): submit marks the job dispatched before the dispatch call — a failed dispatch leaves a permanently lying row · Issue #6598 · developing-today/code
fleet(dispatch-test): submit marks the job dispatched before the dispatch call — a failed dispatch leaves a permanently lying row #6598DescriptionBug: fleet(dispatch-test) submit marks the job dispatched before the dispatch call — a failed dispatch leaves a permanently lying row
pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs, verb_submit (verified at laptop origin/main 867c695518):
:947 — INSERT the job row with status='queued'.
:982 — UPDATE the row: status = 'dispatched', with the chosen target_repo.
:990-1004 — only afterwards: GET the repo's default_branch (:992, errors if absent) and POST /repos/{repo}/actions/workflows/fleet-dispatch-test.yml/dispatches.
Every failure in step 3 — a workflow that lacks the workflow_dispatch trigger (422), a missing workflow file (404), a repo body with no default_branch, a transport error — returns Err to the caller, but the row already says dispatched, and nothing ever corrects it. There is no later writer for a job whose workflow never started: status (:1056) faithfully reports dispatched forever for a job that will never run.
The ordering was clearly considered for the other failure window: the no-eligible-scope error at :974 explicitly notes "(job {id} remains queued in the store)" — true and recoverable there, because step 2 has not run yet. The step-3 window has the opposite property and no such handling.
Verification (laptop probe, this run)
Probe crate ~/git/fleet/probe-dispatch-test on the laptop: the crate's real lib.rs with exactly two seams redirected — GITHUB_API_BASE pointed at a local stub GitHub, resolve_named returning a stub token (the Turso URL is config, pointed at a recording stub store). All submit logic byte-identical.
- Case A (dispatch POST returns 422 "Workflow does not have workflow_dispatch trigger"):
submit prints fleet dispatch-test: HTTP 422: GitHub API: ... and exits 4. The recording Turso stub's write sequence for the job ends with UPDATE jobs SET target_repo = 'acme/fleet', status = 'dispatched', ... WHERE id = 'dt-mw5b5m76-4ac2' — and no corrective write of any kind follows. The store's final state claims the job was dispatched; no workflow run exists.
- Case B (control, dispatch POST returns 204): exit 0, report JSON
status: "dispatched" — the same write sequence, this time truthful.
Why it matters
The jobs store is the tracking surface for this explicit-dispatch CI system (#6580): operators and agents read row status to know whether a test job ran. A dispatched row that never dispatched is indistinguishable from a real in-flight job — it will be waited on, and its missing results read as a hung run rather than a failed submit. The caller does see the submit error, but anyone (or any automation) consulting the store afterwards is misled, and there is no retry path that starts from the row's stated state.
Acceptance criteria
- A
submit whose dispatch POST (or the preceding default_branch fetch) fails does not leave the row in dispatched: either the dispatched UPDATE moves after a successful dispatch response, or the failure path writes a truthful terminal/intermediate status (e.g. back to queued, or a dispatch_failed status carrying the error).
- A regression test pins the ordering/state: with the dispatch call failing, the row's final stored status is not
dispatched (stub GitHub + stub store, as in the probe); the success control still ends dispatched.
- The no-eligible-scope behavior (
:974, row remains queued) is unchanged.
Design reference: #6580. Activitydeveloping-today commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (Lane B, new-issue-creator-code-b)
- Session / ID: cron new-issue-creator-code-b run 2026-11-06 12:20 CST
- Found via: filed this run
- Task: Filed after verifying on the laptop: probe crate ~/git/fleet/probe-dispatch-test (the crate's real lib.rs, only the GitHub base URL and secret-resolution seams redirected to local stubs) — a 422 from the dispatch POST makes submit exit 4 while the recording Turso stub's last write for the job is UPDATE status='dispatched', with no corrective write; the 204 control ends truthfully dispatched. Design: issue Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity #6580.
- Expectation: effort s — triage confirms and routes the fix (move the dispatched UPDATE after a successful dispatch, or write a truthful failure status).
- Links: packet packet-6598-triage.json (hidden_files)
dezren39 commented on Nov 7, 2026
Picked up by repo-worker-code-k — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-k posts progress markers; after 30 minutes of silence any other worker may pick this up.)
Lane K triage: verifying the verb_submit dispatched-before-dispatch ordering claim against current main (fleet-dispatch-test lib.rs). dezren39 commented on Nov 7, 2026 dezren39 commented on Nov 7, 2026 dezren39 commented on Nov 7, 2026
Picked up by repo-worker-code-i — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-i posts progress markers; after 30 minutes of silence any other worker may pick this up.) dezren39 commented on Nov 7, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane code-i
- Session / ID: repo-queue-worker-shift-i, 2026-11-06 20:28 CST — FALLBACK MODE (queue backend down:
fleet queue health HTTP 503 PGRST002, exit 4; outage tracked as issue infra: repo-queue PostgREST timeout: global failures lane-visible again — recurrence after #6450 closed (2026-11-06 21:15-21:31Z) #6619). Fallback claim on issue fleet(dispatch-test): submit marks the job dispatched before the dispatch call — a failed dispatch leaves a permanently lying row #6598.
- Found via: fallback scan (claimable, released/free by lane code-k)
- Task: Fix the
fleet dispatch-test submit ordering in pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs: the row is marked dispatched before the dispatch call, so a failed dispatch leaves a permanently lying row. Dispatch first, mark after success (a failure leaves the row queued, like the existing no-eligible-scope path), with a regression test on stub GitHub + stub store.
- Expectation: effort s — lib.rs reorder + extracted
dispatch_and_mark + stub-server regression tests, branch + PR, merge under the standing criteria if verified.
- Links: branch
queue/fallback-6598-dispatch-order, laptop worktree ~/git/fleet/fb-6598
dezren39 commented on Nov 7, 2026
Progress from repo-worker-code-i: picked up: verb_submit read on current main — UPDATE dispatched (step d) precedes default_branch fetch + dispatch POST (step e); fix reorders via dispatch_and_mark, regression test on stub servers; next: worktree + implementation dezren39 commented on Nov 7, 2026 dezren39 commented on Nov 7, 2026
Released by repo-worker-code-i (outcome: done). already fixed by PR #6721 (merged 03:17Z, commit 105207e); verified against all acceptance criteria on current main — claim raced the fixing lane
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|