feat(cline): ingest shared SDK v1 sessions - #175
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughCline 本地数据源迁移至 SDK v1 ChangesCline SDK v1 本地会话
TUI 缓存 schema
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant Scanner
participant ClineAdapter
participant parse_cline_file
participant TUI Cache
CLI->>Scanner: resolve Cline session root
Scanner->>ClineAdapter: discover *.messages.json
ClineAdapter->>parse_cline_file: parse session unit
parse_cline_file-->>ClineAdapter: ParsedUnit and rejections
ClineAdapter-->>CLI: folded usage data
CLI->>TUI Cache: read or write schema-40 bundle
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Root cause
Cline VS Code 4.0+ and Cline CLI 3.x now persist the same SDK v1
*.messages.jsonartifacts under the Cline data directory. Tokscale still searched the retired VS Code globalStorageui_messages.jsonlayout and therefore missed current CLI usage, including a real Laguna M.1 free-model session whose metrics omitted vendorcost.Current-format boundary
CLINE_SESSION_DATA_DIR,CLINE_DATA_DIR/sessions,CLINE_DIR/data/sessions, then~/.cline/data/sessions;sessions.dbfor usage authority;Usage mapping
Each assistant message with valid metrics becomes one turn. Tokscale keeps the message timestamp, model, and provider, then maps tokens as follows:
Vendor
metrics.costis neither read nor validated. Existing model canonicalization and Tokscale pricing remain authoritative. Lead, subagent, and teammate artifacts receive stable session and agent identities, so the TUI cache schema advances from 39 to 40.User impact
Current Cline VS Code and CLI sessions now appear through the existing report pipeline. Legacy Cline VS Code task logs are intentionally unsupported. No public CLI arguments, aggregation structures, pricing rules, or client IDs change.
Validation
cargo fmt --all -- --checkcargo test -p tokscale-core cline— 14 passedcargo test -p tokscale-core— 1,541 passed, 4 ignoredcargo test— 2,362 passed, 5 ignoredcargo clippy -p tokscale-core --all-targets -- -D warningscargo build -p tokscale-clicargo build --release -p tokscale-clibun run cli -- models --client cline --no-spinner— foundlaguna-m.1, 12 turns, and 293,305 tokens in the current local corpusSummary by CodeRabbit
新功能
*.messages.json)。改进
文档