Repository navigation
Closed
Labels
triage:resolvedResolved by a later change or current implementation.Resolved by a later change or current implementation.
Description
ccusage currently reports no Kimi usage even though Kimi Code has local usage rows.
Environment:
- ccusage latest on npm:
20.0.11 - Kimi Code:
0.14.0 - macOS arm64
I tested the latest published native ccusage binary directly from npm:
ccusage --version
# ccusage 20.0.11
KIMI_DATA_DIR="$HOME/.kimi-code" ccusage kimi daily --json --offlineActual:
{"daily":[],"totals":{"cacheCreationTokens":0,"cacheReadTokens":0,"inputTokens":0,"outputTokens":0,"totalCost":-0.0,"totalTokens":0}}But Kimi Code stores usage here:
~/.kimi-code/sessions/<workDirKey>/<sessionId>/agents/<agentId>/wire.jsonl
Those files contain usage rows like:
{"type":"usage.record","time":1781055528344,"usage":{"inputOther":4099,"inputCacheRead":6400,"inputCacheCreation":0,"output":101}}A sanitized local count found nonzero usage:
wire.jsonl files: 133
files with usage.record: 128
usage_record_rows=1935
inputOther=4468921
inputCacheRead=94629376
inputCacheCreation=0
output=839371
I also checked current upstream source/docs. The Kimi adapter still appears to target the legacy layout/schema:
- default path:
~/.kimi - discovered path shape:
sessions/<group>/<session>/wire.jsonl - parsed rows:
StatusUpdatewithpayload.token_usage.input_other,output,input_cache_read, etc.
Relevant lines:
- https://github.com/ccusage/ccusage/blob/main/rust/crates/ccusage/src/adapter/kimi/paths.rs#L30-L68
- https://github.com/ccusage/ccusage/blob/main/rust/crates/ccusage/src/adapter/kimi/parser.rs#L34-L43
- https://github.com/ccusage/ccusage/blob/main/docs/guide/kimi/index.md#L23-L52
This seems distinct from pricing-only Kimi fixes because usage is never loaded.
Prior reports with the same diagnosis were auto-closed by the new-contributor gate:
- Kimi adapter does not read Kimi Code CLI usage data #1246
- fix: ccusage doesn't pick up kimi code #1247
Expected:
ccusage should discover modern Kimi Code logs under ~/.kimi-code/sessions/*/*/agents/*/wire.jsonl and parse usage.record rows with camelCase usage fields.
Likely fix:
- add
~/.kimi-codeas a default Kimi data root, while preservingKIMI_DATA_DIR - accept
sessions/<workspace>/<session>/agents/<agent>/wire.jsonl - parse
usage.recordrows usingusage.inputOther,usage.inputCacheRead,usage.inputCacheCreation, andusage.output - treat
timeas milliseconds - extract the session id from the
<session>path component - normalize any
kimi-code/model prefix before pricing lookup
Metadata
Metadata
Assignees
Labels
triage:resolvedResolved by a later change or current implementation.Resolved by a later change or current implementation.
Activity
github-actions commentedon Jun 11, 2026
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies
lgtmi, your future issues will stay open. If a maintainer replieslgtm, your future issues and PRs will stay open.See CONTRIBUTING.md.
M1nt-Ch0c0 commentedon Jun 22, 2026
@ryoppippi could this be reopened? Still reproducible on v20.0.14 (details below).
I'm still seeing this on ccusage 20.0.14.
I reproduced it in two separate environments, each with its own Kimi data directory:
The behavior is the same in both places:
On my WSL install,
~/.kimi-codecontains 137usage.recordturn events across 84wire.jsonlfiles. My Windows install has 1198 such events. In both cases,ccusagereports no usage data.From the files I have locally, Kimi Code appears to use a different wire format from the older kimi-cli format that the current adapter supports.
Current Kimi Code layout:
Example Kimi Code usage event:
{"type":"usage.record","model":"kimi-code/kimi-for-coding","usage":{"inputOther":3064,"output":76,"inputCacheRead":14848,"inputCacheCreation":0},"usageScope":"turn","time":1782113184943}The older format currently parsed by the adapter looks like this:
{"timestamp": 1780046636.6985204, "message": {"type": "StatusUpdate", "payload": {"token_usage": {"input_other": 7190, "output": 200, "input_cache_read": 5888, "input_cache_creation": 0}}}}The main differences I noticed are:
Issues #1246 / #1247 / #1261 seem related, but they are closed, and I couldn't find a merged PR or commit on main that adds support for this newer Kimi Code format.
Would you be open to reopening this, or tracking Kimi Code support separately?I can share sample wire.jsonl data if that helps.
ryoppippi commentedon Jun 22, 2026
send a pr plz! i don't personally use kimi code
M1nt-Ch0c0 commentedon Jun 22, 2026
@ryoppippi Hi, I've fixed this issue and here's the PR.#1362
Could you please review it and reply lgtm so the PR can go through?
M1nt-Ch0c0 commentedon Jun 25, 2026
@ryoppippi I opened PR #1362 as requested for this Kimi Code fix, but it was auto-closed by the new-contributor gate. Validation (
just fmt,just typecheck,just test) passed. Could you please reopen or replylgtmif it looks OK?fix(kimi): support Kimi Code new wire format (#1362)
ci: add GitHub-hosted runner fallback (#2)
ryoppippi commentedon Aug 31, 2026
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current
mainimplementation covers this request. This item is kept for history and does not need to be reopened.