Repository navigation
feat(usage): include Kimi Code activity - #7936
Hylouis233 wants to merge 8 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
One finding on the web UI: the new Kimi Code mark hardcodes its own light/dark violets instead of the --usage-provider-kimi theme token that the rest of the usage surface reads, and the light value drifts from that token, so the legend swatch and the mark next to it render different colors in light mode.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One dependency-acquisition finding in apps/server/src/usage/UsageService.ts. Everything else in the changed Effect code (service/tag layout, make/layer exports, namespace imports, no new runtimes or service-instance parameters) matches the conventions.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4d4555bf7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ApprovabilityVerdict: Skipped Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d01c3af90
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c70e660. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c70e660a79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Maintainer follow-up: all review threads are resolved across the four usage-provider PRs (#7877, #7904, #7936, and #7939). Their GitHub Actions runs are currently blocked at |
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo Closing this PR after an automated pass over open pull requests. Expands usage contracts and client interfaces for a provider that the product does not support. |

Problem
T3 Code's Usage page does not include Kimi Code activity. Kimi Code's terminal UI and desktop app persist turn-scoped usage under separate session homes, so both surfaces are missing from provider totals, charts, and model breakdowns.
What changed
usage.recordevents from Kimi Code wire transcriptsKIMI_CODE_HOMEandKIMI_DESKTOP_DATA_DIRoverridesVerification
git diff --checkpassedMerge order
This PR, #7877, #7904, and #7939 independently target the current v4 usage contract and each introduces v5. Every PR merged after the first must be rebased and advance the combined contract version before merge.
The available before/after usage captures contain private local totals, so they are not attached to this Draft.
Built with Codex (GPT-5).
Note
Add Kimi Code provider to usage tracking
kimito theUsageProviderKindschema and bumpsUSAGE_CONTRACT_VERSIONto 5, allowing the server and UI to track Kimi Code transcript activity..jsonllines viaparseKimiLineand discovers directories usingresolveTranscriptDirs, covering both TUI and desktop paths.negotiateUsageContractVersionto fall back to the pre-Kimi contract (v4) when the client does not request v5, maintaining backward compatibility.UsageAggregatorandusageMergeto split usage by physicalsourcePath, enabling better cross-environment de-duplication.USAGE_SCAN_CACHE_VERSIONto 3, which invalidates existing scan caches and forces repopulation.Macroscope summarized dc732f7.
Note
Medium Risk
Touches the usage contract, scan cache, and cross-environment source ownership. A cache version bump forces a one-time cold rescan; merge logic changes can alter which environment’s totals win.
Overview
Adds Kimi Code to usage totals by scanning TUI (
KIMI_CODE_HOME/~/.kimi-code) and Desktop session homes, parsing turn-scopedusage.recordlines, and showing the provider on web and mobile.Bumps the usage contract to v5 (
kimi+ optionalsourcePath). Clients advertisecontractVersion; servers still emit v4 without Kimi for older clients. Scan cache is v3 with acompleteFromMsbound so windowed Kimi scans are not reused for wider windows.Walk/read failures now mark sources
partial/failedinstead of looking healthy. Merge claims stores by physical path, prefers the more complete environment, and surfacesincompleteSourcesin the coverage notice.Reviewed by Cursor Bugbot for commit dc732f7. Bugbot is set up for automated code reviews on this repo. Configure here.