Overview
dsh-cost-pill
README / EN
Package documentation
Registry summary
dsh.pub verifies the pinned bundle contract, runtime facts, and distribution semantics. The complete README remains in the source repository.
Read the full README on GitHubLIMITATIONS
Known limitations
- While the session is attached the host folds usage per request, so a span across the price cut, the routing change or a peak boundary keeps its own rate table. A **detached** session is priced by the host as one aggregate at the current Flash rates and carries **no** estimate marker; the browser half's own fallback estimate uses the same current rates and is marked `(估)` in Chinese / `(est)` in English. - Every reading is conditional: a missing balance hides only that segment; a cost of exactly `¥0.00` hides the cost segment; and when the host route is missing or errors, the whole pill disappears silently, with no placeholder and no error message. After a failure it stops per-step polling and keeps only the 60 s poll. - Amounts always print with a `¥` prefix, regardless of the account currency the API reports. Balance uses 2 decimals; costs use 2 decimals, or 4 below `¥0.01`. - The per-model breakdown appears only when the host can fold the session by model, and model ids are normalised (for example `deepseek-v4-flash` and `deepseek-v4-flash-vision-exp` both display as `deepseek-flash`). - Balance failures are silent: no key, an invalid key, a network error and the 15 s timeout all produce a `200` response with no `balance_infos` field, and that empty result is cached for 30 s as well. - The balance cache is process-wide and shared across sessions; it is only invalidated by a different key, so a top-up can take up to 30 s to appear. - Model ids the plugin does not recognise are priced with the Flash table. - Costs accumulate per request, so rounding may differ from the account ledger. - Events without a model source or usage are skipped. - The popup has no height cap and does not share the official pills' mutual-exclusion state, so it can stay open alongside another popup. - The built-in holiday table covers 2026 only.
