Skip to content

Fix the Antigravity reset time and make its failures diagnosable - #451

Merged
btsouth merged 1 commit into
mainfrom
fix/antigravity-reset-and-reasons
Sep 18, 2026
Merged

btsouth merged 1 commit into
mainfrom
fix/antigravity-reset-and-reasons

Conversation

@btsouth

@btsouth btsouth commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Two fixes from #412.

The reset time

The language server sends the reset as an RFC 3339 timestamp, and rate_window_from_remaining handed it to RateWindow::with_details as the description, leaving resets_at empty. Every surface formats resets_at and falls back to the description only when it is missing, which is why the panel printed the raw 2026-09-16T22:33:14Z. It now parses into resets_at, so both the countdown and the local-time rendering work. A value in an unexpected shape still falls back to being shown as text, exactly as before.

Diagnosability

His diagnostic says "The provider returned an unexpected error." and that was all it could say: GetUserStatus dropped its error with .ok(), RetrieveUserQuotaSummary with if let Ok(..), and the diagnostic replaces ProviderError::Other with a generic string by design. A signed-out language server, a changed response shape and a timeout were all indistinguishable.

  • Both errors are now logged at debug level with their full text.
  • The error the panel shows carries only the safe part of them: the HTTP status, or a word for the shape of the failure.
before: Antigravity returned no user status and no quota summary
after:  Antigravity returned no user status and no quota summary (user status: HTTP 401; quota summary: HTTP 401)

The response bodies the API errors carry are never repeated outside the debug log.

Verification

  • cargo test --manifest-path rust/Cargo.toml antigravity, with 4 new tests: the timestamp lands in resets_at with no description, an unparseable reset time still shows as text, a failure reason carries the status but not the body, and the message names whichever of the two calls failed.
  • cargo fmt --all --check clean.
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings clean.

Note

Fix Antigravity reset timestamp parsing and add safe failure diagnostics

  • Valid RFC 3339 reset values now populate resets_at as a UTC DateTime instead of being stored as description text; unparseable values remain in the reset description as a fallback
  • GetUserStatus and RetrieveUserQuotaSummary failures now record whether the response was empty or failed, and the combined provider error names which request failed with a safe HTTP status or failure category (response bodies are excluded)
  • Adds short_reason and describe_unusable helpers in mod.rs to build the compact failure messages
  • Behavioral Change: rate_window_from_remaining now returns a DateTime<Utc> for valid timestamps instead of a string; callers that relied on the reset value appearing in the description will no longer see it there when parsing succeeds

Macroscope summarized 897d86c.

Summary by CodeRabbit

  • Bug Fixes
    • Quota reset times are now displayed using valid UTC timestamps when available.
    • Invalid reset-time values are preserved as readable descriptions instead of being discarded.
    • Status and quota retrieval failures now provide clearer, sanitized explanations and concise diagnostics when responses cannot be used.
  • Tests
    • Added coverage for quota reset-time handling and failure-message formatting.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e44bae03-8651-4f3d-a18b-ca25e52aed85

📥 Commits

Reviewing files that changed from the base of the PR and between 186f155 and 897d86c.

📒 Files selected for processing (1)
  • rust/src/providers/antigravity/mod.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Antigravity provider now parses quota reset timestamps, preserves malformed values, and reports sanitized diagnostics for failed or unusable status and quota-summary responses.

Changes

Antigravity status and quota handling

Layer / File(s) Summary
Status failure diagnostics
rust/src/providers/antigravity/mod.rs
Status and quota-summary requests now record sanitized failure or empty-response reasons. Combined diagnostics identify the failed request without including response bodies. Tests cover the diagnostic formatting.
Quota reset timestamp parsing
rust/src/providers/antigravity/mod.rs
Valid RFC 3339 reset values populate RateWindow.resets_at in UTC. Invalid values remain in reset_description. Tests cover both cases.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: finesssee

Merge Risk: ⚪ Minimal · up to 897d8

The reset parsing and sanitized diagnostic changes have no identified actionable risk, so the change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the two main changes: Antigravity reset-time handling and failure diagnostics.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ceiling 897d86c Commit Preview URL

Branch Preview URL
Sep 18 2026, 02:11 AM

@btsouth
btsouth merged commit bc8771c into main Sep 18, 2026
11 checks passed
@btsouth
btsouth deleted the fix/antigravity-reset-and-reasons branch September 18, 2026 02:19
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.

1 participant