Repository navigation
fix(telemetry): the last small defects from the R1 audit - #1055
Merged
Merged
Conversation
`--days 99999999999` crashed with a RangeError stack, and `--days 99999999` printed a period from "-271764-02". The first day now goes through the same four-digit bound as the window, and past it the command says so and exits 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
`aidd telemetry report | head -1` printed an unhandled EPIPE stack and exited 1. A closed stdout now only drops what is left to print: the run exits on its own outcome, and any other stdout error still throws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
… says Claude Code transcripts carry `usage.output_tokens_details.thinking_tokens` (about 189k of 267k usage lines on one machine, never above output) and an advisor iteration's own `cache_creation.ephemeral_1h_input_tokens` (2,460 of 2,460). The reader stored both as null. `reasoning` now takes the thinking count for the call, and an advisor record its one-hour write; an advisor's reasoning stays null, as no advisor line says it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
The ledger lock is cleared after 10 minutes even while its holder runs; no measured ingest comes near it. Records stored before the reader kept reasoning and the advisor one-hour write stay null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
`coverage.left_out` counts calls and lines from any day, so a report of a period must not present them as its own. A question about reasoning or thinking tokens now gets the answer that they are in `output`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
… calls carry one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
The last small telemetry defects from the R1 audit. Each one was reproduced or measured first, and only the ones that reproduced were fixed. The rest became one limit line or nothing.
🛠️ How it works
report --days <huge>--days 99999999999:RangeError: Invalid time valuestack, exit 1.--days 99999999: period-271764-02 to …, exit 0.0,-1and1e9were already refused cleanly--days reaches before the year 0000: give fewer days., exit 1report | head -1EPIPEError: write EPIPEstack, exit 1, three runs out of threecli/.claude/skills/commanddoes not exist, so this follows 3-cli-process.md instead (process channels belong tocli.ts)forget"repositorys"expected [...] to include '2 repositories declared...'pluraltakes an irregular formreasoning/ advisorcache_write_1hnull~/.claude/projects, 2,795 files, 266,992 usage lines.usage.output_tokens_details.thinking_tokensis on 188,677 lines, always a count, and never aboveoutput_tokens. On multi-iteration lines it exceeds the largest iteration's output 452 times out of 2,570, so it covers the whole call. Advisor iterations carrycache_creation.ephemeral_1h_input_tokens2,460 times out of 2,460, all zero, and 5m + 1h = write every time. No advisor iteration carriesoutput_tokens_detailsreasoning. An advisor record keeps its own one-hour write. An advisor'sreasoningstays null, since that case was never observedwaitMs(60 s) with the existing error naming the lock file to remove. That failure is visible, not silentbuildReport --axis task, which callattributetwice per record), 250k calls: 300 ms with no declarations, 885 ms with 200 session declarations + 50 carries + 100 branches, 1,194 ms with 300/100/300report --jsonand--help. Every filter conflict the skill states was checked against the CLIcoverage.left_outspans every day, not only the period. Reasoning tokens are counted inoutputLimit lines added to usage-contract.md: the lock age, and records stored before this change, which keep
reasoningand the advisor one-hour write null.🧪 How to verify
cd cli && pnpm testaidd telemetry report --days 99999999999→ one error line, exit 1aidd telemetry report | head -1→ no stderr, exit 0Red runs, before each fix:
{"from":"-000001-12"}received where a refusal was expected+ Error: write EPIPEexpected [...] to include '2 repositories declared...'[null, null]vs[120, null], andnullvs3>to>=atMAX_SHIFTinperiod.ts. It is equivalent: at exactly 3,652,425 days, both branches return null from any four-digit today. Thecli.tslistener is covered by the e2e test only, because Stryker never reaches the built binary, so it was mutated by hand: flipping!==to===turns the e2e test red (+ Error: write EPIPE).🔗 Linked issue
None. Found by the R1 telemetry audit.
✅ I certify
🤖 Generated with Claude Code
https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp