Skip to content

fix: refresh Windsurf quota cloud plugin#313

Merged
robinebers merged 4 commits intomainfrom
fix/windsurf-quota-cloud-plan-chip
Mar 21, 2026
Merged

fix: refresh Windsurf quota cloud plugin#313
robinebers merged 4 commits intomainfrom
fix/windsurf-quota-cloud-plan-chip

Conversation

@robinebers
Copy link
Owner

@robinebers robinebers commented Mar 21, 2026

Description

  • Switch the Windsurf plugin to the current quota-only cloud API flow.
  • Remove local language-server probing, legacy credit parsing, and the fake plan line.
  • Add focused test coverage so the repo-wide coverage gate passes with the new Windsurf behavior.

Related Issue

  • N/A

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (test coverage hardening for existing hooks)

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass
  • I tested the change locally with bun tauri dev
  • I ran bun run test:coverage and it passed
  • I verified the Windsurf plugin against the live cloud GetUserStatus response

Screenshots

  • Not applicable

Checklist

  • I read CONTRIBUTING.md
  • My PR targets the main branch
  • I did not introduce new dependencies without justification

Note

Medium Risk
Medium risk because it changes the Windsurf provider’s data source/contract (new cloud URL + quota fields) and alters error/fallback behavior, which could break quota display if the upstream payload differs or parsing is too strict.

Overview
Updates the Windsurf plugin to only call the quota-based cloud GetUserStatus API (new server.self-serve.windsurf.com endpoint with fixed compat version), removing all local language-server probing and legacy credit parsing.

The plugin now renders Daily quota, Weekly quota, and Extra usage balance, with stricter contract validation, percent clamping, and clearer fallback hints for auth vs quota-unavailable cases.

Extensively rewrites/expands tests for the Windsurf plugin and adds targeted hook tests (useProbeAutoUpdate, useSettingsPluginActions, useAppUpdate) to cover edge cases like missing settings/order metadata, non-Tauri runtime, in-flight checks, unknown download sizes, and unmount safety.

Written by Cursor Bugbot for commit ae7f896. This will update automatically on new commits. Configure here.


Summary by cubic

Switched the Windsurf plugin to the quota-only cloud API and now show daily/weekly quota plus extra usage balance. Removed local LS probing and tightened auth/fallback logic with focused tests.

  • Bug Fixes

    • Call exa.seat_management_pb.SeatManagementService/GetUserStatus at https://server.self-serve.windsurf.com using compat 1.108.2.
    • Prefer windsurf over windsurf-next; read the API key from both variants; detect auth statuses and show the login hint; fall through on non-2xx, network, empty, or non‑quota payloads; validate the quota contract (daily/weekly remaining%, reset times, extra balance), clamp percentages, format dollars, convert Unix seconds to ISO, and throw a clear quota‑unavailable hint when invalid.
  • Refactors

    • Removed language-server discovery/probing and legacy credit parsing; updated plugins/windsurf/plugin.json to "Daily quota", "Weekly quota", and "Extra usage balance".
    • Added focused tests for the plugin and guard paths in use-probe-auto-update, use-settings-plugin-actions, and use-app-update (non‑Tauri, in‑flight rechecks, unknown download length, missing/empty order metadata, restore saved order, and unmount safety).

Written for commit ae7f896. Summary will update on new commits.

Copilot AI review requested due to automatic review settings March 21, 2026 07:01
@augmentcode
Copy link

augmentcode bot commented Mar 21, 2026

🤖 Augment PR Summary

Summary: Updates the Windsurf provider to use the new quota-only cloud GetUserStatus flow and removes legacy local probing/credit parsing.

Changes:

  • Switches the cloud endpoint to https://server.self-serve.windsurf.com and sends a fixed compatibility version in metadata.
  • Removes local language-server discovery/probing, Info.plist version reads, and legacy credit bucket parsing.
  • Builds output from quota fields: daily/weekly remaining percent (rendered as % progress) plus “Extra usage balance” from overageBalanceMicros.
  • Updates plugin.json line definitions to match the new quota-centric output.
  • Reworks Windsurf plugin tests to cover fallthrough behavior, contract validation, clamping, and error messaging.
  • Adds focused hook tests (useProbeAutoUpdate, useSettingsPluginActions, useAppUpdate) to keep coverage requirements passing.

Technical Notes: The plugin now validates a strict quota payload contract and distinguishes “no API key” (login hint) vs “quota unavailable” cases.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Windsurf provider integration to use the current quota-only cloud GetUserStatus flow, removing legacy local language-server probing/credit parsing and tightening test coverage to keep the repository coverage gate passing.

Changes:

  • Refactor Windsurf plugin to be cloud-only and emit quota-based “Daily quota”, “Weekly quota”, and “Extra usage balance” lines.
  • Update Windsurf plugin manifest (plugin.json) to match the new quota-oriented lines/scopes.
  • Add/extend targeted hook + plugin tests to cover new behaviors and edge cases.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/hooks/use-app-update.test.ts Adds additional tests for Tauri gating, in-flight checks, progress edge cases, and unmount safety.
src/hooks/app/use-settings-plugin-actions.test.ts Adds reorder edge-case tests (missing/unstable order metadata, empty visible subset).
src/hooks/app/use-probe-auto-update.test.ts Adds initial coverage for auto-update scheduling reset behavior.
plugins/windsurf/plugin.test.js Reworks tests around the new cloud quota contract and variant fallback behavior.
plugins/windsurf/plugin.json Replaces legacy credit lines with quota + extra usage balance line definitions.
plugins/windsurf/plugin.js Implements the new quota-only cloud probe logic and output formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Copy link
Collaborator

@davidarny davidarny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@robinebers robinebers merged commit 11ce2d5 into main Mar 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants