Read-only test assessment for [#21020](https://github.com/pingdotgg/t3code/pull/21020)

Target: [EinMelih/t3code](https://github.com/EinMelih/t3code), branch `fix/antigravity-usage-limits-and-ui`, head [047bc56](https://github.com/EinMelih/t3code/commit/047bc56ca0594e734bc262a55f19a94dc3af957d), base main. Local origin/main is [18f26cf](https://github.com/pingdotgg/t3code/commit/18f26cf179503f2311b0006f3392cbcd812833ef). Maintainer edits allowed according to supplied metadata. No source changes, checkout, merge, commits, pushes, comments, browsers, or dev servers. Final git status is clean. This is takeover step 1 assessment only; implementation and live acceptance remain blocked by missing external evidence.

Spec: resolve the real consumer companion project and combine explicitly supported quota windows, without inventing a five-hour cadence or delaying provider session startup.

Tests before/after

- Merge-base baseline: 47 tests in four scoped files: antigravityUsageLimits.test.ts 8; AntigravityProvider.test.ts 22; provider-core usageLimits.test.ts 5; managedProvider.test.ts 12.
- Original PR head: 48 tests, counts 9/22/5/12. The PR adds exactly ONE test, in antigravityUsageLimits.test.ts. All 48 passed on the requested unmodified head in 2.61 seconds. The three files listed in the PR body account for its claimed 36; the additional 12 cover the shared managed-provider code it also changes.
- After this read-only assessment: still 48 repository tests, unchanged. Four temporary diagnostic tests in two external files all FAIL their desired-behavior assertions against the original source; failures reproduce actual local bugs rather than test setup errors. Logs contain request traces with synthetic identities only.
- Current local main has 52 scoped tests (10/25/5/12), from source enumeration, not a test run on main. Do not overwrite its newer endpoint-merge coverage when reconciling conflicts.

Command used from /home/ubuntu/wt/worktree-git-13, with PATH prepended:
`./node_modules/.bin/vp test run apps/server/src/provider/antigravityUsageLimits.test.ts apps/server/src/provider/AntigravityProvider.test.ts packages/provider-core/src/server/usageLimits.test.ts packages/provider-core/src/server/managedProvider.test.ts --cache=false --configLoader runner`

Confirmed reproductions

1. Endpoint fallback: antigravityUsageLimits.ts:333-346 sets resolvedCompanionProject to null when daily loadCodeAssist returns an empty successful object (errors take the same path). Subsequent endpoint iterations only resolve when it is undefined. The mock offers the correct project at cloudcode-pa and a valid Gemini weekly window for that project. Actual trace contains ONE loadCodeAssist request, to daily; all subsequent requests use aicode-consumers or no project. Result is probeFailed with zero windows. The second endpoint capability is never exercised. Test file quota.test.ts:34.
2. Unsupported cadence: lines 209-223 derive 300 minutes from ANY weekly summary or model weeklyQuotaInfo. Mock Gemini quotaInfo includes only fraction and reset timestamp, plus an explicit weekly summary. Actual result labels it Gemini · 5-hour, kind session, duration 300. A reset timestamp does not establish the recurrence length. The original new test explicitly blesses this inference. Test file quota.test.ts:44.
3. Discarding known results at deadline: summary and companion lookup succeed immediately, then model requests never complete. TestClock advances virtual time; no sleeps or real requests. Three serial model attempts on daily consume the 30-second outer deadline (10 seconds per request), never reaching the second host. Actual result is probeFailed/zero windows despite a known Gemini weekly result. Lines 261-266, 357-368, 393-403, 424-433. Test file quota.test.ts:50.
4. Session startup stalls: existing provider harness initializes cached usage, then a Deferred holds the next quota probe. onSessionStarted remains incomplete until that Deferred resolves. Actual diagnostic is completedBeforeQuota=false, completedAfterQuota=true. AntigravityProvider.ts:272 unconditionally awaits it, and AntigravityAdapterV2.ts:139-145 invokes that callback through Effect.tap in runtime.start(). This is a real start-completion dependency, even with cached usage. The test uses the original harness in a temporary copy, with local imports pointed at the unchanged worktree. Test file session.test.ts:183. This diagnostic waits for probe entry, so a future implementation that eliminates that probe entirely should rewrite the synchronization rather than reuse this diagnostic verbatim.

Main architecture and coverage gaps

Current main already concurrently queries both quota hosts and combines windows by ID, retaining the most-used reading. Its tests cover partial daily results and one failed host. PR head predates that implementation and can return at line 381 after partial first-host data. Resolve conflicts by preserving the newer main behavior; do not reintroduce sequential first-success selection.

Shared managedProvider freshness changes affect all providers, but the PR adds no tests for them. Existing stale-enrichment/failure/sign-out coverage passed; that does not establish that fresh enrichment is now published correctly. The unconditional session probe also has no new original regression coverage. The UI only changes two grid templates, with no new UI tests; desktop/web layout and mobile behavior remain unverified. Avoid static-markup or column-class assertion tests.

Smallest meaningful eventual test plan

Use existing module test files; temporary diagnostic files are NOT proposed repository additions.

- Remove/rewrite the single PR-added combined test. One consumer-project integration test should exercise a failed/empty first resolver, successful second resolver, request bodies using the resolved project, and combining actually supported summary/model windows. Include string versus object project response variants only if real captures establish them. Keep main endpoint-union behavior.
- Extend the existing no-invented-duration fallback test: presence of weekly summary and/or weeklyQuotaInfo must not turn unknown-duration model quotas into five-hour windows. Verify preserving the weekly window and unknown quota, with no duplicate supported windows. Explicit duration expectations need an actual upstream discriminator or supported contract, not a fixture assumption.
- One partial-success/deadline test: optional model failure retains the successful summary and endpoint fallback is bounded; use TestClock and Deferred milestones.
- One provider behavior test: a quota refresh held by Deferred does not prevent session start completion; released results update the observable snapshot. Reuse existing sign-out/stale-result tests.
- If keeping the generic managedProvider change, one fresh-enrichment publication test alongside the existing stale-enrichment test, asserting observed snapshot changes. No helper/table/ordering microtests.

Provisional count against current main: 56 scoped tests (12 quota, 26 provider, 5 usage utilities, 13 managed provider), by adding four tests and extending existing cases. This is a planning count, NOT an implemented or passing result. If freshness is fixed without a shared-core change, remove that additional test and adjust scope/count.

What mocks do and do not establish

All quota test HTTP responses are constructed locally through HttpClient.make; temp token files contain synthetic credentials. Existing and diagnostic fixtures establish parser/control-flow behavior only. They do not establish that loadCodeAssist accepts the request on a real consumer account; actual cloudaicompanionProject shape or endpoint behavior; proto3 zero-omission semantics; a five-hour cadence; shared Claude/GPT quota grouping; English description stability; or the necessity of the changed hardcoded User-Agent. The screenshot claims in PR metadata are not a capture of the wire contract. Never use mock success as external verification.

Environment boundary

Both command lookups, antigravity and agy_acp_server, returned absent. The task reports the provider disabled/uninstalled and no consumer OAuth account. No credential files were searched/read and no real Google requests were made. A configured binary outside PATH was not independently ruled out. This assessment cannot verify consumer service behavior or UI. Do not publish a rebuilt implementation as verified based on these results.

Human acceptance steps and evidence needed

1. On a machine with the supported Antigravity runtime, record OS/architecture/runtime version, sign in with a personal consumer Google account, and use a dedicated test T3 home. Do not point a test server at live userdata. Record UTC capture time and the account tier without email/account IDs.
2. In Antigravity Settings > Models, record the actual Gemini and Claude/GPT quota groups, their stated window names, remaining percentages, and reset times. Capture the same account/time in T3 usage limits for comparison. Screenshots must exclude account identity.
3. Using a local diagnostic that reads credentials internally and redacts before writing, capture each host separately: daily-cloudcode-pa.googleapis.com and cloudcode-pa.googleapis.com. Record HTTP status/elapsed time and request method/operation for POST /v1internal:loadCodeAssist with {metadata:{ideType:"ANTIGRAVITY"}}. Retain only the cloudaicompanionProject response shape, replacing its value consistently with PROJECT_A. Record whether the configured project was absent, literal aicode-consumers, or a real project; do not provide token-file contents.
4. For each host, record POST /v1internal:retrieveUserQuotaSummary and POST /v1internal:fetchAvailableModels for {project:PROJECT_A}; compare with the aicode-consumers placeholder and empty body if those are supported. Preserve response groups/buckets/model IDs, displayName, bucketId, window, disabled, description, remainingFraction, resetTime, modelProvider, quotaInfo, weeklyQuotaInfo, and any explicit duration discriminator. Preserve omitted fields as omitted, especially missing remainingFraction; replacing absence with zero would destroy the evidence. Strip other identity-bearing fields. Never capture Authorization/Cookie headers, access/refresh tokens, client secrets, complete token files, or unredacted HARs.
5. Demonstrate the model quota cadence from an explicit server field or supported upstream contract and correlate with the native IDE. A weekly sibling, a reset timestamp, or a screenshot showing two limits alone does not prove which model quota corresponds to five hours. If no unambiguous mapping exists, acceptance requires an unknown-duration label rather than a fabricated five-hour window.
6. In the isolated app, refresh usage, open a new session with previously cached usage, and verify fresh windows publish without holding the first turn behind quota HTTP. Repeat with the daily quota host failing while the other works, then with quota HTTP stalled while ACP remains healthy. Expected: session start remains usable, available quota windows survive optional failures, and later quota results update clients. Record timing and redacted request sequence.
7. Sign out while a quota refresh is in flight, then release it; limits must stay cleared. Reauthenticate and verify replacement account data. Check full and compact usage labels in desktop/web, including a narrow viewport and a remote connected client. Mobile has separate UI and should display the same supported server windows; this PR does not verify its layout. Capture before/after screenshots or a short startup timing recording during authorized integrated verification.

Artifacts

- Existing-suite output: /tmp/worktree-git-13/21020-tests-existing.log
- Four failing diagnostic assertions and synthetic request traces: /tmp/worktree-git-13/21020-tests-reproduction.log
- External diagnostic sources/config: /tmp/worktree-git-13/21020-tests-temp/
- Exact counts: /tmp/worktree-git-13/21020-tests-counts.json
- Pinned state, clean status, executable checks: /tmp/worktree-git-13/21020-tests-state.json

Rerun diagnostics from the allowed worktree with PATH prepended:
`./node_modules/.bin/vp test run --root /tmp/worktree-git-13/21020-tests-temp --config /tmp/worktree-git-13/21020-tests-temp/config.mjs --cache=false --configLoader runner`

Assessment performed by gpt-6-astra through the Codex harness.
