Skip to content

fix(ai): antigravity quota transformModels fallback publishes a phantom all-null "5h" window for models with no quota figure #1912

Closed

Description

@dezren39

fix(ai): antigravity quota transformModels fallback publishes a phantom all-null "5h" window for models with no quota figure

Verified 2026-11-06 on origin/main 529cf7fa05 (merge of PR #1908), in a laptop worktree (~/git/fleet/probe-2026-11-06-creator-2135, kept).

The defect

packages/ai/src/quota/providers/antigravity.ts, transformModels (the per-model fallback branch, ~:376-398): when a model has no matched summary group, the branch builds a window from the model's own quotaInfo — but it publishes that window unconditionally, even when quotaInfo carries no quota figure at all:

That is exactly the phantom-window shape the window contract exists to forbid — rule 4 in packages/ai/src/quota/types.ts ("No figure, no window — an empty/all-null/zero-limit window-shaped object publishes no window") — and the shape two sibling providers already disposition explicitly:

Antigravity's summary path learned the #1768 lessons (unknown buckets skipped, missing fraction = null), but the per-model fallback path — the path taken by every model when the summary carries no usable group for it — never got the figure check.

Runtime probe (laptop worktree, probe-antigravity.ts, kept in the worktree)

Driving the real exported transformModels with an empty summary-group list:

Because fetchWithCandidates returns ok: true whenever transformModels yields at least one model entry, a models payload whose entries all lack quotaInfo reads as a successful quota read full of all-null windows.

Why it matters

These per-model windows are the antigravity provider's whole published usage (usage: { windows: {}, models }). A phantom window tells downstream consumers (the aggregator, the dashboard, quota-aware placement) that a 5-hour window exists with unknown usage, instead of the honest answer — this model carries no quota figure. It also fabricates the window's kind: the same figure-less model is labelled 5h, daily, or weekly purely by how far away an unrelated reset timestamp sits, or by default when there is none.

Acceptance criteria

Dedup

Searched open + closed issues for "antigravity transformModels", "antigravity phantom window", and "antigravity quotaInfo" this run: no covering issue. #1768 (closed) covered bucket labelling / keep-first / missing-fraction-as-1 in the summary path; it did not cover the fallback branch publishing a window with no figure. #1909 (open) is only about the stale inventory rows for #1768/#1785.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    app/aiPackage: ai (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 7, 2026
  2. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    🤖 Agent note · filed

  3. developing-today commented on Nov 7, 2026

    @developing-today

    Picked up by repo-worker-opencode-a — 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-opencode-a posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  4. added
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 7, 2026
  5. developing-today commented on Nov 7, 2026

    @developing-today

    Progress from repo-worker-opencode-a: triaged-confirmed at main 10f3058: transformModels fallback assigns the window unconditionally with default 5h label even when remainingFraction is null; routing task/small-fix

  6. developing-today commented on Nov 7, 2026

    @developing-today

    Triage — CONFIRMED (lane opencode-a, fallback mode)

    Verified fresh against origin/main @ 10f305865fe8 (laptop primary ~/git/opencode, clean, on main):

    • transformModels in packages/ai/src/quota/providers/antigravity.ts (exported at :342): the per-model fallback branch (the else at ~:376) computes remainingFraction / usedPercent as nullable, derives a label from the reset distance alone (default "5h" / FIVE_HOUR_WINDOW_SECONDS when there is no reset at all), and then assigns transformed[name] = { windows: { [label]: toUsageWindow({ usedPercent, … }) } } unconditionally — there is no figure check anywhere in the branch.
    • So a model with missing/empty quotaInfo publishes an all-null "5h" window minted from no data, and a reset-only quotaInfo publishes a null-percent window whose label is fabricated from the reset distance — both exactly as the filed probe shows, and both contrary to window-contract rule 4 ("no figure, no window") in packages/ai/src/quota/types.ts. The matched-group branch above it is guarded (matchedGroup && Object.keys(…).length > 0); only the fallback lacks the check.

    Routing: task/triage → task/small-fix, back to queue/queued with status/needs-triage. Disposition (omit the model entry vs empty windows) is delegated to the fix by the criteria, with the codex #1762 / meta #1907 drop-the-window precedent named; tests pin no-quotaInfo, empty quotaInfo, reset-only, and the real-fraction control. No Drew decision needed.

    agent-note:v1 · agent: repo-queue-opencode-worker-a · lane: opencode-a · mode: fallback (queue backend down, code#6619)

  7. 5 remaining items

  8. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Picked up by repo-worker-opencode — 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-opencode posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  9. added
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 7, 2026
  10. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Progress from repo-worker-opencode: verified: inspecting transformModels fallback branch on fresh main; next: worktree + figure check

  11. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Progress from repo-worker-opencode: implementation_complete: figure check in transformModels fallback, quota suite 131 pass, neg control 4 fail stashed; next: PR + merge

  12. added a commit that references this issue on Nov 7, 2026
  13. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Released by repo-worker-opencode (outcome: done). fixed_merged: PR #1937 MERGED 19a8142 (branch queue/1912-1912-antigravity-phantom); disposition: figure-less fallback models omitted entirely (rule 4, codex #1762/meta #1907 precedent); quota.test.ts 131 pass, neg control 4/5 new tests fail stashed; issue CLOSED; backlog + sweep.log updated

  14. removed
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 7, 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

    app/aiPackage: ai (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions