Skip to content

meta-quota-export: every run fails when no dev.meta.ai tab is open in the laptop browser #5121

Closed

Description

@developing-today

Problem

The laptop's meta-quota-export.service (user unit, ~15-min timer cadence) fails on every run whenever no dev.meta.ai tab happens to be open in the laptop's browser.

Verified 2026-11-03 — every recent run today failed identically, exit status 5:

  • 13:19:56 CST — failed
  • 13:30:10 CST — failed
  • 13:45:06 CST — failed
  • 14:00:01 CST — failed

Journal line each time:

meta-quota-export: no-console-page: browser is up but no dev.meta.ai tab is open
meta-quota-export.service: Main process exited, code=exited, status=5

Why

The exporter (~/atlas/meta-quota-export/meta-quota-export.mjs) is a CDP scraper (port 19222) that reads Meta quota data from an already-open dev.meta.ai tab. It never opens the tab itself. On an unattended laptop the export is therefore effectively always down, and the unit pollutes the failed-units baseline continuously, which masks real failures.

The exporter writes only local files (latest.json, history.jsonl). It has no Supabase involvement — that was checked during the 2026-11-03 pm-dispatch investigation (see #5120 for that thread); this failure is unrelated.

Ask

Make the exporter self-sufficient. Two candidate directions:

  1. Own the tab: create/attach its own dev.meta.ai tab via the CDP targets API at run start and close it afterwards, so the export works unattended.
  2. Degrade quietly: when no console tab exists, exit successfully with a logged skip reason, so a missing human-kept tab stops reading as a service failure.

Before choosing, check which behavior the quota board's consumers actually need — fresh data on a schedule (favors 1) vs. best-effort data whenever a human happens to be at the machine (favors 2).

Related: exporter originally landed under #1301 Phase 1.

Acceptance criteria

  • Reproduction confirmed: a meta-quota-export run with no dev.meta.ai tab open currently fails; after the fix it either succeeds via a supported path or exits with a clear, actionable skip/no-op result instead of a failure
  • A scheduled run no longer reports failure solely because no dev.meta.ai tab is open

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/highImportant and time-sensitive
    effort/sSmall: expected under 2 hours of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    Member

    Intake review

    Fleet monitor intake pass (2026-11-03T20:55:07Z): verified OPEN, no held/user/owned labels.

    Related (title-search of merged PRs):

    • No merged or open PR found referencing this issue in a title search this run.

    Notes: No merged PR explicitly resolves this issue; it reads as still live. Acceptance criteria appended to the body. Priority: priority/high — a recurring job fails every run under a normal condition. Effort: effort/s.

    Risks / suggested approach: Work from the evidence in the body first; reproduce at current main before changing anything, and route the fix through the queue if it grows past the effort class above.

  3. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    Member

    🤖 Agent note · triage complete

    • Agent: queue worker (repo-worker-code), lane code-g
    • Session / ID: task 9461
    • Found via: queue claim
    • Task: Triage verdict for issue meta-quota-export: every run fails when no dev.meta.ai tab is open in the laptop browser #5121: reproduced live today; route = direction 1 (own the tab). Fresh laptop evidence 2026-11-04T12:35–12:50Z: the timer fired 05:49/06:00/06:15 CST failing exit 4 cdp-unavailable (the helium-cdp browser service was down then; it has run since 06:16:45 CST), then 06:30 CST failing exit 5 no-console-page — the issue's exact failure; the unit is still failed since 06:30:08 CST. The exporter (~/atlas/meta-quota-export/meta-quota-export.mjs) only reads /json/list (lines 275/306) and throws no-console-page at line 314 — it never creates a target. The browser is a dedicated managed service (helium-cdp.service, port 19222), not a human's interactive browser, so owning a tab is feasible. Consumers need fresh data on schedule: this export feeds the provider-quota registry for the Meta pool, the only door sessions may use into the Muse High Usage plan — direction 2 (degrade quietly) would leave that pool permanently unmeasured on an unattended laptop.
    • Expectation: follow-up task (small_fix) enqueued this run: exporter creates a dev.meta.ai target via the CDP targets API when none exists, scrapes, closes only its own target; cdp-unavailable stays a real failure. Issue meta-quota-export: every run fails when no dev.meta.ai tab is open in the laptop browser #5121 stays open for that fix.
    • Links: issue meta-quota-export: every run fails when no dev.meta.ai tab is open in the laptop browser #5121 · code#1301
  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 4, 2026
  6. 17 remaining items

  7. dezren39 commented on Nov 14, 2026

    @dezren39
    Member

    Agent note — fix re-verified working; verification still ends at the dev.meta.ai 401 in the CDP profile (task 9492, lane any-a, 2026-11-14)

    Fresh verification this shift, following Drew's 2026-11-12 decisions-page answer on the re-login question ("already handled the new provider ensures constant login", ledger item devmeta-relogin-5121, answered):

    1. Environment repair first: the helium CDP browser was entirely down — the exporter timer's latest attempts report cdp-unavailable (CDP http://127.0.0.1:19222 unreachable; no helium-cdp unit or process existed). Relaunched it with the existing ~/atlas/launch-helium-cdp.sh (helium headless on 19222, chatgpt profile copy); CDP answers again and the browser is left running.
    2. Manual exporter run (2026-11-14T06:43:55Z), no dev.meta.ai tab open: the meta-quota-export: every run fails when no dev.meta.ai tab is open in the laptop browser #5121 fix did exactly its job — created its own dev.meta.ai target, drove it, reached the quota API in page context, and closed its target (afterwards /json/list shows only the pre-existing new-tab page; no leftover). Result: exit 3, status session-expired — quota API returned HTTP 401.
    3. Mismatch to surface: Drew's answer says the login is handled by the new provider, but the session in the helium CDP profile the exporter actually uses still returns 401 today. Either the constant-login session lives in a different profile than the one helium-cdp serves on 19222, or it has expired again since the answer.

    Action: task 9492 parked 24h. Resume condition unchanged and now the only remaining step: a valid dev.meta.ai session in the helium CDP profile on 19222 → manual exporter run exits 0 with latest.json status ok → one 15-min timer tick ok → close #5121. The code fix itself needs no further work.

  8. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    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 14, 2026
  9. dezren39 commented on Nov 15, 2026

    @dezren39
    Member

    🤖 Agent note · picked up (resume)

  10. dezren39 commented on Nov 15, 2026

    @dezren39
    Member

    🤖 Agent note · done — #5121 fixed and verified end-to-end (task 9492, lane any-a, 2026-11-15)

    The dev.meta.ai session in the helium CDP profile is valid again — Drew's 2026-11-12 ledger answer (devmeta-relogin-5121: the new provider ensures constant login) now holds live in the profile the exporter uses. The #5121 code fix itself (exporter creates, drives, and closes its own dev.meta.ai tab; cdp-unavailable stays exit 4) was already in place at ~/atlas/meta-quota-export/meta-quota-export.mjs (unversioned home, as flagged at triage) and needed no change this shift.

    Fresh evidence this shift:

    1. On arrival the exporter was failing again for the OTHER reason: latest.json 2026-11-15T06:30:02Z status cdp-unavailable, helium-cdp inactive. Relaunched via bash ~/atlas/launch-helium-cdp.sh (pid 1259844); CDP 19222 answering, only a new-tab page open — no dev.meta.ai tab.
    2. Manual run 2026-11-15T06:32:12Z (no dev.meta.ai tab open): exit 0, latest.json status ok, measuredAt 2026-11-15T06:32:12.777Z, tier Muse Code High Usage, weekly window 100.27% resetting 2026-11-16T00:00Z, freeCreditsUsd 148.57. /json/list afterwards: only the pre-existing new-tab page + extension background — no leftover exporter target.
    3. Timer-fired run 2026-11-15T06:45:06Z (journal: Starting Meta quota exporter 00:45:06 CST -> node status ok measuredAt 2026-11-15T06:45:10.196Z -> Finished 00:45:13 CST): unattended success, service not in failed state, latest.json refreshed, no leftover dev.meta.ai target.
    4. cdp-unavailable remains a real failure (demonstrated by the 06:30:02Z tick itself while the browser was down) — not silenced.

    All acceptance criteria met. Closing #5121; task 9492 completes as fixed (no PR — the change lives in the unversioned laptop home, recorded here and in the earlier notes).

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

Metadata

Metadata

Assignees

Labels

effort/sSmall: expected under 2 hours 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-sensitivetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions