Skip to content

feat: add MiMo Code client support - #710

Merged
junhoyeo merged 6 commits into
junhoyeo:mainfrom
LynnGuo666:feat/micode-client
Jun 17, 2026
Merged

feat: add MiMo Code client support#710
junhoyeo merged 6 commits into
junhoyeo:mainfrom
LynnGuo666:feat/micode-client

Conversation

@LynnGuo666

@LynnGuo666 LynnGuo666 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Add MiMo Code (XiaomiMiMo/MiMo-Code) as a new supported client in Tokscale.

MiMo Code is a TypeScript fork of OpenCode, released V0.1.0 on June 10, 2026. It stores session data in SQLite at ~/.local/share/micode/mimocode.db with a schema nearly identical to OpenCode's.

Changes

  • Client definition: Add MiMoCode = 28 to define_clients! macro with scan path ~/.local/share/micode/mimocode*.db
  • Session parser: New micode.rs module adapted from opencode.rs, supporting SQLite parsing with fingerprint-based deduplication
  • DB discovery: discover_micode_dbs() function in scanner.rs matching mimocode.db and mimocode-<channel>.db patterns
  • Parsing pipeline: Integrated into lib.rs following the same load_or_parse_sqlite_source pattern as OpenCode
  • CLI filter: Micode variant added to ClientFilter enum with --micode legacy flag
  • TUI: Entry added with hotkey j
  • Frontend: Added to SUPPORTED_CLIENT_TYPES, display name "MiMo Code", brand color #FF6900

Testing

All 1710 tests pass (915 tokscale-core + 658 tokscale-cli + integration tests). 6 new unit tests added for the MiMo Code parser covering basic parsing, user message skipping, negative value clamping, fork dedup, workspace resolution, and agent field handling.


Summary by cubic

Adds MiMo Code client support with SQLite session parsing, discovery, and UI/CLI integration so Tokscale can ingest and display MiMo Code activity.

  • New Features

    • Core/Pipeline: added MiMoCode = 30 with scan path ~/.local/share/micode/mimocode*.db, discover_micode_dbs() in tokscale-core/src/scanner.rs, and integration via load_or_parse_sqlite_source in tokscale-core/src/lib.rs.
    • Parser: new tokscale-core/src/sessions/micode.rs (SQLite) with fingerprint dedup, token/cost clamping, workspace resolution (session join + path root), agent normalization, and duration tracking.
    • CLI/TUI: ClientFilter::Micode, legacy --micode flag, and TUI entry (hotkey m) in tokscale-cli.
    • Frontend: added to SUPPORTED_CLIENT_TYPES, display name "MiMo Code", logo, and color #FF6900 in packages/frontend.
    • Docs: updated README.md, README.ja.md, README.ko.md, README.zh-cn.md with MiMo Code details, CLI values, storage paths, and the SQLite query section.
    • Tests: 8 unit tests (7 parser + 1 scanner); all 1710 tests pass.
  • Bug Fixes

    • Parser: make tokens.cache optional to avoid dropping assistant messages; remove unused session_id JSON field; drop redundant sort/dedup.
    • Scanner: add filename predicate test for mimocode*.db.
    • Docs/Frontend: correct MiMo Code GitHub org/logo links; fix README timestamp examples to 13‑digit epoch ms.

Written for commit ba8d22a. Summary will update on new commits.

Review in cubic

MiMo Code (github.com/XiaomiMiMo/MiMo-Code) is a TypeScript fork of
OpenCode, released V0.1.0 on June 10, 2026. It stores session data in
SQLite at ~/.local/share/micode/mimocode.db with a schema nearly
identical to OpenCode's.

Changes:
- Add MiMoCode client definition (ClientId=28) in clients.rs
- New session parser micode.rs (adapted from opencode.rs) with SQLite
  support and 6 unit tests
- Add discover_micode_dbs() in scanner.rs for DB discovery
- Integrate MiMo Code parsing pipeline in lib.rs
- Add Micode variant to ClientFilter in main.rs
- Add TUI entry with hotkey 'j'
- Add frontend support (types, display name, logo, brand color)

All 1710 tests pass.
Copilot AI review requested due to automatic review settings June 11, 2026 11:46
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokscale Ready Ready Preview, Comment Jun 17, 2026 6:52pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds first-class MiMo Code client support across the stack (frontend labels/logos/colors, Rust core scanning & parsing, and CLI filtering/UI).

Changes:

  • Extend supported client identifiers and UI metadata to include micode / “MiMo Code”.
  • Add MiMo Code SQLite discovery under XDG data and parse messages from mimocode*.db.
  • Wire MiMo Code into core aggregation and CLI client selection/UI lists.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/frontend/src/lib/types.ts Adds micode to supported client types.
packages/frontend/src/lib/constants.ts Adds MiMo Code display name, logo, and colors.
crates/tokscale-core/src/sessions/mod.rs Registers new micode session parser module.
crates/tokscale-core/src/sessions/micode.rs Implements MiMo Code SQLite parser + tests.
crates/tokscale-core/src/scanner.rs Discovers MiMo Code DBs under ~/.local/share/micode.
crates/tokscale-core/src/lib.rs Aggregates parsed MiMo Code messages into all_messages.
crates/tokscale-core/src/clients.rs Adds ClientId::MiMoCode and updates count test.
crates/tokscale-cli/src/tui/data/mod.rs Updates client list tests to include MiMo Code.
crates/tokscale-cli/src/tui/client_ui.rs Adds MiMo Code to TUI client UI list.
crates/tokscale-cli/src/main.rs Adds CLI filters/flags mapping for MiMo Code.
Comments suppressed due to low confidence (1)

crates/tokscale-cli/src/main.rs:1

  • The variant name Micode is inconsistent with ClientId::MiMoCode and the user-facing string “MiMo Code”, which can make grep/maintenance harder. Renaming the variant to MiMoCode (while keeping as_filter_str() => "micode") would align naming across the codebase without changing CLI behavior.
mod antigravity;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +56 to +68
#[derive(Debug, Deserialize)]
pub struct MiMoCodeTokens {
pub input: i64,
pub output: i64,
pub reasoning: Option<i64>,
pub cache: MiMoCodeCache,
}

#[derive(Debug, Deserialize)]
pub struct MiMoCodeCache {
pub read: i64,
pub write: i64,
}
Comment on lines +43 to +54
fn deserialize_micode_path<'de, D>(deserializer: D) -> Result<Option<MiMoCodePath>, D::Error>
where
D: serde::Deserializer<'de>,
{
let value = serde_json::Value::deserialize(deserializer)?;
let root = value
.get("root")
.and_then(|root| root.as_str())
.map(str::to_string);

Ok(Some(MiMoCodePath { root }))
}
Comment on lines +503 to +527
pub(crate) fn discover_micode_dbs(data_dir: &Path) -> Vec<PathBuf> {
let entries = match std::fs::read_dir(data_dir) {
Ok(entries) => entries,
Err(_) => return Vec::new(),
};

let mut dbs: Vec<PathBuf> = entries
.filter_map(|entry| entry.ok())
.filter_map(|entry| {
let file_type = entry.file_type().ok()?;
if !file_type.is_file() && !entry.path().is_file() {
return None;
}
let path = entry.path();
let name = path.file_name()?.to_str()?;
if !is_micode_db_filename(name) {
return None;
}
Some(path)
})
.collect();

dbs.sort_unstable();
dbs
}

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/tokscale-cli/src/tui/data/mod.rs">

<violation number="1" location="crates/tokscale-cli/src/tui/data/mod.rs:1369">
P2: Incomplete test coverage for MiMoCode: `test_client_all` was updated but `test_client_as_str`, `test_client_key`, and `test_client_from_key` still stop at `ClientId::Grok` and do not assert the new client's display name ('MiMo Code') or hotkey ('j') / reverse lookup.</violation>
</file>

<file name="crates/tokscale-core/src/scanner.rs">

<violation number="1" location="crates/tokscale-core/src/scanner.rs:503">
P2: MiMo Code DB discovery logic duplicates existing OpenCode discovery code; extract a shared parameterized helper to prevent future drift.</violation>

<violation number="2" location="crates/tokscale-core/src/scanner.rs:865">
P3: Redundant sort: `discover_micode_dbs` already sorts results internally (`dbs.sort_unstable()`), but the caller immediately sorts again here. Either remove the internal sort in the helper or remove this redundant `sort_unstable()` call to keep one canonical ordering location.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread crates/tokscale-cli/src/tui/data/mod.rs Outdated
assert_eq!(clients[25], ClientId::Cline);
assert_eq!(clients[26], ClientId::Gjc);
assert_eq!(clients[27], ClientId::Grok);
assert_eq!(clients[28], ClientId::MiMoCode);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Incomplete test coverage for MiMoCode: test_client_all was updated but test_client_as_str, test_client_key, and test_client_from_key still stop at ClientId::Grok and do not assert the new client's display name ('MiMo Code') or hotkey ('j') / reverse lookup.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/tokscale-cli/src/tui/data/mod.rs, line 1369:

<comment>Incomplete test coverage for MiMoCode: `test_client_all` was updated but `test_client_as_str`, `test_client_key`, and `test_client_from_key` still stop at `ClientId::Grok` and do not assert the new client's display name ('MiMo Code') or hotkey ('j') / reverse lookup.</comment>

<file context>
@@ -1366,6 +1366,7 @@ mod tests {
         assert_eq!(clients[25], ClientId::Cline);
         assert_eq!(clients[26], ClientId::Gjc);
         assert_eq!(clients[27], ClientId::Grok);
+        assert_eq!(clients[28], ClientId::MiMoCode);
     }
 
</file context>

/// Matches `mimocode.db` and `mimocode-<channel>.db` (channel names
/// sanitized with the same `[a-zA-Z0-9._-]` character class that MiMo
/// Code's `getChannelPath` normalizes to). Ignores WAL/SHM sidecar files.
pub(crate) fn discover_micode_dbs(data_dir: &Path) -> Vec<PathBuf> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: MiMo Code DB discovery logic duplicates existing OpenCode discovery code; extract a shared parameterized helper to prevent future drift.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/tokscale-core/src/scanner.rs, line 503:

<comment>MiMo Code DB discovery logic duplicates existing OpenCode discovery code; extract a shared parameterized helper to prevent future drift.</comment>

<file context>
@@ -492,6 +495,59 @@ fn is_opencode_db_filename(name: &str) -> bool {
+/// Matches `mimocode.db` and `mimocode-<channel>.db` (channel names
+/// sanitized with the same `[a-zA-Z0-9._-]` character class that MiMo
+/// Code's `getChannelPath` normalizes to). Ignores WAL/SHM sidecar files.
+pub(crate) fn discover_micode_dbs(data_dir: &Path) -> Vec<PathBuf> {
+    let entries = match std::fs::read_dir(data_dir) {
+        Ok(entries) => entries,
</file context>

Comment thread crates/tokscale-core/src/scanner.rs Outdated
@entrptaher

Copy link
Copy Markdown

I think you would also need to update the documentation/readme files.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/tokscale-cli/src/tui/data/mod.rs">

<violation number="1" location="crates/tokscale-cli/src/tui/data/mod.rs:1369">
P2: Incomplete test coverage for MiMoCode: `test_client_all` was updated but `test_client_as_str`, `test_client_key`, and `test_client_from_key` still stop at `ClientId::Grok` and do not assert the new client's display name ('MiMo Code') or hotkey ('j') / reverse lookup.</violation>
</file>

<file name="crates/tokscale-core/src/scanner.rs">

<violation number="1" location="crates/tokscale-core/src/scanner.rs:503">
P2: MiMo Code DB discovery logic duplicates existing OpenCode discovery code; extract a shared parameterized helper to prevent future drift.</violation>
</file>

<file name="README.ko.md">

<violation number="1" location="README.ko.md:329">
P2: `--client` possible-values list includes `cline` and `warp`, but these platforms are missing from all other sections of the Korean README (feature list, source filtering list, supported-client table, data locations table, and dedicated sections). This creates a documentation inconsistency where users see valid CLI values but have no corresponding documentation for those platforms.</violation>
</file>

<file name="README.md">

<violation number="1" location="README.md:86">
P2: README omits MiMo Code channel DB support (`mimocode-<channel>.db`) despite implementation support</violation>
</file>

<file name="README.ja.md">

<violation number="1" location="README.ja.md:1328">
P3: MiMo Code documentation only documents singular `mimocode.db` but the scanner supports `mimocode-<channel>.db` channel variants</violation>
</file>

<file name="README.zh-cn.md">

<violation number="1" location="README.zh-cn.md:83">
P2: MiMo Code documentation omits channel DB variants (`mimocode-<channel>.db`) that the scanner supports, creating a cross-file contract mismatch. The scanner (`discover_micode_dbs` / `is_micode_db_filename`) matches both `mimocode.db` and `mimocode-<channel>.db` identically to OpenCode, yet the README only documents the base filename while OpenCode's docs explicitly note channel support.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread README.ko.md Outdated
Comment thread README.zh-cn.md Outdated
| <img width="48px" src=".github/assets/client-zed.webp" alt="Zed Agent" /> | [Zed Agent](https://zed.dev/docs/ai/agent-panel) | `~/.local/share/zed/threads/threads.db`(macOS: `~/Library/Application Support/Zed/threads/threads.db`;Windows: `%LOCALAPPDATA%/Zed/threads/threads.db`;仅限托管 Zed 模型,不含外部 ACP 代理) | ✅ 支持 |
| <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json`(+ `*.jsonl`)和 `~/.local/share/kiro-cli/data.sqlite3`(macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ 支持 |
| <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/`(可通过 `GJC_CODING_AGENT_DIR`、`GJC_CONFIG_DIR`、`PI_CONFIG_DIR` 覆盖;Linux/macOS 上 `$XDG_DATA_HOME/gjc/sessions/` 亦支持) | ✅ 支持 |
| <img width="48px" src="https://github.com/xiaomi.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/xiaomi/mimo-code) | `~/.local/share/micode/mimocode.db`(XDG 数据目录;SQLite) | ✅ 支持 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: MiMo Code documentation omits channel DB variants (mimocode-<channel>.db) that the scanner supports, creating a cross-file contract mismatch. The scanner (discover_micode_dbs / is_micode_db_filename) matches both mimocode.db and mimocode-<channel>.db identically to OpenCode, yet the README only documents the base filename while OpenCode's docs explicitly note channel support.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.zh-cn.md, line 83:

<comment>MiMo Code documentation omits channel DB variants (`mimocode-<channel>.db`) that the scanner supports, creating a cross-file contract mismatch. The scanner (`discover_micode_dbs` / `is_micode_db_filename`) matches both `mimocode.db` and `mimocode-<channel>.db` identically to OpenCode, yet the README only documents the base filename while OpenCode's docs explicitly note channel support.</comment>

<file context>
@@ -80,6 +80,7 @@
 | <img width="48px" src=".github/assets/client-zed.webp" alt="Zed Agent" /> | [Zed Agent](https://zed.dev/docs/ai/agent-panel) | `~/.local/share/zed/threads/threads.db`(macOS: `~/Library/Application Support/Zed/threads/threads.db`;Windows: `%LOCALAPPDATA%/Zed/threads/threads.db`;仅限托管 Zed 模型,不含外部 ACP 代理) | ✅ 支持 |
 | <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json`(+ `*.jsonl`)和 `~/.local/share/kiro-cli/data.sqlite3`(macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ 支持 |
 | <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/`(可通过 `GJC_CODING_AGENT_DIR`、`GJC_CONFIG_DIR`、`PI_CONFIG_DIR` 覆盖;Linux/macOS 上 `$XDG_DATA_HOME/gjc/sessions/` 亦支持) | ✅ 支持 |
+| <img width="48px" src="https://github.com/xiaomi.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/xiaomi/mimo-code) | `~/.local/share/micode/mimocode.db`(XDG 数据目录;SQLite) | ✅ 支持 |
 | <img width="48px" src=".github/assets/client-synthetic.png" alt="Synthetic" /> | [Synthetic](https://synthetic.new/) | 通过 `hf:` 模型前缀或 `synthetic` provider 从其他来源重归属(+ [Octofriend](https://github.com/synthetic-lab/octofriend): `~/.local/share/octofriend/sqlite.db`) | ✅ 支持 |
 
</file context>

Comment thread README.md Outdated
| <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json` (+ `*.jsonl`) and `~/.local/share/kiro-cli/data.sqlite3` (macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ Yes |
| <img width="48px" src="https://github.com/cline.png" alt="Cline" /> | [Cline](https://github.com/cline/cline) | VS Code globalStorage tasks (Linux: `~/.config/Code/...`; macOS: `~/Library/Application Support/Code/...`; Windows: `%APPDATA%\Code\...`; server: `~/.vscode-server/data/User/globalStorage/saoudrizwan.claude-dev/tasks/`) | ✅ Yes |
| <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/` (override via `GJC_CODING_AGENT_DIR`, `GJC_CONFIG_DIR`, `PI_CONFIG_DIR`; `$XDG_DATA_HOME/gjc/sessions/` on Linux/macOS) | ✅ Yes |
| <img width="48px" src="https://github.com/xiaomi.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/xiaomi/mimo-code) | `~/.local/share/micode/mimocode.db` (XDG data dir; SQLite) | ✅ Yes |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: README omits MiMo Code channel DB support (mimocode-<channel>.db) despite implementation support

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 86:

<comment>README omits MiMo Code channel DB support (`mimocode-<channel>.db`) despite implementation support</comment>

<file context>
@@ -83,6 +83,7 @@
 | <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json` (+ `*.jsonl`) and `~/.local/share/kiro-cli/data.sqlite3` (macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ Yes |
 | <img width="48px" src="https://github.com/cline.png" alt="Cline" /> | [Cline](https://github.com/cline/cline) | VS Code globalStorage tasks (Linux: `~/.config/Code/...`; macOS: `~/Library/Application Support/Code/...`; Windows: `%APPDATA%\Code\...`; server: `~/.vscode-server/data/User/globalStorage/saoudrizwan.claude-dev/tasks/`) | ✅ Yes |
 | <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/` (override via `GJC_CODING_AGENT_DIR`, `GJC_CONFIG_DIR`, `PI_CONFIG_DIR`; `$XDG_DATA_HOME/gjc/sessions/` on Linux/macOS) | ✅ Yes |
+| <img width="48px" src="https://github.com/xiaomi.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/xiaomi/mimo-code) | `~/.local/share/micode/mimocode.db` (XDG data dir; SQLite) | ✅ Yes |
 | <img width="48px" src=".github/assets/client-synthetic.png" alt="Synthetic" /> | [Synthetic](https://synthetic.new/) | Re-attributed from other sources via `hf:` model prefix or `synthetic` provider (+ [Octofriend](https://github.com/synthetic-lab/octofriend): `~/.local/share/octofriend/sqlite.db`) | ✅ Yes |
 
</file context>

Comment thread README.ja.md

### MiMo Code

場所: `~/.local/share/micode/mimocode.db`(XDG データディレクトリ)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: MiMo Code documentation only documents singular mimocode.db but the scanner supports mimocode-<channel>.db channel variants

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.ja.md, line 1328:

<comment>MiMo Code documentation only documents singular `mimocode.db` but the scanner supports `mimocode-<channel>.db` channel variants</comment>

<file context>
@@ -1321,6 +1323,41 @@ Synthetic は他ソースのメッセージを後処理で再帰属します。`
 
+### MiMo Code
+
+場所: `~/.local/share/micode/mimocode.db`(XDG データディレクトリ)
+
+MiMo Code は SQLite データベースにセッションデータを保存します。Tokscale はワークスペースコンテキストのために `session` テーブルと結合した `message` テーブルをクエリします:
</file context>

@LynnGuo666

Copy link
Copy Markdown
Contributor Author

I fixed the formatting issue that caused the cargo fmt --all -- --check workflow to fail. Could you please approve the workflow again? :)

junhoyeo added 2 commits June 18, 2026 02:44
…che, add tests

Align MiMo Code logo and repo links on the real github.com/XiaomiMiMo org,
fix README time.created examples to 13-digit epoch ms (parser convention,
matching OpenCode), make the cache field optional so cache-less assistant
messages are not silently dropped, drop the unused sessionID JSON field, and
remove a redundant sort/dedup. Adds parser and scanner-filename tests.

Confidence: high
Scope-risk: narrow
Not-tested: real mimocode.db timestamp unit (verified against OpenCode fork convention, no sample DB available)

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="README.md">

<violation number="1" location="README.md:86">
P2: MiMo Code README links to wrong GitHub repository (`XiaomiMiMo/MiMo` instead of `XiaomiMiMo/MiMo-Code`)</violation>

<violation number="2" location="README.md:86">
P2: README omits MiMo Code channel DB support (`mimocode-<channel>.db`) despite implementation support</violation>
</file>

<file name="README.ko.md">

<violation number="1" location="README.ko.md:83">
P2: Incorrect MiMo Code repository URL: links to XiaomiMiMo/MiMo instead of XiaomiMiMo/MiMo-Code.</violation>
</file>

<file name="README.ja.md">

<violation number="1" location="README.ja.md:83">
P2: MiMo Code README link targets wrong repository: links to `XiaomiMiMo/MiMo` but PR description specifies `XiaomiMiMo/MiMo-Code`</violation>

<violation number="2" location="README.ja.md:1328">
P3: MiMo Code documentation only documents singular `mimocode.db` but the scanner supports `mimocode-<channel>.db` channel variants</violation>
</file>

<file name="crates/tokscale-cli/src/tui/data/mod.rs">

<violation number="1" location="crates/tokscale-cli/src/tui/data/mod.rs:1369">
P2: Incomplete test coverage for MiMoCode: `test_client_all` was updated but `test_client_as_str`, `test_client_key`, and `test_client_from_key` still stop at `ClientId::Grok` and do not assert the new client's display name ('MiMo Code') or hotkey ('j') / reverse lookup.</violation>
</file>

<file name="crates/tokscale-core/src/scanner.rs">

<violation number="1" location="crates/tokscale-core/src/scanner.rs:503">
P2: MiMo Code DB discovery logic duplicates existing OpenCode discovery code; extract a shared parameterized helper to prevent future drift.</violation>
</file>

<file name="README.zh-cn.md">

<violation number="1" location="README.zh-cn.md:83">
P2: MiMo Code documentation omits channel DB variants (`mimocode-<channel>.db`) that the scanner supports, creating a cross-file contract mismatch. The scanner (`discover_micode_dbs` / `is_micode_db_filename`) matches both `mimocode.db` and `mimocode-<channel>.db` identically to OpenCode, yet the README only documents the base filename while OpenCode's docs explicitly note channel support.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread README.md
| <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json` (+ `*.jsonl`) and `~/.local/share/kiro-cli/data.sqlite3` (macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ Yes |
| <img width="48px" src="https://github.com/cline.png" alt="Cline" /> | [Cline](https://github.com/cline/cline) | VS Code globalStorage tasks (Linux: `~/.config/Code/...`; macOS: `~/Library/Application Support/Code/...`; Windows: `%APPDATA%\Code\...`; server: `~/.vscode-server/data/User/globalStorage/saoudrizwan.claude-dev/tasks/`) | ✅ Yes |
| <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/` (override via `GJC_CODING_AGENT_DIR`, `GJC_CONFIG_DIR`, `PI_CONFIG_DIR`; `$XDG_DATA_HOME/gjc/sessions/` on Linux/macOS) | ✅ Yes |
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db` (XDG data dir; SQLite) | ✅ Yes |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: MiMo Code README links to wrong GitHub repository (XiaomiMiMo/MiMo instead of XiaomiMiMo/MiMo-Code)

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 86:

<comment>MiMo Code README links to wrong GitHub repository (`XiaomiMiMo/MiMo` instead of `XiaomiMiMo/MiMo-Code`)</comment>

<file context>
@@ -83,7 +83,7 @@
 | <img width="48px" src="https://github.com/cline.png" alt="Cline" /> | [Cline](https://github.com/cline/cline) | VS Code globalStorage tasks (Linux: `~/.config/Code/...`; macOS: `~/Library/Application Support/Code/...`; Windows: `%APPDATA%\Code\...`; server: `~/.vscode-server/data/User/globalStorage/saoudrizwan.claude-dev/tasks/`) | ✅ Yes |
 | <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/` (override via `GJC_CODING_AGENT_DIR`, `GJC_CONFIG_DIR`, `PI_CONFIG_DIR`; `$XDG_DATA_HOME/gjc/sessions/` on Linux/macOS) | ✅ Yes |
-| <img width="48px" src="https://github.com/xiaomi.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/xiaomi/mimo-code) | `~/.local/share/micode/mimocode.db` (XDG data dir; SQLite) | ✅ Yes |
+| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db` (XDG data dir; SQLite) | ✅ Yes |
 | <img width="48px" src=".github/assets/client-synthetic.png" alt="Synthetic" /> | [Synthetic](https://synthetic.new/) | Re-attributed from other sources via `hf:` model prefix or `synthetic` provider (+ [Octofriend](https://github.com/synthetic-lab/octofriend): `~/.local/share/octofriend/sqlite.db`) | ✅ Yes |
 
</file context>
Suggested change
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db` (XDG data dir; SQLite) | ✅ Yes |
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo-Code) | `~/.local/share/micode/mimocode.db` (XDG data dir; SQLite) | ✅ Yes |

Comment thread README.ko.md
| <img width="48px" src=".github/assets/client-zed.webp" alt="Zed Agent" /> | [Zed Agent](https://zed.dev/docs/ai/agent-panel) | `~/.local/share/zed/threads/threads.db` (macOS: `~/Library/Application Support/Zed/threads/threads.db`; Windows: `%LOCALAPPDATA%/Zed/threads/threads.db`; 호스팅된 Zed 모델 전용, 외부 ACP 에이전트 제외) | ✅ 지원 |
| <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json` (+ `*.jsonl`) 및 `~/.local/share/kiro-cli/data.sqlite3` (macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ 지원 |
| <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/` (`GJC_CODING_AGENT_DIR`, `GJC_CONFIG_DIR`, `PI_CONFIG_DIR`로 오버라이드 가능; Linux/macOS에서는 `$XDG_DATA_HOME/gjc/sessions/`도 확인) | ✅ 지원 |
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db` (XDG 데이터 디렉토리; SQLite) | ✅ 지원 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Incorrect MiMo Code repository URL: links to XiaomiMiMo/MiMo instead of XiaomiMiMo/MiMo-Code.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.ko.md, line 83:

<comment>Incorrect MiMo Code repository URL: links to XiaomiMiMo/MiMo instead of XiaomiMiMo/MiMo-Code.</comment>

<file context>
@@ -80,7 +80,7 @@
 | <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json` (+ `*.jsonl`) 및 `~/.local/share/kiro-cli/data.sqlite3` (macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ 지원 |
 | <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/` (`GJC_CODING_AGENT_DIR`, `GJC_CONFIG_DIR`, `PI_CONFIG_DIR`로 오버라이드 가능; Linux/macOS에서는 `$XDG_DATA_HOME/gjc/sessions/`도 확인) | ✅ 지원 |
-| <img width="48px" src="https://github.com/xiaomi.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/xiaomi/mimo-code) | `~/.local/share/micode/mimocode.db` (XDG 데이터 디렉토리; SQLite) | ✅ 지원 |
+| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db` (XDG 데이터 디렉토리; SQLite) | ✅ 지원 |
 | <img width="48px" src=".github/assets/client-synthetic.png" alt="Synthetic" /> | [Synthetic](https://synthetic.new/) | `hf:` 모델/`synthetic` provider 감지로 다른 소스에서 재귀속 (+ [Octofriend](https://github.com/synthetic-lab/octofriend): `~/.local/share/octofriend/sqlite.db`) | ✅ 지원 |
 
</file context>
Suggested change
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db` (XDG 데이터 디렉토리; SQLite) | ✅ 지원 |
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo-Code) | `~/.local/share/micode/mimocode.db` (XDG 데이터 디렉토리; SQLite) | ✅ 지원 |

Comment thread README.ja.md
| <img width="48px" src=".github/assets/client-zed.webp" alt="Zed Agent" /> | [Zed Agent](https://zed.dev/docs/ai/agent-panel) | `~/.local/share/zed/threads/threads.db`(macOS: `~/Library/Application Support/Zed/threads/threads.db`; Windows: `%LOCALAPPDATA%/Zed/threads/threads.db`; ホスティング済み Zed モデル専用、外部 ACP エージェントは対象外) | ✅ 対応 |
| <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json`(+ `*.jsonl`)と `~/.local/share/kiro-cli/data.sqlite3`(macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ 対応 |
| <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/`(`GJC_CODING_AGENT_DIR`、`GJC_CONFIG_DIR`、`PI_CONFIG_DIR` でオーバーライド可能;Linux/macOS では `$XDG_DATA_HOME/gjc/sessions/` も解決) | ✅ 対応 |
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db`(XDG データディレクトリ;SQLite) | ✅ 対応 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: MiMo Code README link targets wrong repository: links to XiaomiMiMo/MiMo but PR description specifies XiaomiMiMo/MiMo-Code

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.ja.md, line 83:

<comment>MiMo Code README link targets wrong repository: links to `XiaomiMiMo/MiMo` but PR description specifies `XiaomiMiMo/MiMo-Code`</comment>

<file context>
@@ -80,7 +80,7 @@
 | <img width="48px" src="https://github.com/kirodotdev.png" alt="Kiro" /> | Kiro | `~/.kiro/sessions/cli/*.json`(+ `*.jsonl`)と `~/.local/share/kiro-cli/data.sqlite3`(macOS: `~/Library/Application Support/kiro-cli/data.sqlite3`) | ✅ 対応 |
 | <img width="48px" src="https://github.com/user-attachments/assets/7246e920-f3f8-4b6e-847e-030ae04e86c2" alt="Gajae-Code" /> | [gajae-code (gjc)](https://github.com/Yeachan-Heo/gajae-code) | `~/.gjc/agent/sessions/`(`GJC_CODING_AGENT_DIR`、`GJC_CONFIG_DIR`、`PI_CONFIG_DIR` でオーバーライド可能;Linux/macOS では `$XDG_DATA_HOME/gjc/sessions/` も解決) | ✅ 対応 |
-| <img width="48px" src="https://github.com/xiaomi.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/xiaomi/mimo-code) | `~/.local/share/micode/mimocode.db`(XDG データディレクトリ;SQLite) | ✅ 対応 |
+| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db`(XDG データディレクトリ;SQLite) | ✅ 対応 |
 | <img width="48px" src=".github/assets/client-synthetic.png" alt="Synthetic" /> | [Synthetic](https://synthetic.new/) | `hf:`モデルや`synthetic`プロバイダを検出して他ソースから再帰属(+ [Octofriend](https://github.com/synthetic-lab/octofriend): `~/.local/share/octofriend/sqlite.db`) | ✅ 対応 |
 
</file context>
Suggested change
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo) | `~/.local/share/micode/mimocode.db`(XDG データディレクトリ;SQLite) | ✅ 対応 |
| <img width="48px" src="https://github.com/XiaomiMiMo.png" alt="MiMo Code" /> | [MiMo Code](https://github.com/XiaomiMiMo/MiMo-Code) | `~/.local/share/micode/mimocode.db`(XDG データディレクトリ;SQLite) | ✅ 対応 |

@junhoyeo
junhoyeo merged commit a75533e into junhoyeo:main Jun 17, 2026
3 checks passed
junhoyeo added a commit that referenced this pull request Jun 18, 2026
…ster

test_build_client_filter_all_legacy_flags pinned a hardcoded `required` list
that was not updated when MiMo Code (#710) and Antigravity CLI (#713) were added,
so the len() assertion failed on main (671 passed / 1 failed) and broke the Code
Coverage job for every open PR. Add the two missing ids.

Confidence: high
Scope-risk: narrow
junhoyeo added a commit that referenced this pull request Jun 22, 2026
…746)

* docs: sync EN/ja/ko/zh-cn for unreleased clients + breaking flag removal

Pre-v3.2.0 documentation sync for the unreleased range (v3.1.3..main):

- #465: replace the now-false legacy per-client flag notices in ja/ko/zh-cn
  (they claimed the removed flags still work) with a v3.2.0 breaking-change
  migration note; add the same note to README.md (which had none).
- #728: document the MiniMax Token Plan subscription source (distinct from the
  MINIMAX_API_KEY row) in all locales; port the entire Subscription Usage
  section into ja/ko/zh-cn (was English-only).
- #718: add the Jcode table row + detail section to the locales missing them.
- #726: document the TOKSCALE_FM_DEBUG env var in all locales.
- #633: add the missing task-attributed report bullet to README.ja Key Features.
- drift: add Junie to the frontend Source-filtering list (all locales).
- #710: fix the MiMo Code repo link (XiaomiMiMo/MiMo -> XiaomiMiMo/MiMo-Code).
- #717: disclose Command Code token usage is estimated (~4 chars/token).

Confidence: medium
Scope-risk: narrow
Directive: ja/ko/zh-cn translations of the ported Subscription Usage section are machine-generated and should get a native-speaker review pass
Not-tested: #713 Antigravity CLI detail section was not added — no English source section exists to port from

* fix(report): feed real session content to the summarizer (#633)

extract_content_for_session unconditionally returned metadata_only_content()
(first_user_message hardcoded None), so the report summarizer never saw any
conversation content and the four real per-client extractors were dead code.

Add content_extractor::extract_session_content, which dispatches to the correct
per-client extractor (opencode/claude/codex/gemini) and falls back to
metadata-only — never erroring or panicking — for unknown clients, missing
candidates, or unreadable/unparseable files. report.rs builds a SessionPathIndex
once (session_id -> transcript file, plus opencode DBs) and threads it through
run_summarizer so each payload carries the real first user message.

Confidence: high
Scope-risk: moderate
Rejected: thread file paths through core's scanner/WikiEntry | too invasive; indexed at the report layer instead
Not-tested: end-to-end opencode/codex/gemini extraction in report.rs (core dispatcher covers claude + all fallback paths; per-client extractors are pre-existing)

* docs: name the breaking release v4.0.0 (was v3.2.0)

The per-client flag removal (#465) is a breaking change, so the next release is v4.0.0, not v3.2.0. Update the migration notes in all four README locales and the main.rs doc comment accordingly.

* fix(report): real Codex/Gemini extraction + (client,session_id) index keying

Addresses automated review feedback on the #633 report-summarizer-content
fix (PR #746). The summarizer still surfaced (none) for normal Codex/Gemini
sessions and could mis-route cross-client session_id collisions.

- content_extractor: parse the current on-disk Codex format (event_msg with
  payload.type == "user_message", text in payload.message) and skip
  harness-injected context blocks (<environment_context>/<system-reminder>/
  <user_instructions>), mirroring sessions::codex.
- content_extractor: Gemini extractor now handles chat-recording JSON
  (messages[].type == "user" / content) and falls back to scanning
  line-delimited JSONL; empty/whitespace user text is treated as not-found.
- extract_session_content: an empty/whitespace first_user_message no longer
  counts as success, so scanning continues to a later candidate with real text.
- report: SessionPathIndex is keyed by (client, session_id) to prevent
  cross-client collisions, and Gemini files are keyed by their in-file
  sessionId (via gemini_session_id_for_file) rather than the filename stem,
  since the wiki entry's session_id is derived from inside the file.
- Added fixture-based regression tests for all of the above.

Constraint: wiki session_id for Gemini comes from the in-file sessionId, not the path stem
Rejected: match any leading '<' for Codex injected blocks | drops legit prompts starting with markup
Confidence: high
Scope-risk: narrow
pinion05 added a commit to pinion05/tokscale that referenced this pull request Jun 23, 2026
* feat: add MiMo Code client support

MiMo Code (github.com/XiaomiMiMo/MiMo-Code) is a TypeScript fork of
OpenCode, released V0.1.0 on June 10, 2026. It stores session data in
SQLite at ~/.local/share/micode/mimocode.db with a schema nearly
identical to OpenCode's.

Changes:
- Add MiMoCode client definition (ClientId=28) in clients.rs
- New session parser micode.rs (adapted from opencode.rs) with SQLite
  support and 6 unit tests
- Add discover_micode_dbs() in scanner.rs for DB discovery
- Integrate MiMo Code parsing pipeline in lib.rs
- Add Micode variant to ClientFilter in main.rs
- Add TUI entry with hotkey 'j'
- Add frontend support (types, display name, logo, brand color)

All 1710 tests pass.

* docs: add MiMo Code client to README in all languages

* chore: format micode changes

* fix(micode): correct logo org/repo links, doc timestamps, optional cache, add tests

Align MiMo Code logo and repo links on the real github.com/XiaomiMiMo org,
fix README time.created examples to 13-digit epoch ms (parser convention,
matching OpenCode), make the cache field optional so cache-less assistant
messages are not silently dropped, drop the unused sessionID JSON field, and
remove a redundant sort/dedup. Adds parser and scanner-filename tests.

Confidence: high
Scope-risk: narrow
Not-tested: real mimocode.db timestamp unit (verified against OpenCode fork convention, no sample DB available)

---------

Co-authored-by: Junho Yeo <i@junho.io>
pinion05 added a commit to pinion05/tokscale that referenced this pull request Jun 23, 2026
…ster

test_build_client_filter_all_legacy_flags pinned a hardcoded `required` list
that was not updated when MiMo Code (junhoyeo#710) and Antigravity CLI (junhoyeo#713) were added,
so the len() assertion failed on main (671 passed / 1 failed) and broke the Code
Coverage job for every open PR. Add the two missing ids.

Confidence: high
Scope-risk: narrow
t1000040 pushed a commit to tmobi-internal/tokscale that referenced this pull request Jun 30, 2026
* feat: add MiMo Code client support

MiMo Code (github.com/XiaomiMiMo/MiMo-Code) is a TypeScript fork of
OpenCode, released V0.1.0 on June 10, 2026. It stores session data in
SQLite at ~/.local/share/micode/mimocode.db with a schema nearly
identical to OpenCode's.

Changes:
- Add MiMoCode client definition (ClientId=28) in clients.rs
- New session parser micode.rs (adapted from opencode.rs) with SQLite
  support and 6 unit tests
- Add discover_micode_dbs() in scanner.rs for DB discovery
- Integrate MiMo Code parsing pipeline in lib.rs
- Add Micode variant to ClientFilter in main.rs
- Add TUI entry with hotkey 'j'
- Add frontend support (types, display name, logo, brand color)

All 1710 tests pass.

* docs: add MiMo Code client to README in all languages

* chore: format micode changes

* fix(micode): correct logo org/repo links, doc timestamps, optional cache, add tests

Align MiMo Code logo and repo links on the real github.com/XiaomiMiMo org,
fix README time.created examples to 13-digit epoch ms (parser convention,
matching OpenCode), make the cache field optional so cache-less assistant
messages are not silently dropped, drop the unused sessionID JSON field, and
remove a redundant sort/dedup. Adds parser and scanner-filename tests.

Confidence: high
Scope-risk: narrow
Not-tested: real mimocode.db timestamp unit (verified against OpenCode fork convention, no sample DB available)

---------

Co-authored-by: Junho Yeo <i@junho.io>
t1000040 pushed a commit to tmobi-internal/tokscale that referenced this pull request Jun 30, 2026
…ster

test_build_client_filter_all_legacy_flags pinned a hardcoded `required` list
that was not updated when MiMo Code (junhoyeo#710) and Antigravity CLI (junhoyeo#713) were added,
so the len() assertion failed on main (671 passed / 1 failed) and broke the Code
Coverage job for every open PR. Add the two missing ids.

Confidence: high
Scope-risk: narrow
t1000040 pushed a commit to tmobi-internal/tokscale that referenced this pull request Jun 30, 2026
…unhoyeo#746)

* docs: sync EN/ja/ko/zh-cn for unreleased clients + breaking flag removal

Pre-v3.2.0 documentation sync for the unreleased range (v3.1.3..main):

- junhoyeo#465: replace the now-false legacy per-client flag notices in ja/ko/zh-cn
  (they claimed the removed flags still work) with a v3.2.0 breaking-change
  migration note; add the same note to README.md (which had none).
- junhoyeo#728: document the MiniMax Token Plan subscription source (distinct from the
  MINIMAX_API_KEY row) in all locales; port the entire Subscription Usage
  section into ja/ko/zh-cn (was English-only).
- junhoyeo#718: add the Jcode table row + detail section to the locales missing them.
- junhoyeo#726: document the TOKSCALE_FM_DEBUG env var in all locales.
- junhoyeo#633: add the missing task-attributed report bullet to README.ja Key Features.
- drift: add Junie to the frontend Source-filtering list (all locales).
- junhoyeo#710: fix the MiMo Code repo link (XiaomiMiMo/MiMo -> XiaomiMiMo/MiMo-Code).
- junhoyeo#717: disclose Command Code token usage is estimated (~4 chars/token).

Confidence: medium
Scope-risk: narrow
Directive: ja/ko/zh-cn translations of the ported Subscription Usage section are machine-generated and should get a native-speaker review pass
Not-tested: junhoyeo#713 Antigravity CLI detail section was not added — no English source section exists to port from

* fix(report): feed real session content to the summarizer (junhoyeo#633)

extract_content_for_session unconditionally returned metadata_only_content()
(first_user_message hardcoded None), so the report summarizer never saw any
conversation content and the four real per-client extractors were dead code.

Add content_extractor::extract_session_content, which dispatches to the correct
per-client extractor (opencode/claude/codex/gemini) and falls back to
metadata-only — never erroring or panicking — for unknown clients, missing
candidates, or unreadable/unparseable files. report.rs builds a SessionPathIndex
once (session_id -> transcript file, plus opencode DBs) and threads it through
run_summarizer so each payload carries the real first user message.

Confidence: high
Scope-risk: moderate
Rejected: thread file paths through core's scanner/WikiEntry | too invasive; indexed at the report layer instead
Not-tested: end-to-end opencode/codex/gemini extraction in report.rs (core dispatcher covers claude + all fallback paths; per-client extractors are pre-existing)

* docs: name the breaking release v4.0.0 (was v3.2.0)

The per-client flag removal (junhoyeo#465) is a breaking change, so the next release is v4.0.0, not v3.2.0. Update the migration notes in all four README locales and the main.rs doc comment accordingly.

* fix(report): real Codex/Gemini extraction + (client,session_id) index keying

Addresses automated review feedback on the junhoyeo#633 report-summarizer-content
fix (PR junhoyeo#746). The summarizer still surfaced (none) for normal Codex/Gemini
sessions and could mis-route cross-client session_id collisions.

- content_extractor: parse the current on-disk Codex format (event_msg with
  payload.type == "user_message", text in payload.message) and skip
  harness-injected context blocks (<environment_context>/<system-reminder>/
  <user_instructions>), mirroring sessions::codex.
- content_extractor: Gemini extractor now handles chat-recording JSON
  (messages[].type == "user" / content) and falls back to scanning
  line-delimited JSONL; empty/whitespace user text is treated as not-found.
- extract_session_content: an empty/whitespace first_user_message no longer
  counts as success, so scanning continues to a later candidate with real text.
- report: SessionPathIndex is keyed by (client, session_id) to prevent
  cross-client collisions, and Gemini files are keyed by their in-file
  sessionId (via gemini_session_id_for_file) rather than the filename stem,
  since the wiki entry's session_id is derived from inside the file.
- Added fixture-based regression tests for all of the above.

Constraint: wiki session_id for Gemini comes from the in-file sessionId, not the path stem
Rejected: match any leading '<' for Codex injected blocks | drops legit prompts starting with markup
Confidence: high
Scope-risk: narrow
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.

4 participants