DeepSeek's /user/balance lists balance_infos in an order that changes from
read to read. readDeepSeek wrote them as they came, and the balance history
kept the first number of the string, so the chart alternated between the two
currencies. readDeepSeek now sorts them (money left first, then by code). The
history keeps each currency of such a balance under a key of its own
(balanceCurrencies), the card's trend is the first one's with
BalanceTrend.currency set, and the card's old line (which can't be split
again) is dropped on the first such read. app.js says the curve's legend,
readings and pace in that sign alone ("$11.12", not "$11.12 · ¥-0.05" after
every amount). The usage alert reads the first amount too, so it no longer
flips between the two currencies either.
Red before: TestBalanceHistoryTwoCurrencies (reporter's shape: CNY -0.05 and
USD 11.12, order swapped each read) fails with 'card says "¥-0.05 · $11.12",
want "$11.12 · ¥-0.05"' on the old readDeepSeek, and with the old history
alone the trend holds 11.2, -0.05, 11.15, …; TestBalanceReaders' two new
cases fail the same way. balance-currencies.test.cjs fails on the old app.js
with 'Balance$11.12 · ¥-0.05' and 'about $0.44 · ¥-0.05 a day'.
Run (Docker golang:1.26, temp HOME): go test -tags nogui ./... (only
internal/agent's TestAside* write-failure tests fail, as root in the
container; they pass as uid 501), go vet ./internal/provider ./internal/gui,
GOOS=linux/windows/darwin go vet ./internal/provider, gofmt -l. GUI:
balance-currencies, balance-curve, balance-parts, balance-fix in Chromium
and WebKit (110 pass; en/zh, light/dark, 900 and 440px). No new t() strings.
Not tried with a real DeepSeek account holding both currencies.