Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(usage): show OpenCode Go, Cursor, and Grok subscription limits #12115

Mergedmaria-rcksmerged 5 commits intomain fromrefs/pull/12115/headmerged by maria-rcks View on GitHub

Showing 10 changed files with 37 additions and 4 deletions (loading 7).

x
0 of 10 viewed, 10 left
9 additions and 0 deletionsapps/server/src/provider/Drivers/CursorDriver.tsModified
View file
@@ -26,6 +26,7 @@
import { makeCursorTextGeneration } from "../../textGeneration/CursorTextGeneration.ts";
import { ProviderDriverError } from "../Errors.ts";
import { makeCursorAdapter } from "../Layers/CursorAdapter.ts";
+import { readCursorUsageLimits } from "../Layers/cursorUsageLimits.ts";
import {
buildInitialCursorProviderSnapshot,
checkCursorProviderStatus,
@@ -139,7 +140,15 @@
processEnv,
discoverModels,
).pipe(
+ Effect.flatMap((snapshot) =>
+ effectiveConfig.enabled && snapshot.installed && snapshot.auth.status === "authenticated"
+ ? readCursorUsageLimits(effectiveConfig, processEnv).pipe(
+ Effect.map((usageLimits) => ({ ...snapshot, usageLimits })),
+ )
+ : Effect.succeed(snapshot),
+ ),
Effect.map(stampIdentity),
+ Effect.provideService(HttpClient.HttpClient, httpClient),
Effect.provideService(Crypto.Crypto, crypto),
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
Effect.provideService(FileSystem.FileSystem, fileSystem),
13 additions and 0 deletionsapps/server/src/provider/Drivers/GrokDriver.tsModified
View file
@@ -19,6 +19,7 @@