Skip to content

Daemon synchronous init = ~30s white screen on cold load (track WIDGET-TECHNICAL-DEBT.md) #1102

Open

Description

@RebelTechPro

airc-queue card

Coordinates work via the AIRC queue substrate (airc#562). Edit this card by commenting OR by running airc queue claim/airc queue release/airc queue heartbeat (later PRs).

{
  "kind": "airc-queue-card-v1",
  "id": "#1102",
  "owner": "claude-tab-2",
  "status": "claimed",
  "evidence": "Adopted existing GitHub issue into airc queue.",
  "next_action": "Triage, claim, or close this adopted backlog card."
}

Close this issue when the work is done (status=merged/abandoned).

Original issue body

Pre-adoption body

Problem

docs/positron/WIDGET-TECHNICAL-DEBT.md documents a ~30s white screen on cold load. Root cause:

  • 18 daemons initialize synchronously, each waiting for the previous to fully ready up — ~500ms avg each, so 9+ seconds of serial init before any rendering can begin
  • MainWidget uses setTimeout(fn, 0) patterns to defer init, blocking the entire app
  • BaseWidget polls with setTimeout(checkReady, 100) — white screen on refresh while daemons re-register
  • 26+ setTimeout / setInterval "wait for X" hacks across widgets, adding ~20s of cumulative latency
  • 20+ innerHTML assignments destroying reactive state (tracked separately under the adapter refactor)

Fix

State machine for daemon lifecycle: created → starting → ready → failed, with:

  • Daemons declare their dependencies; daemon manager starts each daemon as its deps reach ready, in parallel where independent
  • Widgets subscribe to daemon-ready events instead of polling — Lit's firstUpdated / updated lifecycle is sufficient
  • Eliminate every setTimeout(fn, 0) and polling loop; replace with event subscription
  • Render shell + loading indicator immediately on page mount; daemons hydrate in background

Acceptance

Related

Activity

  1. added
    bug
    stability
    performance
    on May 13, 2026
  2. added
    airc-queue
    on May 14, 2026
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

    airc-queuebugperformancestability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions