wwcraft_ on Discord asked for DeepSeek's 赠金 apart from what was topped
up. /user/balance gives each currency's granted_balance and
topped_up_balance beside total_balance; the card's main figure stays the
total, and the two parts are told under it as secondary detail, the way a
balance's other parts already show (no new layout). The GUI's card and
menu bar panel, the TUI's quota page and `magpie quota` say them, labels
in every language (en, zh, zh-TW, ja, de). A reply without the parts, or one
with nothing granted, reads as before.
Real reply, read once from the owner's DeepSeek key on 10-16:
{"currency":"CNY","total_balance":"134.13","granted_balance":"34.14",
"topped_up_balance":"99.98"}. Fed through readDeepSeek/readDeepSeekSplit:
"¥134.13", Granted ¥34.14, Topped up ¥99.98.
Run (at b07b518e7, this commit plus #2512's on origin/main 63be47717):
- gofmt -l clean; go vet ./... (darwin), GOOS=linux go vet -tags nogui
./..., GOOS=windows go vet ./...: clean; go build: ok.
- go test -timeout 45m ./... with pipefail, sandbox HOME: 63 packages ok,
provider, tui, cli, gui and usage among them. agent, gateway and library
hit the 45m timeout at machine load ~270 on 14 cores; the tests running
at the panic were 1s-1m14s old (TestCodexLoginAPI,
TestLoopGuardLeavesOrdinaryRepliesAlone, TestZedMCP), not a hang. Rerun
alone: library ok (1295s); agent and gateway timed out at 45m again, and
ok with -timeout 150m: agent ok (5529s); gateway red only in TestIntentClassifierGroup (#1813), TestMaxRPMWaitsForRoomInTheMinute (#1791) and TestMaxRPMGroupPrefersMemberWithRoom (#2520), known timing reds under load, each passing alone here -count=3 (19s).
- GUI, Chromium and WebKit: balance-parts (DeepSeek's parts, en and zh,
panel too) 4/4. Every GUI file touching balances, usage, sessions or
i18n (176 files, 4 at a time): red only in model-id-space (#2536),
provider-advanced-fold (#2552) and one provider-detect-draft case.
The first two fail on origin/main 63be47717 run alone. The third was
page.goto's 5s load timeout in the parallel run; run alone it passes
20/20 three times here and on main, and this diff doesn't touch the
provider editor (app.js changes are the balance card and the Usage
ranking only).
- Broken by hand: dropping readDeepSeekSplit from DeepSeek's source
turns TestDeepSeekBalanceSplit red (gift's split = "").
- Rebased onto origin/main ba132d68b (13 commits; chat.go, gateway.go, app.js, i18n.js among theirs): gofmt and go vet ./internal/... clean; Credits/DeepSeek/Balance/Ledger/RowFlags tests in usage, gateway, provider, cli, tui ok; plan-credits 12/12, balance-parts 4/4, i18n-keys 3/3 in both engines.