GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(usage): read Cursor and Grok plan quota from their TUIs by juliusmarminge · Pull Request #9532 · pingdotgg/t3code Conversation
|
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The four inline findings share one root cause outside this diff: PtyAdapterLive is only Layer.provided into TerminalManager.layer in apps/server/src/server.ts, so it never reaches the layer that runs driver.create. Completing the fix means merging that adapter into the driver-side layer graph (or providing it there) once the requirement is visible in the types.
Posted via Macroscope — Effect Service Conventions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const ptyAdapter = Option.getOrUndefined(yield* Effect.serviceOption(PtyAdapter.PtyAdapter)); | ||
| const checkProvider = checkCursorProviderStatus(effectiveConfig, processEnv, cwd).pipe( | ||
| Effect.map(stampIdentity), | ||
| Effect.provideService(Crypto.Crypto, crypto), | ||
| Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), | ||
| Effect.provideService(FileSystem.FileSystem, fileSystem), | ||
| Effect.provideService(Path.Path, path), | ||
| (effect) => | ||
| ptyAdapter ? Effect.provideService(effect, PtyAdapter.PtyAdapter, ptyAdapter) : effect, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This hand-rolls optional dependency plumbing around the layer boundary: PtyAdapter is not part of CursorDriverEnv, so the type system never requires it, and the ternary provideService is either redundant (a provided adapter is already visible to the probe's serviceOption through the inherited fiber context) or a silent no-op (nothing provides PtyAdapter to the driver layer today, so the probe always reports limits unavailable).
Consider acquiring it as a normal dependency — const ptyAdapter = yield* PtyAdapter.PtyAdapter; plus an unconditional Effect.provideService(PtyAdapter.PtyAdapter, ptyAdapter) — and adding PtyAdapter.PtyAdapter to the CursorDriverEnv union so the missing wiring becomes a type error instead of a runtime degradation.
Posted via Macroscope — Effect Service Conventions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| export function probeGrokUsageLimits( | ||
| input: GrokUsageProbeInput, | ||
| clock: ProbeClock = defaultProbeClock, | ||
| ): Effect.Effect<GrokUsageProbeResult> { | ||
| return Effect.gen(function* () { | ||
| const ptyAdapter = Option.getOrUndefined(yield* Effect.serviceOption(PtyAdapter.PtyAdapter)); | ||
| if (!ptyAdapter) { | ||
| return { | ||
| usageLimits: makeUnavailableUsageLimits({ | ||
| checkedAt: input.checkedAt, | ||
| reason: "probeFailed", | ||
| message: "Usage limits unavailable for this Grok instance in the current runtime.", | ||
| }), | ||
| rawOutput: "", | ||
| }; | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same requirement erasure as in cursorUsageProbe.ts: Effect.serviceOption hides PtyAdapter from probeGrokUsageLimits's type, so the dependency is invisible to GrokDriverEnv and to the layer graph. Consider yield* PtyAdapter.PtyAdapter and letting the requirement surface in the signature.
export function probeGrokUsageLimits( input: GrokUsageProbeInput, clock: ProbeClock = defaultProbeClock, -): Effect.Effect<GrokUsageProbeResult> { +): Effect.Effect<GrokUsageProbeResult, never, PtyAdapter.PtyAdapter> { return Effect.gen(function* () { - const ptyAdapter = Option.getOrUndefined(yield* Effect.serviceOption(PtyAdapter.PtyAdapter)); - if (!ptyAdapter) { - return { - usageLimits: makeUnavailableUsageLimits({ - checkedAt: input.checkedAt, - reason: "probeFailed", - message: "Usage limits unavailable for this Grok instance in the current runtime.", - }), - rawOutput: "", - }; - } + const ptyAdapter = yield* PtyAdapter.PtyAdapter;
Posted via Macroscope — Effect Service Conventions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const ptyAdapter = Option.getOrUndefined(yield* Effect.serviceOption(PtyAdapter.PtyAdapter)); | ||
| const checkProvider = checkGrokProviderStatus(effectiveConfig, processEnv, cwd).pipe( | ||
| Effect.map(stampIdentity), | ||
| Effect.provideService(Crypto.Crypto, crypto), | ||
| Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), | ||
| (effect) => | ||
| ptyAdapter ? Effect.provideService(effect, PtyAdapter.PtyAdapter, ptyAdapter) : effect, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same conditional-provide bypass as in CursorDriver.ts: PtyAdapter is absent from GrokDriverEnv, so the ternary silently skips providing it and the usage probe degrades to probeFailed with no compile-time signal. Consider const ptyAdapter = yield* PtyAdapter.PtyAdapter;, an unconditional Effect.provideService(...), and adding PtyAdapter.PtyAdapter to GrokDriverEnv.
Posted via Macroscope — Effect Service Conventions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ): Effect.Effect<CursorUsageProbeResult> { | ||
| return Effect.gen(function* () { | ||
| const ptyAdapter = Option.getOrUndefined(yield* Effect.serviceOption(PtyAdapter.PtyAdapter)); | ||
| if (!ptyAdapter) { | ||
| return { | ||
| usageLimits: makeUnavailableUsageLimits({ | ||
| checkedAt: input.checkedAt, | ||
| reason: "probeFailed", | ||
| message: "Usage limits are unavailable in this runtime.", | ||
| }), | ||
| rawOutput: "", | ||
| }; | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Effect.serviceOption erases the PtyAdapter dependency from the returned type (Effect.Effect<CursorUsageProbeResult>), so no layer is ever forced to supply it and the missing-service case degrades silently instead of being caught at composition time. Consider acquiring it with yield* PtyAdapter.PtyAdapter so the requirement shows up in the signature and propagates into CursorDriverEnv; if graceful degradation is still wanted, express it as an explicit optional-service layer rather than an in-function fallback.
export function probeCursorUsageLimits( input: CursorUsageProbeInput, clock: ProbeClock = defaultProbeClock, -): Effect.Effect<CursorUsageProbeResult> { +): Effect.Effect<CursorUsageProbeResult, never, PtyAdapter.PtyAdapter> { return Effect.gen(function* () { - const ptyAdapter = Option.getOrUndefined(yield* Effect.serviceOption(PtyAdapter.PtyAdapter)); - if (!ptyAdapter) { - return { - usageLimits: makeUnavailableUsageLimits({ - checkedAt: input.checkedAt, - reason: "probeFailed", - message: "Usage limits are unavailable in this runtime.", - }), - rawOutput: "", - }; - } + const ptyAdapter = yield* PtyAdapter.PtyAdapter;
Posted via Macroscope — Effect Service Conventions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Superseded by merged #12115, which shows Cursor and Grok subscription limits on Usage → Limits via provider APIs (plus OpenCode Go). This draft's PTY TUI probe path is no longer needed. Closing this PR as leftover hygiene. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.