Skip to content

fix: exclude Claude-imported sessions from stats (#494), truncate status bar messages (#502)#622

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-202606150007-stats-statusbar-fixes
Open

fix: exclude Claude-imported sessions from stats (#494), truncate status bar messages (#502)#622
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-202606150007-stats-statusbar-fixes

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Closes #494, improves #502

Fix 1: excludes Claude Code imported sessions (#494)

Problem: queried all sessions from the database, including those imported from Claude Code via the one-time migration. Users who just installed MiMo saw inflated metrics (e.g., 216 sessions when only 12 were native MiMo sessions, 32 days of history from old Claude data).

Solution: now queries the table to get the set of imported session IDs and filters them out before computing stats. This is the authoritative source — every imported Claude session has a row in linking to .

Files changed:

  • — import , filter imported sessions in

Fix 2: Truncate busy messages in prompt status bar (#502)

Problem: The displayed in the prompt status bar had no length limit, while the message was truncated to 80 chars. This inconsistency meant a long or malformed busy message could overflow the status bar area.

Solution:

  • Client-side: Truncate to 80 chars (77 + ) in , matching the existing retry message truncation
  • Server-side: Add Zod validation to the field in as defense-in-depth

Files changed:

  • — truncate busyMessage
  • — add max(200) to busy message schema

…uncate status bar messages (XiaomiMiMo#502)

Two fixes in one:

1.  now excludes sessions imported from Claude Code by
   querying the claude_import table and filtering out those session IDs.
   Previously, imported Claude sessions inflated all metrics (sessions,
   days, tokens, cost) making the output misleading for users who just
   migrated from Claude Code.

2. The prompt status bar busy message is now truncated to 80 characters,
   matching the existing retry message truncation. Additionally, the
   session status schema now validates that busy messages are at most
   200 characters, providing server-side defense against unexpectedly
   long status messages overflowing the status bar area.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: mimo stats includes imported Claude Code sessions in all metrics

1 participant