fix(#4,#5,#7): remove dead cost field, fix stale fallback paths, mark quota as implemented
This commit is contained in:
@@ -46,13 +46,13 @@ The `MitmConfig.modify_requests` flag exists and is plumbed through, but no actu
|
||||
|
||||
## 🟢 Low
|
||||
|
||||
### 5. Wrapper Script Fallback Paths May Be Stale
|
||||
### ~~5. Wrapper Script Fallback Paths May Be Stale~~ ✅ FIXED
|
||||
|
||||
**File:** `scripts/mitm-wrapper.sh` — `LS_FALLBACK_DIRS`
|
||||
|
||||
The fallback glob patterns (e.g., `~/.cursor/extensions/antigravity.antigravity-*/...`) assume a specific extension naming convention. These are only used when no running LS process is found via `/proc` scanning (Method 1), which is the primary and robust discovery mechanism.
|
||||
~~Stale `.cursor`, `.vscode`, `.antigravity` glob patterns.~~
|
||||
|
||||
**Impact:** Only affects `install` when the LS isn't running. Low priority.
|
||||
**Fixed:** Replaced with actual Antigravity install paths (`/usr/share/antigravity/`, `/opt/Antigravity/`, `~/.local/share/antigravity/`). Primary /proc-based discovery is unaffected.
|
||||
|
||||
---
|
||||
|
||||
@@ -70,43 +70,13 @@ The MITM module has unit tests for protobuf decoding and intercept parsing, but
|
||||
|
||||
## 🔍 Investigation
|
||||
|
||||
### 7. LS Exposes Credit/Quota Data via `GetUserStatus`
|
||||
### ~~7. LS Exposes Credit/Quota Data via `GetUserStatus`~~ ✅ IMPLEMENTED
|
||||
|
||||
**Confirmed via live probing.** The LS's `GetUserStatus` RPC already returns structured cost/quota data:
|
||||
**File:** `src/quota.rs`
|
||||
|
||||
```json
|
||||
"planStatus": {
|
||||
"planInfo": {
|
||||
"planName": "Pro",
|
||||
"monthlyPromptCredits": 50000,
|
||||
"monthlyFlowCredits": 150000,
|
||||
"monthlyFlexCreditPurchaseAmount": 25000,
|
||||
"canBuyMoreCredits": true
|
||||
},
|
||||
"availablePromptCredits": 500,
|
||||
"availableFlowCredits": 100
|
||||
}
|
||||
```
|
||||
~~Investigation item.~~
|
||||
|
||||
Each model also includes **per-model quota info**:
|
||||
|
||||
```json
|
||||
"quotaInfo": {
|
||||
"remainingFraction": 0.2,
|
||||
"resetTime": "2026-02-14T07:41:37Z"
|
||||
}
|
||||
```
|
||||
|
||||
**Key findings:**
|
||||
|
||||
- `GetUserStatus` is the single source for credit/quota data (exposed via `LanguageServerService`)
|
||||
- `SeatManagementService` methods (`GetPlanStatus`, `GetTeamCreditEntries`, `GetCascadeAnalytics`, `GetUserSubscription`) are **not routed through the LS** — they're backend-only
|
||||
- `PredictionService/RetrieveUserQuota` is also backend-only (not proxied by LS)
|
||||
- `GetUserAnalyticsSummary` returns empty `{}` (may not be implemented or requires different context)
|
||||
- `GetModelStatuses` returns empty `{}` (separate from the model configs in `GetUserStatus`)
|
||||
- `userTier` field shows subscription level: `{"id": "g1-ultra-tier", "name": "Google AI Ultra"}`
|
||||
|
||||
**Potential use:** We could poll `GetUserStatus` periodically and expose `availablePromptCredits`, `availableFlowCredits`, and per-model `remainingFraction` via the `/v1/usage` endpoint — giving users real-time credit burn visibility without needing MITM token counting.
|
||||
**Implemented:** The `QuotaStore` polls `GetUserStatus` every 60s and exposes credit/quota data via `GET /v1/quota`. Shows plan info, prompt/flow credit balances, per-model remaining fraction, and reset timers.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -33,10 +33,8 @@ CA_PATH="${REAL_HOME}/.config/antigravity-proxy/mitm-ca.pem"
|
||||
# Hardcoded paths are only used as a fallback if no LS process is running.
|
||||
LS_FALLBACK_DIRS=(
|
||||
"/usr/share/antigravity/resources/app/extensions/antigravity/bin"
|
||||
"${REAL_HOME}/.antigravity/extensions/antigravity.antigravity-*/dist/bundled/language-server/bin"
|
||||
"${REAL_HOME}/.cursor/extensions/antigravity.antigravity-*/dist/bundled/language-server/bin"
|
||||
"${REAL_HOME}/.vscode/extensions/antigravity.antigravity-*/dist/bundled/language-server/bin"
|
||||
"/opt/antigravity/language-server/bin"
|
||||
"/opt/Antigravity/resources/app/extensions/antigravity/bin"
|
||||
"${REAL_HOME}/.local/share/antigravity/resources/app/extensions/antigravity/bin"
|
||||
)
|
||||
|
||||
BACKUP_SUFFIX=".real"
|
||||
|
||||
Reference in New Issue
Block a user