Skip to content

Windows: read the numeric zone labels agy prints - #432

Open
Sargares22 wants to merge 1 commit into
vinzdg:mainfrom
Sargares22:fix/agy-numeric-zone-label
Open

Sargares22 wants to merge 1 commit into
vinzdg:mainfrom
Sargares22:fix/agy-numeric-zone-label

Conversation

@Sargares22

Copy link
Copy Markdown
Contributor

Summary

On a Windows host whose timezone has no abbreviation, the Antigravity CLI ring goes stale with "Invalid quota reset timezone" and never recovers. Follow-up to #428.

agy labels such a zone by its UTC offset. This is what agy --sandbox --print-timeout 30s --print /usage returns under ConPTY with agy 1.3.0 on "SE Asia Standard Time" (UTC+07:00), captured through the existing live_quota test:

Quota:
Gemini Models          Weekly Limit Remaining     51%   2026-10-08 07:23 +07
Gemini Models          Five Hour Limit Remaining  79%   2026-10-07 12:49 +07
Claude and GPT models  Weekly Limit Remaining     98%   2026-10-11 06:00 +07
Claude and GPT models  Five Hour Limit Remaining  100%  2026-10-07 13:36 +07

parse_reset_time_with required the label to be ASCII-alphabetic, so +07 was rejected and every reading failed.

Changes

  • windows/codenotch/src/agy_cli.rs: a ±HH or ±HHMM label is read as the offset it states. An offset, unlike an abbreviation, is unambiguous, and it is the one the CLI applied, so the host timezone is not consulted for it.
  • Abbreviations, UTC/GMT/Z and RFC 3339 take the same paths as before. Any other shape of label (+7, +07:00, +0760, +1401, UTC+7, ...) is still "Invalid quota reset timezone".
  • localized_reset_rejects_malformed_text listed +11 as malformed; it is now a valid label and moved to the accepted cases.

Only +07 was observed. The ±HHMM form (+0530, +0545) is inferred from how Go formats zones without a name; I have no host in such a zone to confirm it.

Test Plan

Windows 11 ARM64, in windows/:

  • cargo test --locked -p codenotch agy_cli — 14 passed, 1 ignored
  • cargo test --locked -p codenotch agy_cli::tests::live_quota -- --ignored — failed with "Invalid quota reset timezone" before the change, passes after (4 quota windows)
  • cargo test --locked (whole workspace) — 186 passed, run before the last review touch-ups to the same file
  • macOS — not applicable, no macOS sources touched
  • UI / Notch interactions — no UI change

New tests: a full report with the rows above checked against exact UTC instants, a table of numeric labels of both signs and both widths, and malformed numeric labels. None depend on the host timezone.

Screenshots / Screen Recordings

None; no visual change.

🤖 Generated with Claude Code

A timezone with no abbreviation (Bangkok, Sri Lanka, Nepal) is labelled
by its UTC offset, so under ConPTY agy 1.3.0 prints
"2026-10-08 07:23 +07". vinzdg#428 required the label to be alphabetic, and
every Antigravity CLI reading on such a host failed with "Invalid quota
reset timezone".

"±HH" and "±HHMM" labels are now read as the offset they state. An
offset, unlike an abbreviation, is unambiguous, and it is the one the CLI
applied, so the host timezone is not consulted. Abbreviations are
resolved as before, and any other shape of label is still an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sargares22
Sargares22 requested a review from vinzdg as a code owner October 7, 2026 01:53
@Thierrycast

Copy link
Copy Markdown

Confirming this on another zone and CLI version, in case it helps.

On Windows 11 with "E. South America Standard Time" (UTC−03:00) and agy 1.3.2, the ring was stuck on "Invalid quota reset timezone". The CLI prints a negative offset under ConPTY, captured through run_cmd_conpty with the same arguments as read_quota:

Quota:
Gemini Models          Weekly Limit Remaining  100%  2026-10-16 17:30 -03
Claude and GPT models  Weekly Limit Remaining  100%  2026-10-16 17:30 -03

On main (bcb2889), parse_quota returns Err("Invalid quota reset timezone"). With this branch it parses both windows, and resets_at is 1792182600000, which is 2026-10-16 17:30 -03:00. The agy_cli tests pass too (14 passed, 2 ignored).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants