Skip to content

pm-stack(aggregator): prevent empty replies when dashboard assembly is slow #5664

Open

Description

@dezren39

Follow-up from triage task 9456 on issue #5082, confirmed against current main 8de9292b77ff3fbfd72153bf0e6ac6758be635cc.

Evidence

On 2026-11-04 at 22:10:34Z, ordinary curl probes against the already-running laptop aggregator at 127.0.0.1:4870 returned curl: (52) Empty reply from server, 0 bytes, after ~12.0s for /board (12.002793s), /api/board.json (12.003588s), /api/overview.json (12.011524s), /frag/overview (12.007072s), and /program (12.004105s). /api/program.json returned 200 / 64,684B in 3.088804s; /api/quota.json returned 200 / 50,995B in 0.018966s. The server process was Bun PID 11116 with cwd /home/user/git/code/pm-stack/aggregator, started 09:39:30 local; this task did not launch it and its loaded SHA is unknown.

Current-main source inspection: pm-stack/aggregator/src/server.ts awaits the full context before returning on /board (1307-1316), /frag/overview (1302-1306), /api/overview.json (1745-1746), and /api/board.json (1748-1761). boardContext serially awaits board refs and items (459-464); overviewContext waits for its slowest facet (701-712). Bun.serve has no explicit idleTimeout (2211-2217), and the source reads have individual timeouts longer than the observed cutoff (for example Kaneo 8s per call, projects 20s, Supabase 60s). Current main has no bounded stale/error response for this assembly. The exact source of the 12s cutoff is not proven; an idle timeout is a plausible contributing cause, not a confirmed root cause.

Scope

Make the affected dashboard assembly routes settle with bytes: return a last-good/stale result when available, otherwise an explicit bounded timeout/error response (including a visible fragment error for /frag/overview) rather than allowing the connection to close silently. Add deterministic tests with slow/stalled stub sources that assert each affected route returns the defined stale/error behavior. Do not treat increasing Bun.serve idleTimeout alone as sufficient; the application still needs a bounded outcome. Preserve fast-path behavior.

Separate symptom

The historical /program HTML size regression (~1.16MB) is not measured by this probe because /program itself currently closes at ~12s; its JSON twin returned normally. Re-measure bytes after the response reliability fix and track HTML slimming separately if still present.

Links: #5082

Acceptance criteria

  • Under slow dashboard assembly, /board, /api/board.json, /api/overview.json and /frag/overview never return an empty reply: each either serves within a bounded time or returns an explicit error/stale response the client can act on.
  • The ~12s empty-reply probes recorded in the evidence (2026-11-04 22:10Z against the laptop aggregator) no longer reproduce, or the remaining slow path is named with its bound.
  • Fast endpoints (/api/quota.json, /api/program.json) do not regress.
  • Fix is covered by a test or a reproducible probe script showing behaviour before/after.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    on Nov 4, 2026
  2. developing-today commented on Nov 4, 2026

    @developing-today
    Contributor
  3. added
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/highImportant and time-sensitive
    queue/queuedHas a queued task in the Supabase agent queue
    effort/mMedium: expected under 1 day of work
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    Intake review

    • Related: follow-up from triage task 9456 on issue pm-stack(aggregator): /board, /api/board.json, /api/overview.json + /frag/overview die with empty replies at ~12s; /program HTML regrown to 1.16MB #5082; the aggregator's board/health fixture test failures seen elsewhere today are a separate thread — this issue is specifically the empty-reply-under-slow-assembly behaviour in pm-stack/aggregator/src/server.ts.
    • Notes: Already well labelled (kind/bug, priority/high, effort/m, queue/queued); this intake adds the missing acceptance criteria only. Evidence is unusually complete: timed curl probes plus the serial-await source locations.
    • Risks: The obvious fix (parallelise the context assembly) can change ordering/freshness semantics of the board; a timeout-with-explicit-error may be the safer first step. The running server's loaded SHA was unknown at probe time — confirm the repro against current main before designing the fix.
    • Suggested approach: Reproduce the 12s empty reply against a current-main aggregator, then bound the serial awaits in boardContext/overviewContext (parallel fetch and/or per-section deadlines), verifying with the same probe set.

    Intake by fleet monitor (repo-fleet-monitor), 2026-11-04 run.

  5. 137 remaining items

  6. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  7. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 6, 2026
  9. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  10. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivequeue/parkedQueue task is parked (waiting on CI, time, or an event)source/queue-workerFiled or worked by the queue/worker pilotstatus/parkedDeliberately paused with a recorded resume conditiontask/small-fixQueue packet kind: bounded fix with reproduction and targeted testswork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions