Skip to content

windsurf: read the Devin Desktop plan cache, no invented expiry date (port of #18 to the pinned nesszer-main line) - #24

Open
DreamyTalesPAN wants to merge 1 commit into
vibetv-on-nesszer-main-0311from
claude/285-devin-cache-on-nesszer
Open

DreamyTalesPAN wants to merge 1 commit into
vibetv-on-nesszer-main-0311from
claude/285-devin-cache-on-nesszer

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).

Why a second PR

#18 has base vibetv (the 0.60.3 line). The release VibeTV pins, v0.70.0-vibetv.2, is built from vibetv-on-nesszer-main-0311 (nesszer main plus the four fork patches). #18 does not apply there: the first commit conflicts in rust/src/providers/windsurf/mod.rs (3 hunks), because that line has no ProviderMetadata/Provider::metadata/supports_cli and its snapshot_from_plan cannot fail. So merging #18 changes nothing in a pinned release. This PR is #18 ported onto the pinned line; #18 itself is untouched.

What changes (one commit, one file: rust/src/providers/windsurf/mod.rs)

  • Reads %APPDATA%\Devin\User\globalStorage\state.vscdb, the flat per-account windsurf.reactSettings.cachedPlanInfoData:<id> entry (remainingMessages / totalMessages), label Cached quota, unit messages. The Windsurf folder is read only when no Devin database exists. Invalid counters (missing, negative, remaining above total, total 0, overflow) and several cached accounts stay unavailable.
  • endTimestamp <= 0 means "no end date": no Expires text is made up.
  • A plan cache without any quota is an error, not 0 %. That is the behaviour of fork PR Report missing provider usage as unavailable instead of an invented 0% (VibeTV #285) #15, which this line does not have for Windsurf; snapshot_from_plan returns a Result for it (its three missing_usage_tests come with the file).
  • Dropped from windsurf: read the Devin Desktop plan cache, no invented expiry date (VibeTV-shop/vibetv#285) #18 because this line does not have them: the ProviderMetadata struct and metadata()/supports_cli().

Tests (native Windows, vibetv-win, Rust 1.99.0)

  • cargo test --lib providers::windsurf: 17 passed, 0 failed.
  • cargo test --lib: 5552 passed, 27 failed, 2 ignored. The base v0.70.0-vibetv.2 (windsurf file without this change) gives 5540 passed, 27 failed: the same 27 tests (4 cost_scanner::codex, 4 login::tests, 1 host::command_runner, 18 providers::grok), environmental on that machine and not from this change. +12 passed = the 9 Devin tests and the 3 missing_usage_tests.
  • cargo fmt --all --check: the only diffs are in cli/serve/tests.rs and providers/claude/tests.rs, both unchanged by this PR; none in windsurf/mod.rs.
  • codexbar usage --provider windsurf --json with throwaway CODEXBAR_CONFIG and WINDSURF_STATE_DB test files:
    • DB file missing: Provider not installed: Windsurf database not found at ... Open Devin Desktop (or Windsurf) and sign in first.
    • DB without a plan cache: Authentication required
    • cache with plan Pro, endTimestamp 0, 2500/2500: used_percent 0.0, 0 / 2500 messages, primary_label "Cached quota", no Expires, no organization, no reset
    • same with 1900/2500: used_percent 24.0, 600 / 2500 messages
    • plan only, no counters: Windsurf plan cache has no quota details (error, not 0 %)

Not checked

  • The unit of the counters is not proven (messages vs credits); a second reading after real use is still open. Only one signed-in account was looked at.
  • No VibeTV app or device run. No release, tag or pin change: this PR is not merged, v0.70.0-vibetv.2 stays pinned until a new fork release is built from this line and VibeTV bumps scripts/fetch-win-codexbar.ps1.
  • The fork has no CI on this PR.

🤖 Generated with Claude Code

…(port of #18 to v0.70.0-vibetv.2)

Ports #18 (four commits, base `vibetv`) onto the
line that VibeTV actually pins (nesszer main + fork patches,
v0.70.0-vibetv.2). Only rust/src/providers/windsurf/mod.rs changes.

- 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. Invalid
  counters and several cached accounts stay unavailable.
- endTimestamp <= 0 means "no end date": no "Expires" text is made up.
- A plan cache without any quota is an error, not 0 % (the behaviour of
  fork PR #15, which this line does not have for Windsurf). This line's
  infallible snapshot_from_plan became a Result for that.
- This line has no ProviderMetadata / Provider::metadata / supports_cli, so
  those parts of #18 are dropped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant