Skip to content

feat: add protected DeepSeek accounts and currency balances - #24783

Draft
nwparker wants to merge 8 commits into
mainfrom
nwparker/deepseek-balance-accounts-1002
Draft

nwparker wants to merge 8 commits into
mainfrom
nwparker/deepseek-balance-accounts-1002

Conversation

@nwparker

@nwparker nwparker commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​928 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​912
Prod 51 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1265 $\color{#cf222e}{\Huge{\mathbf{−}}}$​67 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1198

ELI5

Save a DeepSeek API key on its host and see prepaid balances in CNY and USD. Switching hosts discards unfinished key entry and any pending form result.

What Changed

Before, Orca had no protected DeepSeek account setup or balance display. Accounts now saves encrypted keys through the existing secret store and secure-file writer; the host usage service publishes optional account and balance fields to Settings, the status bar and usage roster. Currency amounts remain exact strings, and replacing or removing a key clears its old balance.

The key-entry form now belongs to one owner lifetime. A→B→A, loading, missing support and unmount discard plaintext, busy state and errors; late completions cannot update a replacement form. Same-owner balance updates preserve typing. Main was merged at ce0778626618bb9a5197209f5189190f2d51545c; the only semantic merge repair kept main's moved Claude test import.

Why

Prepaid money needs currency rows rather than a quota meter. Reusing host-owned account streams, HTTP, encrypted storage and keyed React lifetimes avoids parallel caches and effect-based draft resets.

This credited successor retains Neil [email protected]'s original commits bdd463b0283cb789b1f7c1fa34118a2306dab815 and 26ea4b3c14ec947cf2997d109cdc823fcd9165a6 unchanged and reachable. It continues the credited work from @innocarpe's desktop PR #12873, with Wooseong Kim's existing credit retained. Predecessors remain open until an actual successor merge.

Linked Issue

Fixes #12869

Visual Proof

The existing attachments below are historical synthetic fixture captures from earlier draft revisions, preserved for design context. They are not fresh proof of this merged head; no app, real credentials or authenticated provider was used in this publication run. Fresh rendered/native acceptance remains pending.

Accounts before saving a synthetic key
Accounts after synthetic loopback balance
Stale balance after fixture HTTP 401
Status roster with insufficient-balance message
Accounts after removing the synthetic key
Corrected head hidden Electron Settings; synthetic loopback key
balance-before-dark-deepseek-saved
balance-after-light-deepseek-saved
balance-after-dark-glm-search
balance-after-light-accounts-overview

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

On macOS, the merged tree passed 186 tests across 18 files, full Node/CLI/web typecheck, formatting for 62 feature files, all seven changed-quality scans and unchanged Husky commit checks. Coverage includes the actual 15-second HTTP timeout against synthetic fixtures, protected credential persistence, owner/revision/shutdown fencing, account subscriptions, owner-form replacement, search, status visibility, monetary formatting, hydration and mobile method allowlisting. The independent review's four extra cases ran but remain uncommitted.

The initial merge test run failed because of duplicate Claude imports; main's import was retained and all selected tests passed on rerun. An initial pre-commit quality run compared against the old merge base and flagged two mobile tests inherited from main; the final committed-head check against the fetched base passes, and mobile was left unchanged. No paid provider, keychain or global profile was used. Full-repository lint/test/build, CI and rendered/native checks remain for independent acceptance.

Review

Draft head: bfbc795e77850438bf9e93ab35ead403b1665035. Coordinator owns independent resulting-head review, CI, readiness, merge and predecessor closure. Separate stacked mobile PR #24808 was not modified and needs the changed desktop base assessed independently.

Agent skill upstream boundary

  • Not applicable; no upstream skill source is copied or translated.

Notes

Protocol remains 3 with minimum 2; balance capability and snapshot fields are additive. SSH/WSL without a protected backend are unsupported with no local fallback; folder workspaces use the same execution-host selector. Mobile permits status and refresh only, excluding key save/remove. Native Windows/Linux, SSH/WSL and paired-host rendering were not exercised.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Historical before/after attachments retained and labeled
  • Self-reviewed for correctness, security and performance
  • Cross-platform, SSH/remote and folder workspace impact considered
  • Full lint/test/build pass; CI and independent review remain pending

nwparker and others added 2 commits October 2, 2026 05:40
Store write-only API-key entries in protected execution-host storage and poll the documented balance endpoint through the existing account usage service.
Display each currency's exact monetary strings in Accounts and the status bar, with explicit unsupported hosts and stale errors.

Builds on the DeepSeek balance and mobile account work in #12873 and #23294.

Co-authored-by: Wooseong Kim <[email protected]>
Cancel deferred credential refreshes across service shutdown and suppress completed state updates from an aborted lifecycle.
Clear the previous balance when a failed protected-file write already replaced the persisted key, while retaining the save error and avoiding an immediate request.

Add real loopback regressions for shutdown, successful live rotation, and a durable-write permission failure.

This branch has not been deployed

No deployments
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.

[Feature]: DeepSeek usage in the status bar (rate-limit / usage provider)

1 participant