Skip to content

windsurf: read the Devin Desktop plan cache, no invented expiry date (VibeTV-shop/vibetv#285) - #18

Open
DreamyTalesPAN wants to merge 4 commits into
vibetvfrom
claude/285-devin-cache
Open

DreamyTalesPAN wants to merge 4 commits into
vibetvfrom
claude/285-devin-cache

Conversation

@DreamyTalesPAN

Copy link
Copy Markdown
Collaborator

Goal

Windows customers who use Devin Desktop (the renamed Windsurf) see their message quota in VibeTV, and no plan end date that was never reported (VibeTV-shop/vibetv#285).

What Devin users see today

Devin Desktop no longer writes the old windsurf.settings.cachedPlanInfo entry under %APPDATA%\Windsurf. The Windsurf provider finds nothing and shows no usage.

What changes (two commits)

  1. windsurf: read the Devin Desktop plan cache: reads %APPDATA%\Devin\User\globalStorage\state.vscdb, the flat per-account cachedPlanInfoData:<id> entry (remainingMessages / totalMessages). The Windsurf folder is read only when no Devin database exists. A missing total stays an error; several cached accounts stay unavailable instead of being guessed.
  2. Ignore nonpositive Devin cache expiry timestamps: endTimestamp <= 0 means "no end date", not a date. Before, the real cache (endTimestamp: 0) became Expires 1970-01-01 next to the plan name. Now no expiry text is made up. Positive timestamps are read as before. One filter plus tests (flat_cache_with_zero_end_timestamp_has_no_expiry, flat_cache_with_negative_end_timestamp_has_no_expiry; both failed before the fix with Expires 1970-01-01 / Expires 1969-12-31).

Evidence from a real Devin Desktop 3.11.228 cache

Read-only look at a signed-in Windows machine, values sanitized: exactly one matching entry, SQLite TEXT, flat JSON with 15 fields, no usage or quotaUsage objects. remainingMessages = 2500, totalMessages = 2500, endTimestamp = 0. That is a real 0 % used (quota present, nothing used), not an invented zero, and no expiry.

Open

  • The unit of the counters is not proven. The code labels them messages; the cache alone does not show whether they are messages, credits or scaled credits. Needs a second reading after real use (counter should drop).
  • Only one signed-in account was looked at.

Stacked

Base is claude/273-claude-window-wins (#17), which sits on #16 and #15. The diff here is only the two Windsurf commits in rust/src/providers/windsurf/mod.rs. Merge #15, #16, #17 first; GitHub then moves the base.

Tests

cargo test providers::windsurf:: 16 passed (macOS), cargo fmt --all --check clean. cargo clippy -- -D warnings reports the same 19 errors on the base commit and with this change; none in windsurf/mod.rs. No CI workflows in this fork. Windows run follows with the VibeTV rehearsals after the pin bump.

Ask to Marcus

Merge and tag (next number after the stacked ones); VibeTV then bumps the pin in scripts/fetch-win-codexbar.ps1.

🤖 Generated with Claude Code

DreamyTalesPAN and others added 2 commits October 28, 2026 18:10
Devin Desktop writes %APPDATA%\Devin\...\state.vscdb with a flat
per-account cachedPlanInfoData:<id> entry. Read it before the legacy
Windsurf database; a missing message total stays an error and several
cached accounts stay unavailable instead of being guessed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Devin Desktop writes endTimestamp = 0 when the plan has no end date. The
fork read it as Unix milliseconds and showed "Expires 1970-01-01". A
nonpositive end timestamp now stays unknown, so no expiry text is made up.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@DreamyTalesPAN
DreamyTalesPAN changed the base branch from claude/273-claude-window-wins to vibetv October 29, 2026 09:24

@marcus7989 marcus7989 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

[K-Marcus] W240 own review of 0600ef996fc937137439ad6074cb4bbf16ff193c (Marcus 413a / Paul 409a).

Fixed here, without returning findings to the author:

  • Flat remainingMessages / totalMessages do not establish a message or credit unit. The description now says cached units (unit unverified).
  • No cadence is present in the flat cache. Its primary label is now Cached quota, avoiding the legacy Daily fallback; no reset or duration is invented.
  • Invalid flat counters (negative remaining, remaining above total, extreme negative overflow) stay unavailable instead of being clamped to a fabricated 0/100% or panicking.

The original nonpositive-expiry fix is correct. Reverting its filter makes both expiry tests red (1970-01-01 / 1969-12-31). New counter/unit tests also failed before our fixes; focused native macOS tests now pass 17/17. Format and whitespace checks pass. Full backend tests: 2001 pass, 4 fail, 1 ignored; unchanged .15 baseline: 1995 pass with the identical four macOS path failures. Excluding exactly those four gives 2001 library + 1 binary test passing. Clippy --all-targets -- -D warnings is red on both baseline and candidate with identical diagnostics, none in Windsurf. Tests use Rust 1.98.0; installed Clippy/rustfmt are 1.91.1.

Sources: Devin quota documentation, plan/usage documentation, and the package/cache analysis. The docs distinguish token-priced self-serve quotas, enterprise ACUs and legacy prompt credits; no verified mapping of these flat cache fields to any billing unit or cadence was found. PR #18 supplies an author-reported Windows TEXT/JSON sample, not an independently re-read database here.

No further actionable finding in my current code review. This is not merge approval: native Windows restart tests, full tests/build and the real cache/visible result comparison remain required on the exact final candidate. Unit/cadence semantics remain a decision item for Marcus through the orchestrator. No merge, tag, prerelease, device access or other-chat messages by W240.

@marcus7989

Copy link
Copy Markdown
Owner

[K-Marcus] @codex review

Please review exact head 0600ef996fc937137439ad6074cb4bbf16ff193c, especially invalid flat counters and the unverified unit/cadence labels. Native Windows validation and merge approval are still pending.

@marcus7989

Copy link
Copy Markdown
Owner

[K-Marcus] @codex review

Please review exact head ed79468f832cc3fd9a630241d79310eb0209dc95.

W280 changes only the Devin flat-cache unit from cached units (unit unverified) to messages, its two test expectations and associated test name/comment. This follows Paul's 434=A decision in https://github.com/VibeTV-shop/vibetv/issues/284#issuecomment-6497448021 and the handoff in https://github.com/VibeTV-shop/vibetv/issues/284#issuecomment-6497317906. A real-consumption comparison is deferred; messages follows the cache's remainingMessages / totalMessages field names. Counter validation, ratio, Cached quota, missing cadence and expiry behavior are unchanged.

Local Rust 1.98.0: focused Windsurf tests 17/17 pass; backend build and desktop unit-test build pass; fmt and whitespace checks pass. Full backend suite: 2001 pass, 4 fail, 1 ignored, with exactly the same four failures freshly reproduced on the unchanged parent. Desktop tests: 429 pass, 1 Windows-path comparison fails on macOS. Backend Clippy reports the same 19 library / 12 library-test errors on parent and candidate, outside Windsurf. No app/device test, merge or release by W280.

The fork currently registers no Actions workflows and reports no CI checks/statuses; that is not a green CI result. Native Windows retest will be requested from Paul on vibetv-win.

@marcus7989

Copy link
Copy Markdown
Owner

[K-Marcus] @codex review

One retry of the unanswered 2026-10-29 13:13Z request. Please review exact head ed79468f832cc3fd9a630241d79310eb0209dc95 (unchanged).

Paul's native Windows retest on vibetv-win is green: 2,043 backend/CLI tests passed (2,042 library + 1 CLI), 0 failed, 1 pre-existing ignored; static-CRT x64 release CLI builds; live JSON reports 0 / 2500 messages. Evidence: https://github.com/VibeTV-shop/vibetv/issues/284#issuecomment-6500249561 . Independent account-display reconciliation remains intentionally deferred by the recorded decision.

W299 is preparing an artifact-only .17 delivery plan containing #18 plus the existing #19/.16 dashboard contract. No merge, release/tag publication or .16 pin change. No automated review result or merge approval is claimed. Please check the current cache validation, message counter/unit semantics, missing cadence and nonpositive expiry handling.

@marcus7989

Copy link
Copy Markdown
Owner

[K-Marcus] @codex review

W307 follow-up on the still-unanswered review of exact, unchanged head ed79468f832cc3fd9a630241d79310eb0209dc95 (previous request: #18 (comment)). Please review current flat-cache counter validation, messages, missing cadence and nonpositive expiry handling.

Paul reports 2,043 native Windows library/CLI tests passing at this head: https://github.com/VibeTV-shop/vibetv/issues/284#issuecomment-6500249561 . We are now preparing an independent cumulative CI source in order #21 → #20 → #19 → #18, with no target-branch merge. The published .16 pin remains unchanged; no .17 release/pin is part of W307. No merge approval is claimed.

@marcus7989

Copy link
Copy Markdown
Owner

[K-Marcus] W307 independent native cumulative-source validation finished GREEN: .15 + #21 → #20 → #19 → unchanged #18 ed79468f832cc3fd9a630241d79310eb0209dc95, tested source ef4aace55a59ed61fc66ab9b7d341129b82afa69. 2,049 library + 1 CLI passed, 0 failed, 1 pre-existing ignored, 0 filtered; includes current Windsurf/Devin tests. Run/job. The Windsurf file is byte-identical to this PR, while .15 Kimi/Doubao and #19 dashboard behavior are retained.

This is a pre-merge cumulative source, not a green PR-head check or a replacement for the pending review requested earlier today. 0 review threads; no Codex bot result/reaction yet. No device/account-display comparison, merge, tag/release or .17 pin action.

@marcus7989

Copy link
Copy Markdown
Owner

[K-Marcus] W307 final independent test evidence for the unchanged four-PR cumulative source ef4aace55a59ed61fc66ab9b7d341129b82afa69: Desktop-shell run 40908176267 is GREEN, 431/0. Together with backend/CLI run 40906057158: 2,481 PASS, 0 FAIL, 1 pre-existing ignored, 0 filtered; both Rust manifests verified on native Windows. The Windsurf file is byte-identical to unchanged #18 ed79468f832cc3fd9a630241d79310eb0209dc95.

The current-head review follow-up has passed its 20-minute observation window with no bot review, inline finding or bot reaction; 0 review threads. Review stays pending. The account-display comparison and W235/Marcus customer-flow gates remain as previously recorded. No merge, tag/release or .16/.17 pin action.

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.

2 participants