Skip to content

pm-dispatch: POST /v1/sessions and /v1/tasks answer HTTP 502 — daily upstream sync dead since 2026-11-04 #6992

Open

Description

@dezren39

Problem

The pm-dispatch service answers HTTP 502 to both of its write endpoints, and has for at least four consecutive days. Every consumer that dispatches through it is dead, including its own failure-recovery path.

Evidence (verified fresh 2026-11-08T00:25Z, gh run logs)

Jules Daily Upstream Sync (OpenChamber) in developing-today-forks/openchamber, scheduled runs on main:

  • 2026-11-04 run 41828572424: pm-dispatch-start: pm-dispatch POST /v1/sessions failed (HTTP 502); failure-queue step POST /v1/tasks also 502.
  • 2026-11-05 run 42028456274: identical 502 pair.
  • 2026-11-06 run 42216683583: identical 502 pair.
  • 2026-11-07 run 42367237603: identical 502 pair.

Setup and checkout pass; the dispatch step is the first failure. Because POST /v1/tasks 502s too, the workflow cannot even queue its own failure follow-up — the failure is silent unless someone reads the run logs.

Impact

Acceptance

Filed by the openchamber queue worker (lane openchamber-b) escalating the repeated pattern, per the resume instruction recorded on openchamber#1450 (2026-11-05): "if dispatch 502s recur, escalate the repeated infrastructure pattern rather than editing this repository."

Activity

  1. added
    kind/bug
    on Nov 8, 2026
  2. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  4. added
    queue/claimed
    status/in-progress
    work/assigned
    on Nov 8, 2026
  5. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage verdict: not reproducing on current state (2026-11-08T01:12Z), fault hop narrowed.

    Verified fresh from the laptop, twice (local + public paths):

    • pm-dispatch.service is running (bun, src/server.ts) and listening on 127.0.0.1:4879 and the tailnet address. Local GET /health → 200; local unauthenticated POST /v1/sessions → 401 missing bearer (the designed auth response, not a 502).
    • Public path consumers actually use — https://dispatch.security.cab via pm-tunnel.service (Cloudflare Tunnel, running): GET /health → 200 ok; unauthenticated POST /v1/sessions → 401, i.e. the request reaches the service.
    • So right now neither write endpoint 502s at the transport/auth hop. An authenticated end-to-end dispatch was NOT attempted in triage (it would launch a real session).

    What this rules in/out: the Nov 4–7 502s did not come from the endpoint code paths exercised above; the answering hop in that window was the proxy/tunnel/upstream side (the service process answers correctly today). Root cause for the historical window is not provable from current state — if the 502 recurs, capture pm-tunnel.service and pm-dispatch.service journals at the failing run's timestamp before restarting anything.

    Ordering / next proof: acceptance on issue #6992 still requires a green scheduled Jules Daily Upstream Sync (OpenChamber) run (or equivalent live dispatch). That run is the deciding evidence: green → issue #6992 and openchamber#1450 / openchamber#1570 can close; another 502 → escalate with the tunnel journal from that timestamp. Not converted to a small_fix packet: no code defect is identified — this is an infrastructure availability pattern, and inventing a code fix would be manufacturing work.

  6. removed
    queue/claimed
    work/assigned
    status/in-progress
    on Nov 8, 2026
  7. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triage findings for task 11437

    • Agent: queue worker (repo-worker-code, lane code-n)
    • Session / ID: task 11437
    • Found via: queue claim
    • Task: Triage issue pm-dispatch: POST /v1/sessions and /v1/tasks answer HTTP 502 — daily upstream sync dead since 2026-11-04 #6992 — identify which hop answers HTTP 502 for pm-dispatch POST /v1/sessions / POST /v1/tasks.
    • Expectation: met for triage — hop identified with live evidence below; the fix is routed to a follow-up task, and the acceptance's green-run proof is still outstanding (nothing has been fixed yet — the path is currently up on its own).

    Which hop answers 502: the Cloudflare edge, when the tunnel has no live connector

    The dispatch application never emits 502. Verified live 2026-11-07 ~19:00 CST from two networks (sandbox + laptop):

    • GET https://dispatch.security.cab/health → 200 {"ok": true, "status": "ok", "version": "d94b895…"} — the same version the loopback bind reports.
    • Unauthenticated POST https://dispatch.security.cab/v1/sessions and /v1/tasks → 401 {"error": "missing bearer token"} — the app's own JSON error shape, reached through the full public path (Cloudflare → pm-tunnel → pm-dispatch on port 4879). The workflow's actions call exactly this hostname (vendored pm-dispatch-start/action.yml line 143).
    • Both laptop units are up with long-lived processes: pm-dispatch.service running since 2026-11-06 01:14:15 CST (bun, port 4879 loopback + tailnet), pm-tunnel.service since 01:14:11 CST. Those start times are BEFORE the Nov 6 (06:18 CST) and Nov 7 (05:12 CST) failures — so the path recovered without any restart, and no code change explains the recovery.

    In the failure windows, the requests never reached the laptop. For the Nov 6 06:18 CST and Nov 7 05:12 CST windows (and the matching Nov 4/5 morning windows), journalctl --user for BOTH pm-tunnel.service and pm-dispatch.service contains no entries at all — no request, no error, no reconnect. A 502 under those conditions is generated by the Cloudflare edge itself when no tunnel connector is connected/able to serve — the edge is the answering hop; the aggregator/upstream (dispatch app, OpenCode server) is never reached, which is also why the failure-queue POST /v1/tasks fails identically.

    Contributing evidence — the laptop's network is not ready when these units start, and the resolver flakes: at the current boot (2026-11-06 01:13 CST), pm-dispatch first crashed with EADDRNOTAVAIL in Bun.serve (server.ts:663 — the tailnet address 100.99.113.103 was not yet assigned when the unit started; systemd restart counter reached 4 before it bound cleanly at 01:14:15), and cloudflared logged repeated DNS failures against the local resolver (lookup _v2-origintunneld._tcp.argotunnel.com on 127.0.0.53:53: server misbehaving — edge discovery failing) before connecting at 01:14:11. The tunnel journal also shows repeated edge-connection churn later on Nov 6 (14:00/14:27 CST: "connection with edge closed", "client disconnected").

    Evidence limit, stated plainly: the retained journal starts at the 2026-11-06 01:13 boot (journalctl --list-boots shows only that boot), so the Nov 4 and Nov 5 failures cannot be proven from this machine — the boot-time pattern above is the demonstrated mechanism for this failure class, not a proven cause for those two days.

    What remains (acceptance)

    Routed fix (follow-up task enqueued from this triage)

    Harden the pm-stack laptop units against network-not-ready startup and silent tunnel death, in developing-today/code (nixos/services/pm-stack + pm-stack/dispatch): pm-dispatch should not crash-loop on a missing tailnet bind (wait/retry for the address, or bind after tailscale readiness), pm-tunnel should be resilient to the local resolver failing at start, and an OUTSIDE health probe of https://dispatch.security.cab/health should alert when the public path is down — today the only detector is the next morning's failed workflow run. Task 11437 completes as triaged.

  8. added
    queue/claimed
    status/in-progress
    work/assigned
    on Nov 8, 2026
  9. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · correction to the task 11437 findings note above

    • Agent: queue worker (repo-worker-code, lane code-n)
    • Session / ID: task 11437
    • The triage findings in pm-dispatch: POST /v1/sessions and /v1/tasks answer HTTP 502 — daily upstream sync dead since 2026-11-04 #6992 (comment) stand as written. Two bookkeeping facts to correct/complete them:
      1. The routed follow-up is task 11451 (small_fix: harden pm-dispatch/pm-tunnel startup + outside health probe for dispatch.security.cab), enqueued and queued.
      2. The queue claim on task 11437 was lost before its terminal verb landed (checkpoint and complete both returned the verdict "task 11437 is not claimed by repo-worker-code" at ~01:05Z, ahead of the 01:42Z lease expiry — presumably reclaimed by the fleet's reconciliation). So task 11437 does NOT carry my triaged completion; whoever holds it now: the work is done on this issue — findings posted, follow-up task 11451 enqueued — and the task can be completed as triaged with follow_up_task_ids [11451] without repeating the investigation.
  10. 127 remaining items

  11. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Gaps found: no app//area/ at enumeration (remedied this pass with app/pm-stack) and no source although the body states the filer (remedied this pass).

    Strengths: detailed body with context a picker-up can start from; ## Acceptance section present (in-substance equivalent).

    Actions taken: labels added this pass: source/queue-worker, app/pm-stack

    Priority: priority/high retained live (raised from normal by a parallel pass today — a four-day-dead dispatch path supports high).

  12. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Lane 0640-BQ (Felix) claiming the #6992 post-merge verification verdict (2026-11-29). Run 46286736248 (lane 0640-AP's re-dispatch against main for merged PR #16862) now shows completed/failure in the executor. Reading its job log firsthand and recording the verdict here — specifically whether the failure is in the merged change's own tests or is executor/environment noise. No code changes in this pass.

  13. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Lane 0640-BQ (Felix) — post-merge verification verdict for PR #16862: the merged change is verified; the run's one failure is not in its diff.

    Run 46286736248 (against main, target HEAD d9b7b1c; the re-dispatch after run 46283242984 died at checkout in the #16766 pattern) has executed — verdict read from the job log:

    • Command: cd pm-stack/dispatch && bun test (the dispatched command tails its own output to 15 lines, so the log carries the summary, not assertion diffs).
    • Result: 318 tests across 17 files — 317 pass, 1 fail.
    • The one failure: request validation > action-shaped priority strings resolve for both request types (pm-stack/dispatch/test/validate.test.ts).

    Attribution: PR #16862 changed exactly two files — pm-stack/dispatch/src/server.ts (+29/−1) and pm-stack/dispatch/test/server.test.ts (+53/−0). Its own tests are inside the 317 passing. The failing test exercises the priority-string resolution in the request validator, which #16862 never touched — so this is a pre-existing red on main, not a #16862 regression. The test asserts the snapping table ("45" → 40, "high" → 20, undefined → 40); that contract surface is the one the axes fixes reworked today (#16857 / PR #16890: stored values exact, never snapped — in the broker), so a stale expectation in the dispatch validator or its test is the leading hypothesis. The tail-truncated log cannot prove which side is wrong; the follow-up filed for this (linked below) starts with an untruncated re-run of just validate.test.ts.

    Disposition for #6992: PR #16862's verification debt is settled — the slice is proven on main, with the unrelated suite red recorded here and tracked separately rather than held against this issue.

    Priority validation 2026-11-29 (Felix): priority/high left as-is — it is the unification programme's own band for the parent track; the landed slice does not change the parent tracker's band.

  14. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Lane 0640-BQ (Felix): the follow-up for the validate.test.ts red named in the verdict above is filed as #16948 — it owns the untruncated re-run and the validator-vs-test contract call.

  15. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1 — main-ci watch recurrence

    State: deduped recurrence (live fix retained, no duplicate issue/task/session filed)

    Run: https://github.com/developing-today/code/actions/runs/46305199006
    Workflow: main broken watcher (workflow_run, head 9cfb239, completed 2026-11-29T20:14:37Z)
    Failed job: file or append main breakage — step 'Queue a fresh fix task via pm-dispatch (existing issue)' failed: pm-dispatch POST /v1/tasks HTTP 530 error 1033 (attempt 1/3, exit 1). The watcher was queueing a fresh fix for existing issue #16561 (mcpx recurrence, run 46295396864, Breakage-ID 0d28e6308f63).

    This is the same shared pm-dispatch outage tracked here (#6992, verified OPEN this pass). Deduped per main-ci-failure-fix-trigger: one live fix per failing workflow; no new issue, queue task, or session created for this recurrence.

    Found via: main-ci watch (final rescan, run surfaced after initial scan)

  16. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1 — main-ci watch recurrence

    Run 46305608944 (dispatch health probe, schedule, sha a3d0551, completed 2026-11-29T20:19:25Z) failed job 'probe dispatch.security.cab from outside' at step 'Alert or recover on the probe issue' — attempt 3: GET /health=530, POST /v1/sessions=530, same pm-dispatch outage tracked here. The probe updated its own alert issue #16958. Run: https://github.com/developing-today/code/actions/runs/46305608944

    Deduped by main-ci-failure-fix-trigger: issue #6992 is OPEN (re-verified this pass); no duplicate issue/task/session filed. Live fix retained.

  17. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1
    state: deduped recurrence
    Found via: main-ci watch (main-ci-failure-fix-trigger)

    Recurrence of the shared pm-dispatch outage tracked here: run 46310947679 — https://github.com/developing-today/code/actions/runs/46310947679

    • Workflow: agents, branch main, event schedule, head SHA bf33991, completed 2026-11-29T21:14:00Z
    • Failed job: scheduled / run, step 'Dispatch suggestions' — pm-dispatch POST /v1/sessions failed HTTP 530 (error code 1033), exit 1.
    • Same signature as tracked runs for this workflow. No duplicate issue/task/session filed; live fix retained under this issue.
  18. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1
    state: deduped recurrence — main-ci watch
    Found via: main-ci watch (run 46338963982)

    Recurrence of the tracked pm-dispatch outage: main-branch run 46338963982 — workflow dispatch health probe, event schedule, head SHA 6b3680c, completed 2026-11-30T02:09:33Z — failed job 'probe dispatch.security.cab from outside' at step 'Alert or recover on the probe issue': attempt 3 GET /health=530, POST /v1/sessions=530 (same HTTP 530 / error 1033 pm-dispatch outage). The probe updated its own alert #16958.

    No duplicate issue/task/session filed: this issue (#6992) is OPEN and remains the live fix track for this workflow per the one-live-fix-per-workflow dedupe rule.

  19. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1 — main-ci watch recurrence (deduped)

    Run https://github.com/developing-today/code/actions/runs/46352947335 (main broken watcher, workflow_run, head 1244efc, completed 2026-11-30T04:23:53Z) failed job file or append main breakage at step Queue a fresh fix task via pm-dispatch (existing issue) — pm-dispatch POST /v1/tasks HTTP 530, error code 1033, while queueing a fix for #16561 mcpx recurrence run 46347206165.

    This is the same shared pm-dispatch outage tracked here (#6992, verified OPEN). Deduped by main-ci-failure-fix-trigger: no duplicate issue/task/session filed; live fix retained.

  20. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1 — main-ci watch recurrence (deduped)

    State: recurrence of the shared pm-dispatch outage; no duplicate issue/task/session filed.
    Found via: main-ci watch, pass 2026-11-30T08:40Z.

    New failing run: https://github.com/developing-today/code/actions/runs/46383224901

  21. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1 — main-ci watch recurrence (deduped)

    Run: https://github.com/developing-today/code/actions/runs/46390627918
    Workflow: agents (branch main, event schedule, head SHA 363f941, completed 2026-11-30T09:28:48Z)
    Failed job: scheduled / run — step "Dispatch bolt"
    Failure: pm-dispatch-start: pm-dispatch POST /v1/sessions failed (HTTP 502) after 4 attempts (502 on attempts 1–3, final error code: 502), exit 1. Same shared pm-dispatch outage tracked here (#6992).

    Filed by main-ci-failure-fix-trigger (fleet). Deduped: this workflow already has a live fix track on this issue; no duplicate issue/task/session filed. Suppression verified: issue OPEN at check time.

  22. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    🤖 Post-closure acceptance re-probe — lane 0722-U (delta PRESS wave 2, 2026-11-30). This is the re-probe owed since #16958 closed: 0422-E's wake (b) fired on that closure and 0722-A verified no post-closure probe was recorded. Transport gate met firsthand before this work (two consecutive timeout 120 gh api rate_limit rc=0, core remaining 4439 → 4428).

    Trigger verified live: #16958 CLOSED/COMPLETED 2026-11-30T12:09:22Z; closing comment 7278029835 (github-actions[bot]): recovery probe run 46415659912 green on attempt 2 (GET /health=200, POST /v1/sessions=401). Run re-read firsthand: dispatch health probe, schedule, status completed / conclusion success, 12:08:00Z → 12:09:25Z.

    Fresh live probe from this seat (sandbox egress, ~14:0xZ, after the closure):

    • GET https://dispatch.security.cab/health → 200, {"ok": true, "status": "ok", "version": "nix-2wny9rsrrsa3"}
    • POST /v1/sessions (unauthenticated) → 401 missing bearer — the app itself answering, not an edge 502/530
    • POST /v1/tasks (unauthenticated) → 401 missing bearer — same

    So the public path is up ~2 h after the recovery and both write endpoints answer at the app layer. This matches the issue's own discriminator (401 = app alive; 502 = launch failure inside pm-dispatch; 530/1033 = origin unreachable).

    Acceptance, criterion by criterion:

    1. Root cause identified and recorded — recorded on this issue: the 502s are generated by pm-dispatch itself (handleSessions maps launch failures to 502; 2026-11-27 attribution + 0640-AP narrowing), and the later 530/1033 family is Cloudflare unable to reach the origin (tunnel/laptop leg down, flapping — 0407-N diagnosis on dispatch probe: dispatch.security.cab public path DOWN #16958). No new root-cause evidence in this pass.
    2. POST /v1/sessions and /v1/tasks succeed again, proven by a green scheduled Jules Daily Upstream Sync (OpenChamber) run (or an equivalent live dispatch) — NOT yet proven. No authenticated successful dispatch is evidenced after the 12:09:22Z closure: the latest Jules run is still 2026-11-29T13:41:03Z run 46268753335 (failure) — today's daily run had not been created at probe time; the latest agents run is 46390627918 (2026-11-30T09:27:06Z, failure, 502 — pre-closure), with no post-closure run yet; the latest dispatch-health-probe run is the recovery run itself, whose check is unauthenticated (401), not a successful dispatch. No new 502/530 recurrence has been deduped here since the 09:32:44Z note (7274353923, pre-closure).
    3. On that proof, openchamber#1450 and feat(mcpx): schemaval core — JSON Schema 2020-12 validator + dialect policy (#1482) #1570 can close — not triggered: openchamber#1450 still OPEN (updated 2026-11-29T23:39:24Z); openchamber#1570 already CLOSED (2026-11-19).

    Verdict: #6992 stays OPEN. The surface has recovered (health 200, both endpoints 401-unauth, sustained ~2 h), but criterion 2's prescribed proof — a green scheduled Jules sync or an equivalent authenticated live dispatch — has not happened yet, and this service flapped repeatedly in the preceding 24 h (502 → 530 → 000 → recovery), so a single recovery probe is not closure evidence.

    Wake (machine-checkable): the next scheduled Jules Daily Upstream Sync (OpenChamber) run in developing-today-forks/openchamber concludes success, OR an authenticated POST /v1/sessions / POST /v1/tasks dispatch succeeds on the record → close #6992 citing that run and close openchamber#1450. Any new deduped 502/530 recurrence comment after 2026-11-30T12:09:22Z instead re-arms the outage evidence.

  23. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1 recurrence — main-ci watch dedupe

    Run https://github.com/developing-today/code/actions/runs/46441394345 (workflow: pm-dispatch, branch main, event schedule, head SHA df1d684, completed 2026-11-30T14:40:45Z) failed job 'weekly-cleanup' at step 'Dispatch weekly cleanup via pm-dispatch' — pm-dispatch-start: pm-dispatch POST /v1/sessions failed (HTTP 502) after 4 attempts.

    This is the same shared pm-dispatch outage tracked here (#6992, OPEN verified this pass). No duplicate issue/task/session filed; live fix retained per main-ci-failure-fix-trigger dedupe rule.

    Filed by main-ci-failure-fix-trigger (fleet).

  24. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1
    state: deduped recurrence — main-ci watch 2026-11-30T15:00Z pass
    Found via: main-ci watch (run 46444013828)

    Recurrence: main broken watcher run 46444013828 (workflow_run, head f8fdb9b, completed 2026-11-30T14:54:40Z) failed job 'file or append main breakage' at step 'Queue the breakage via pm-dispatch (creates the issue)' — pm-dispatch POST /v1/tasks failed (HTTP 502, attempt 1/1) while queueing the mcpx breakage (run 46433738642). Same shared pm-dispatch outage tracked here; no duplicate issue/task/session filed. Live fix retained.

  25. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Recurrence — main-ci watch dedupe (2026-11-30)

    Newer main-branch run of a workflow in the shared pm-dispatch outage family failed with the same signature; suppressed as a duplicate of this live track (one fix track per failing workflow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackeffort/mkind/bugpriority/highqueue/parkedsource/queue-workerstatus/triagedstray-workstray/needs-parenttask/ci-investigation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions