Skip to content
This repository was archived by the owner on Jul 30, 2026. It is now read-only.

feat(cli): establish deterministic command semantics - #145

Merged
makoMakoGo merged 17 commits into
personal/local-clientsfrom
agent/cli-v5-contract
Jul 15, 2026
Merged

feat(cli): establish deterministic command semantics#145
makoMakoGo merged 17 commits into
personal/local-clientsfrom
agent/cli-v5-contract

Conversation

@makoMakoGo

@makoMakoGo makoMakoGo commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • separate the interactive TUI from deterministic table and JSON report commands
  • resolve every accepted argument into one typed execution plan with strict source/date validation
  • standardize local JSON output, stdout/stderr boundaries, pricing, cache, graph, and headless command semantics
  • make TUI --home, optional-tab validation, refresh overrides, and aggregate-cache scope authoritative
  • distinguish normal TUI quit from Ctrl-C interruption and restore the terminal before returning 130
  • classify malformed settings and environment values as invalid invocation errors without conflating them with operational I/O failures
  • remove Tokscale-owned Cursor/Codex credential stores and account switching
  • remove Cursor and Trae completely from the maintained client surface
  • read Codex subscription auth only from the provider-owned source without refreshing or modifying it

Contract highlights

  • bare tokscale is the default TUI; configured launches use tokscale tui ...
  • models, monthly, hourly, and time-metrics always produce reports regardless of TTY state
  • root-level business flags and --light are rejected; known v4 forms receive a migration hint but no compatibility alias
  • local JSON commands use { data, health, metadata }, while warnings and benchmark output stay on stderr
  • reports no longer write the TUI aggregate cache; tokscale cache warm is the explicit maintenance command
  • pricing lookup / pricing overrides, graph path output, and the headless ... -- <command> boundary are explicit
  • Wrapped uses one typed --ranking <agents|clients> selection; automatic mode is explicit and incompatible presentation options fail during resolution
  • q exits the TUI successfully, while Ctrl-C is a typed interruption that restores terminal state before returning 130
  • malformed or out-of-range settings and environment values return 2; I/O, network, authentication, and internal failures remain 1
  • headless resolves its timeout into the execution plan before it creates output or starts the child process
  • report plans preserve an explicit --no-spinner; JSON-derived progress suppression is applied only during execution
  • cursor and trae are invalid client IDs and have no parser, scanner, TUI entry, cache sync, or command namespace
  • Trae credential copying, refresh, and sync code is removed together with its cryptography dependencies
  • Codex quota lookup reads only the current provider-owned auth state and never copies or mutates OAuth credentials

Design records

  • ADR 0022 defines deterministic CLI command semantics.
  • ADR 0023 defines provider-owned credential boundaries.
  • ADR 0024 defines the Subscription Usage product boundary and ongoing redesign; Cursor and Trae removal is its first applied decision.
  • feat(usage): redesign credentials and multi-plan presentation #146 tracks the detailed Usage redesign, including provider/account/plan identity and multiple ZAI Coding Plan keys.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --locked --workspace --all-features -- -D warnings
  • cargo test --locked --workspace --all-features (2290 passed, 5 ignored)
  • real PTY tests verify q returns 0, Ctrl-C returns 130, and terminal state is restored
  • black-box CLI tests verify invalid timeout/settings return 2 before execution while settings I/O failures remain 1
  • plan and black-box tests verify JSON stays quiet without erasing explicit --no-spinner intent
  • bun run build:cli
  • direct CLI checks confirm removed client IDs and the trae namespace return exit code 2

Release note

This is the v5 breaking CLI contract, but the package version is intentionally not changed here. The version-only release commit remains separate so merging this implementation cannot trigger npm publication before release validation.

Closes #143

Summary by CodeRabbit

  • 新功能
    • 新的 CLI 子命令结构(tui、models/月度/小时/时间指标、graph、pricing、cache、wrapped、headless 等)与更严格的无头校验。
    • 本地 JSON 报告统一为信封格式(data + metadata/health/processingTimeMs)。
    • 支持按客户端/模型筛选,wrapped 支持新的 ranking 选择。
  • 改进
    • TUI 支持 home_dir--no-refresh,退出与终端状态恢复更可靠。
    • 基准/健康/警告等输出与 stdout 分离到 stderr。
    • 定价查询改用 pricing lookuppricing overrides
  • 变更
    • 移除 Cursor 与 Trae 的客户端及相关账号管理功能,旧用法会直接失败并提示迁移。
  • 文档
    • 全面更新 CLI、客户端、配置和定价命令示例。

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92498165-ea7a-4254-8bee-dabd74e584ea

📥 Commits

Reviewing files that changed from the base of the PR and between 6f0e387 and 1452473.

📒 Files selected for processing (2)
  • crates/tokscale-cli/src/commands/clients.rs
  • crates/tokscale-cli/tests/cli_tests.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/tokscale-cli/src/commands/clients.rs
  • crates/tokscale-cli/tests/cli_tests.rs

Walkthrough

本次变更将 CLI 重构为显式子命令与执行计划模型,统一本地报告 JSON envelope、错误分类、缓存作用域和 TUI 退出行为,并移除 Cursor/Trae 相关客户端、适配器及账户管理能力;同时更新 Codex 用量读取、Droid 归因、文档和测试。

Changes

CLI 与报告执行

Layer / File(s) Summary
命令解析与执行计划
crates/tokscale-cli/src/cli.rs, crates/tokscale-cli/src/main.rs, crates/tokscale-cli/src/failure.rs
新增显式命令树、迁移提示、参数验证、ExecutionPlan 和统一失败分类。
本地报告与输出协议
crates/tokscale-cli/src/commands/*, crates/tokscale-cli/tests/cli_tests.rs
Models、Monthly、Hourly、Graph、Clients 等命令统一使用 data/health/metadata JSON envelope,并调整 stdout/stderr 输出。
TUI 与缓存作用域
crates/tokscale-cli/src/tui/*, crates/tokscale-cli/tests/tui_exit_tests.rs
TUI 支持 home_dirno_refresh 和结构化退出结果;缓存作用域加入解析后的 home 与环境根信息。

核心边界与数据处理

Layer / File(s) Summary
结构化错误与配置
crates/tokscale-core/src/local_report_error.rs, crates/tokscale-core/src/lib.rs, crates/tokscale-cli/src/tui/settings.rs
本地报告、配置和超时错误使用可分类错误类型,并映射到稳定退出码。
客户端与账户边界
crates/tokscale-core/client-catalog.json, crates/tokscale-core/src/{adapters,sessions,local_clients}/*, crates/tokscale-cli/src/commands/usage/*
移除 Cursor/Trae 的 catalog、适配器、会话解析和账户管理;Codex 改为读取 provider-owned access token。
Droid 归因与缓存失效
crates/tokscale-core/src/sessions/droid.rs, crates/tokscale-core/src/adapters/file.rs
根据 settings、mission features 和父 validator 解析 Droid agent,并将依赖文件纳入缓存指纹。

文档与验证

Layer / File(s) Summary
命令与架构文档
README*, docs/cli.md, docs/clients.md, docs/configuration.md, docs/pricing.md, docs/adr/*
文档迁移到显式子命令,补充 JSON、缓存、定价、headless、退出码和凭据边界。
测试与包配置
crates/tokscale-cli/tests/*, packages/*/package.json, Cargo.toml
测试覆盖新的 CLI、TUI、缓存和报告协议;同步依赖和关键词配置。

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

  • #143:直接对应 CLI v5 命令语义与执行计划重构。
  • #146:涉及 provider-owned credentials、Codex 用量读取和 Usage 边界。

Possibly related PRs

Poem

小兔敲键盘,命令排成行,
models 领着报表,跳过旧迷宫。
Cursor 和 Trae 挥挥手,
Droid 披上新徽章。
JSON 装进小信封,
兔耳朵里回响:v5 真漂亮!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题简洁且准确概括了这次 CLI 确定性语义重构。
Linked Issues check ✅ Passed PR 覆盖了 v5 命令语义、ExecutionPlan、输出分流、cache warm/prune、客户端移除、headless 与文档测试等核心要求。
Out of Scope Changes check ✅ Passed 未发现明显与 #143 目标无关的代码变更,新增/删除内容都围绕 CLI 语义与相关客户端边界展开。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/cli-v5-contract

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 14, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 27 untouched benchmarks


Comparing agent/cli-v5-contract (1452473) with personal/local-clients (9eba780)

Open in CodSpeed

Remove Tokscale-owned Cursor and Codex account management, implicit Cursor API refreshes, and OAuth token mutation. Read only the current provider-owned Codex authentication for subscription usage and document the boundary in ADR 0023.
Replace the conflicting --agents and --clients booleans with one typed --ranking option. Keep automatic selection explicit, preserve requested agent views with an empty state, and reject source or presentation combinations that cannot affect the execution plan.

@makoMakoGo makoMakoGo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

复核了最新 HEAD。e8094473 已通过移除 Tokscale 自有的 Cursor/Codex 凭证与多账号命令,从结构上关闭原第 1 条风险;375005be 也已用 typed --ranking 消除 Wrapped 布尔优先级。以下 5 条在最新提交上仍可复现,建议在转为 Ready 前处理。

Comment thread crates/tokscale-cli/src/cli.rs Outdated
Comment thread docs/adr/0022-deterministic-cli-command-semantics.md
Comment thread crates/tokscale-cli/src/main.rs Outdated
Comment thread crates/tokscale-cli/src/cli.rs Outdated
Comment thread crates/tokscale-cli/src/cli.rs Outdated
Remove both clients from discovery, parsing, CLI, TUI, Wrapped, credentials, dependencies, tests, assets, and user documentation. Retain only retired parser discriminants so unrelated source-cache shards remain decodable.
Distinguish normal TUI quit from user interruption, restore the terminal before mapping Ctrl-C to exit 130, and cover the behavior through a real PTY regression test.\n\nBroaden ADR 0024 into the Subscription Usage subsystem boundary and redesign record, with Cursor and Trae removal documented as its first applied decision.
Preserve typed settings and environment failures through resolve and execute so malformed configuration returns exit 2 while operational I/O failures remain exit 1. Resolve the headless timeout into its execution plan before starting the child process and cover both classifications with black-box regressions.
Keep the user-provided no-spinner value in report execution plans and derive the effective JSON progress policy only at execution. Cover distinct plans and unchanged quiet JSON behavior with unit and black-box regressions.
Keep invalid request, malformed environment, and operational failures typed across the core report boundary. Parse settings from bytes so invalid UTF-8 is classified as malformed content while real read failures remain operational.
@makoMakoGo
makoMakoGo marked this pull request as ready for review July 15, 2026 13:13

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 75 files

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

Re-trigger cubic

Comment thread crates/tokscale-cli/src/commands/headless.rs
Comment thread crates/tokscale-cli/src/main.rs Outdated
Comment thread crates/tokscale-cli/src/tui/cache.rs Outdated
Comment thread docs/adr/0018-bounded-source-fold-pipeline.md
Comment thread README.md
Comment thread crates/tokscale-cli/tests/cli_tests.rs Outdated

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 3 files (changes from recent commits).

You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

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

Re-trigger cubic

Comment thread crates/tokscale-core/src/sessions/droid.rs

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/tokscale-cli/src/commands/models.rs (1)

70-88: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

在发生错误时正确清理 Spinner(避免破坏终端输出)

在当前的实现中,如果底层的 get_model_report(或 get_hourly_report)异步执行失败,? 操作符会导致函数在此处直接提前返回。这会直接跳过下方的 spinner.stop() 调用,导致终端残留未清理的 Spinner 文本,并可能出现内容交错输出的 UI 问题。
请先接收 Result,确保在停止 Spinner 之后再对错误进行解包或返回。

  • crates/tokscale-cli/src/commands/models.rs#L70-L88: 提取 report_result,在调用 spinner.stop() 之后再执行 map_err(...)?
  • crates/tokscale-cli/src/commands/hourly.rs#L50-L68: 执行相同的重构,确保遇到错误时 Spinner 也能被正常清理。
🛠️ 建议的修复方式(以 models.rs 为例)
-    let report = rt
-        .block_on(async {
-            get_model_report(ReportOptions {
-                home_dir: home_dir.clone(),
-                use_env_roots,
-                clients: clients.clone(),
-                since: since.clone(),
-                until: until.clone(),
-                year: year.clone(),
-                group_by: group_by.clone(),
-                scanner_settings,
-            })
-            .await
-        })
-        .map_err(anyhow::Error::new)?;
+    let report_result = rt
+        .block_on(async {
+            get_model_report(ReportOptions {
+                home_dir: home_dir.clone(),
+                use_env_roots,
+                clients: clients.clone(),
+                since: since.clone(),
+                until: until.clone(),
+                year: year.clone(),
+                group_by: group_by.clone(),
+                scanner_settings,
+            })
+            .await
+        });
 
     if let Some(spinner) = spinner {
         spinner.stop();
     }
+
+    let report = report_result.map_err(anyhow::Error::new)?;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/tokscale-cli/src/commands/models.rs` around lines 70 - 88, Update the
report execution flow in crates/tokscale-cli/src/commands/models.rs lines 70-88
to store the async call result before applying map_err and returning, then stop
the spinner before unwrapping the result. Apply the same refactor to
crates/tokscale-cli/src/commands/hourly.rs lines 50-68 so both get_model_report
and get_hourly_report clean up their spinner on errors.
🧹 Nitpick comments (2)
crates/tokscale-cli/src/commands/time_metrics.rs (1)

86-88: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

time-metrics --benchmark 补一条 stderr 回归测试。

time-metrics 目前只有表格输出用例,还缺少 --benchmark"Processing time" 迁移到 stderr 的断言;补一条与 models / monthly 对齐的测试,锁住这条 CLI 契约。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/tokscale-cli/src/commands/time_metrics.rs` around lines 86 - 88, 为
time-metrics 命令的测试补充 benchmark 场景,使用与 models/monthly 测试一致的方式执行 --benchmark,并断言包含
“Processing time” 的输出写入 stderr;同时验证该内容不出现在 stdout,以固定现有 CLI 输出契约。
crates/tokscale-cli/src/tui/data/mod.rs (1)

120-129: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

考虑将重复的 home_dir 解析逻辑提取为辅助函数。

在这个文件中,解析 home_dir 并在缺失时回退到 dirs::home_dir() 以及设置 use_env_roots 的逻辑被重复了三次(在此处、第 197 行和第 279 行)。将其提取为一个独立的方法有助于减少重复代码并提高可维护性。

♻️ 建议的重构

你可以将这部分提取为一个私有方法:

impl DataLoader {
    fn resolve_home(&self) -> Result<(String, bool)> {
        match &self.home_dir {
            Some(home) => Ok((home.to_string_lossy().into_owned(), false)),
            None => Ok((
                dirs::home_dir()
                    .ok_or_else(|| anyhow::anyhow!("Could not find home directory"))?
                    .to_string_lossy()
                    .into_owned(),
                true,
            )),
        }
    }
    // ...
}

然后在这里直接调用 let (home, use_env_roots) = self.resolve_home()?; 即可。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/tokscale-cli/src/tui/data/mod.rs` around lines 120 - 129, Extract the
duplicated home-directory resolution logic into a private DataLoader method,
such as resolve_home, returning the resolved String and use_env_roots flag while
preserving the existing error behavior. Replace the three duplicated match
blocks, including this location and the corresponding logic near the other call
sites, with calls to the helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/tokscale-cli/src/commands/clients.rs`:
- Line 119: 限制 discover_opencode_dbs 仅在 selected_clients 包含 ClientId::OpenCode
时执行,避免筛选其他客户端时访问 OpenCode 路径或污染 health 结果;同时补充客户端过滤回归测试,覆盖仅选择 Claude 时不触发
OpenCode 发现。

In `@crates/tokscale-cli/src/commands/headless.rs`:
- Around line 107-119: Update the validation in the headless command around
source, child command, and format parsing so invalid arguments are represented
as CliFailure::InvalidConfiguration rather than anyhow errors classified as
Operational. Preserve the existing validation messages and ensure unsupported
sources, empty child commands, and invalid formats return exit code 2.

In `@crates/tokscale-core/src/sessions/droid.rs`:
- Around line 297-358: Update droid_agent_dependency_path so subagents that can
inherit a Validator role from their parent include the parent-chain dependency
used by resolve_droid_agent in cache invalidation, including the mission
features file when an ancestor is a Mission worker, while preserving the
existing transcript dependency. Ensure changes to relevant parent settings or
mission features invalidate the cached role assignment.

---

Outside diff comments:
In `@crates/tokscale-cli/src/commands/models.rs`:
- Around line 70-88: Update the report execution flow in
crates/tokscale-cli/src/commands/models.rs lines 70-88 to store the async call
result before applying map_err and returning, then stop the spinner before
unwrapping the result. Apply the same refactor to
crates/tokscale-cli/src/commands/hourly.rs lines 50-68 so both get_model_report
and get_hourly_report clean up their spinner on errors.

---

Nitpick comments:
In `@crates/tokscale-cli/src/commands/time_metrics.rs`:
- Around line 86-88: 为 time-metrics 命令的测试补充 benchmark 场景,使用与 models/monthly
测试一致的方式执行 --benchmark,并断言包含 “Processing time” 的输出写入 stderr;同时验证该内容不出现在
stdout,以固定现有 CLI 输出契约。

In `@crates/tokscale-cli/src/tui/data/mod.rs`:
- Around line 120-129: Extract the duplicated home-directory resolution logic
into a private DataLoader method, such as resolve_home, returning the resolved
String and use_env_roots flag while preserving the existing error behavior.
Replace the three duplicated match blocks, including this location and the
corresponding logic near the other call sites, with calls to the helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d22fd2b5-7f76-4fbd-b172-737066c6f0b3

📥 Commits

Reviewing files that changed from the base of the PR and between 9eba780 and 6f0e387.

⛔ Files ignored due to path filters (3)
  • .github/assets/client-cursor.jpg is excluded by !**/*.jpg
  • .github/assets/client-trae.png is excluded by !**/*.png
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (73)
  • AGENTS.md
  • Cargo.toml
  • README.md
  • README.zh-cn.md
  • crates/tokscale-cli/Cargo.toml
  • crates/tokscale-cli/src/cli.rs
  • crates/tokscale-cli/src/commands/cache.rs
  • crates/tokscale-cli/src/commands/clients.rs
  • crates/tokscale-cli/src/commands/graph.rs
  • crates/tokscale-cli/src/commands/headless.rs
  • crates/tokscale-cli/src/commands/hourly.rs
  • crates/tokscale-cli/src/commands/integrations.rs
  • crates/tokscale-cli/src/commands/models.rs
  • crates/tokscale-cli/src/commands/monthly.rs
  • crates/tokscale-cli/src/commands/pricing.rs
  • crates/tokscale-cli/src/commands/shared.rs
  • crates/tokscale-cli/src/commands/time_metrics.rs
  • crates/tokscale-cli/src/commands/usage/codex.rs
  • crates/tokscale-cli/src/commands/usage/mod.rs
  • crates/tokscale-cli/src/commands/wrapped.rs
  • crates/tokscale-cli/src/cursor.rs
  • crates/tokscale-cli/src/failure.rs
  • crates/tokscale-cli/src/main.rs
  • crates/tokscale-cli/src/main_tests.rs
  • crates/tokscale-cli/src/trae.rs
  • crates/tokscale-cli/src/tui/app.rs
  • crates/tokscale-cli/src/tui/cache.rs
  • crates/tokscale-cli/src/tui/colors.rs
  • crates/tokscale-cli/src/tui/data/mod.rs
  • crates/tokscale-cli/src/tui/mod.rs
  • crates/tokscale-cli/src/tui/settings.rs
  • crates/tokscale-cli/src/tui/ui/agents.rs
  • crates/tokscale-cli/src/tui/ui/daily.rs
  • crates/tokscale-cli/src/tui/ui/dialog/source_picker.rs
  • crates/tokscale-cli/src/tui/ui/footer.rs
  • crates/tokscale-cli/src/tui/ui/header.rs
  • crates/tokscale-cli/src/tui/ui/hourly.rs
  • crates/tokscale-cli/src/tui/ui/usage.rs
  • crates/tokscale-cli/src/tui/ui/widgets.rs
  • crates/tokscale-cli/tests/cli_tests.rs
  • crates/tokscale-cli/tests/copilot_memory.rs
  • crates/tokscale-cli/tests/tui_exit_tests.rs
  • crates/tokscale-core/client-catalog.json
  • crates/tokscale-core/src/adapters/file.rs
  • crates/tokscale-core/src/adapters/mod.rs
  • crates/tokscale-core/src/adapters/trae.rs
  • crates/tokscale-core/src/aggregate/tui.rs
  • crates/tokscale-core/src/clients.rs
  • crates/tokscale-core/src/lib.rs
  • crates/tokscale-core/src/lib_tests.rs
  • crates/tokscale-core/src/local_clients.rs
  • crates/tokscale-core/src/local_report_error.rs
  • crates/tokscale-core/src/message_cache.rs
  • crates/tokscale-core/src/scanner.rs
  • crates/tokscale-core/src/sessionize.rs
  • crates/tokscale-core/src/sessions/cursor.rs
  • crates/tokscale-core/src/sessions/droid.rs
  • crates/tokscale-core/src/sessions/mod.rs
  • crates/tokscale-core/src/sessions/trae.rs
  • docs/adr/0007-client-identity-catalog.md
  • docs/adr/0014-explicit-subscription-usage-boundary.md
  • docs/adr/0015-local-only-product-surface.md
  • docs/adr/0018-bounded-source-fold-pipeline.md
  • docs/adr/0022-deterministic-cli-command-semantics.md
  • docs/adr/0023-provider-owned-credentials.md
  • docs/adr/0024-subscription-usage-redesign.md
  • docs/cli.md
  • docs/clients.md
  • docs/configuration.md
  • docs/development.md
  • docs/pricing.md
  • packages/cli/package.json
  • packages/tokscale/package.json
💤 Files with no reviewable changes (13)
  • packages/cli/package.json
  • crates/tokscale-core/src/sessions/cursor.rs
  • packages/tokscale/package.json
  • crates/tokscale-core/src/sessions/trae.rs
  • crates/tokscale-core/src/adapters/trae.rs
  • crates/tokscale-core/src/sessions/mod.rs
  • Cargo.toml
  • crates/tokscale-cli/src/tui/ui/widgets.rs
  • crates/tokscale-core/client-catalog.json
  • crates/tokscale-cli/src/tui/colors.rs
  • crates/tokscale-cli/src/trae.rs
  • crates/tokscale-cli/src/cursor.rs
  • crates/tokscale-core/src/local_clients.rs

Comment thread crates/tokscale-cli/src/commands/clients.rs
Comment thread crates/tokscale-cli/src/commands/headless.rs
Comment thread crates/tokscale-core/src/sessions/droid.rs
@makoMakoGo

Copy link
Copy Markdown
Owner Author

Follow-up on the non-inline comments from the latest CodeRabbit review:

  • Spinner cleanup: no change. LightSpinner implements Drop, and drop() calls stop_inner(), which stops and joins the render thread; that thread clears the line and restores the cursor. Every ? early return already performs the requested cleanup through RAII.
  • time-metrics --benchmark coverage: added in 14524739. The regression test verifies that Processing time is emitted on stderr and never contaminates stdout.
  • Repeated TUI home resolution: no change. Only one occurrence is on the production path; the other two are behind #[cfg(test)]. Extracting a production helper solely to deduplicate test support code has no behavioral value for this PR.

Validation after the changes: cargo test -p tokscale-cli (827 passed, 1 ignored), Clippy with warnings denied, and rustfmt all pass.

@makoMakoGo
makoMakoGo merged commit 3eb5c39 into personal/local-clients Jul 15, 2026
10 checks passed
@makoMakoGo
makoMakoGo deleted the agent/cli-v5-contract branch July 15, 2026 15:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): establish deterministic v5 command semantics

1 participant