feat(usage): claude-desktop filter and pricing-model audit display

- add claude-desktop to AppType/KNOWN_APP_TYPES and the dashboard app
  filter; it was hidden because its rows looked like pure failure
  noise, which was the app_type attribution bug fixed on the backend
- request detail panel now shows the requested model and the pricing
  model when they differ from the response model, making route-takeover
  bills auditable from the UI
- locale keys added for zh/en/ja/zh-TW
This commit is contained in:
Jason
2026-06-10 11:57:06 +08:00
parent feea81e5bb
commit e8b07cb2a5
7 changed files with 51 additions and 5 deletions
+16 -5
View File
@@ -14,6 +14,8 @@ export interface RequestLog {
appType: string;
model: string;
requestModel?: string;
/** 写入时实际用于计价的模型名;路由接管 + request 计价模式下可能与 model 不同 */
pricingModel?: string;
costMultiplier: string;
inputTokens: number;
outputTokens: number;
@@ -141,17 +143,26 @@ export interface UsageRangeSelection {
/**
* App types whose token usage is reliably collected by the proxy.
*
* The proxy has handlers for `claude-desktop` too, but in practice those
* requests overwhelmingly fail (500/503) and contribute near-zero tokens, so
* it is hidden from the Dashboard. `opencode` / `openclaw` / `hermes` have
* no proxy handler at all — they appear only as managed apps elsewhere.
* `claude-desktop` was previously hidden because its rows looked like pure
* failure noise — that was an accounting bug: streaming/transform usage of
* the Desktop gateway was logged under app_type "claude", leaving only
* edge-case rows under "claude-desktop". The backend now attributes all
* Desktop traffic to "claude-desktop", so it is a first-class filter option.
* `opencode` / `openclaw` / `hermes` have no proxy handler at all — they
* appear only as managed apps elsewhere.
*/
export type AppType = "claude" | "codex" | "gemini" | "opencode";
export type AppType =
| "claude"
| "claude-desktop"
| "codex"
| "gemini"
| "opencode";
export type AppTypeFilter = "all" | AppType;
export const KNOWN_APP_TYPES: ReadonlyArray<AppType> = [
"claude",
"claude-desktop",
"codex",
"gemini",
"opencode",