Skip to content

fix(desktop): Usage Statistics activity log always shows "未命名会话" in the 任务 (Task) column #4218

Description

@liuxiaocs7

What happened

On the Usage Statistics page (使用统计) → Activity records (活动记录), the 任务 (Task) column shows 未命名会话 · <short id> ("Untitled session · …") for every row — even when the underlying session has a real title in the WorkHub.

Expected: named sessions show their real title in the Task column; only genuinely untitled sessions fall back to 未命名会话 · <id>.

This is a regression. #3833 fixed exactly this column by carrying the session name (SessionHeader.name) through the old packages/storage/src/usage-stats-store.ts pipeline. That pipeline was later replaced by the Runtime Host usage projection (#3697), and the old store was deleted (#4060). The new pipeline only carries sessionId, never the session name, so UsageRequestLog.sessionName is declared but never populated — and the UI's usageSessionDisplayLabel always hits the untitled fallback for every row.

How to reproduce

  1. Open Settings → Usage Statistics (使用统计).
  2. Have some model/tool activity in sessions that carry real titles.
  3. Open the Activity records (活动记录) tab and look at the 任务 (Task) column.
  4. Every row reads 未命名会话 · <short id>, regardless of whether the session actually has a name.

Environment

  • Maka commit: aa586237e
  • OS and version: macOS (Darwin 24.6.0)
  • Surface: Desktop
  • Node.js version: running from source

Logs, screenshots, or additional context

Root cause — sessionName is dropped at every layer of the current usage pipeline:

  • packages/core/src/settings.tsUsageRequestLog.sessionName is declared (with a doc comment) but no producer fills it.
  • apps/desktop/src/main/runtime-host-usage-ipc-main.tsprojectLlmLog / projectToolLog carry sessionId/turnId but never sessionName.
  • packages/runtime-host/src/protocol/usage-pricing.ts — the projection types (LlmUsageLogProjection / ToolUsageLogProjection) have no session-name field at all.
  • The UI already reads row.sessionName (apps/desktop/src/renderer/settings/usage-settings-page.tsx, usageSessionDisplayLabel), so no UI change is needed — the data layer just needs to populate the field again.

Raw usage rows (UsageLogRow) are keyed only by sessionId; the human-readable title lives in the session catalog. Recovering the name is a sessionId → name join, which the deleted store used to do.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions