Skip to content

Fix Antigravity collector overflow on zero timestamps - #14098

Open
steph4n-gh wants to merge 1 commit into
omacom:agents-hermes-antigravity-providersfrom
steph4n-gh:fix/agy-timestamp-overflow
Open

steph4n-gh wants to merge 1 commit into
omacom:agents-hermes-antigravity-providersfrom
steph4n-gh:fix/agy-timestamp-overflow

Conversation

@steph4n-gh

Copy link
Copy Markdown

Antigravity conversation summaries can contain Go's year-0001 zero timestamp. Converting it to local time west of UTC crosses into year zero and crashes the collector with OverflowError. Reproduced with synthetic data from the original report.

Treat the exact zero sentinel as undated and guard timestamp parsing and local conversion narrowly. Valid activity, session accounting, and lifetime token totals remain intact; bad dates cannot suppress valid records or enter today's counts.

Validation: all nine timestamp tests pass on Python 3.14.8 and system Python 3.14.7, covering UTC, UTC−5, UTC+9, mixed records, boundaries, and shared login expiry/reset/cache callers. All 17 isolated collector suites and affected scanner, limits, updater, and panel tests pass, as do shell syntax, whitespace, and patch application checks. No live service calls were made. Independent review has no remaining findings.

./test/cli has the preexisting vscode generated theme references current theme file failure, reproduced on the unmodified base. Full shell/aggregate suites, graphical acceptance, live-service tests, and CLI checks after that failure were not completed.

Companion to #14039, targeting its agents-hermes-antigravity-providers branch. The separate adaptation for the author's f008cf62 antigravity collector is not included.

@steph4n-gh
steph4n-gh marked this pull request as ready for review October 3, 2026 02:11
@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Fixes timestamp parsing in a usage collector agent.

The PR appears safe to merge; no actionable issues were found.

What we checked:

  • Bad dates stop the collector: parse_time() returns no date for the zero sentinel. local_day() catches conversion errors and returns an empty date.
  • Undated records lose lifetime counts: The collector adds summary identities and transcript tokens before checking their dates. Only dated counts depend on a usable date.

Summary

The PR treats Go's zero timestamp as undated and catches date parsing and local-time overflow errors.

  • Valid dates keep their existing behavior.
  • Undated summaries retain session identities, and undated transcript steps retain lifetime token totals.
  • The new tests cover timezone boundaries, mixed records, shared callers, and an isolated CLI run.
  • No actionable issues found. Tests were inspected, not executed during this review.

Reviews (1) · Last reviewed commit: "Fix Antigravity collector overflow on ze..."

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed, and the fix holds. Nothing was pushed.

Reproduced on a disposable Omarchy worker. I ran the collector with --force against a synthetic Antigravity directory whose conversation_summaries.db holds a 0001-01-01 00:00:00+00:00 row. On the base, agents-hermes-antigravity-providers at 2ffdf9a, it exits with OverflowError: date value out of range under TZ=EST5 and runs under UTC0 and JST-9. At this head (9377151) it runs in all three zones and gives the same prompt, session and date totals. The new agent-usage-agy-timestamps-test.sh errors against the base collector and passes here.

Tests on the worker: agent-usage-agy-limits, -scanner and -timestamps, agent-usage-update and agents-panel all pass. ./test/cli stops at vscode generated theme references current theme file on the base and on this head alike, after the same 91 passing checks, so the CLI checks after that one did not run on either.

Second opinion, from Codex at medium effort: no blocking defect. It agrees with the reasoning above, though it may have seen that reasoning, so its agreement isn't independent. Its caller audit is its own: valid timestamps parse to the same dates as before, and a zero-time login expiry, quota reset or cached window is now treated as unknown rather than expired. A zero-time history row now counts as no prompt in every zone, where in UTC it used to count as a prompt dated 0001-01-01. That is the intended effect, but it is worth stating in the description. It also noted that the CLI smoke test's --limits-only second run can't tell cache reuse from a rescan, since both see the same files. That doesn't affect the timestamp coverage.

Scope: the collector change is the size of the bug. The test file is larger: lines 153–257 exercise login expiry, quota reset display and cached-window pruning. Those are the other callers of the shared parse_time, so there is a case for keeping them, but they could also be folded into agent-usage-agy-limits-test.sh.

This is labelled verified, not ready, because it targets #14039's branch rather than quattro. Whether and how it lands with #14039 is the maintainer's call.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants