Repository navigation
Commit 8feb0bc
* feat(model): add AI usage backfill API client and helpers
- SendHTTPRequestJSON now returns a typed HTTPStatusError for non-2xx
responses so callers can tell retryable errors from client errors.
The error text is unchanged.
- Wire types and senders for the server's /api/v1/cc/backfill
endpoints. Backfill events use pointer fields so a failed tool call
is sent as "success": false instead of being dropped by omitempty.
- Shared helpers for the transcript parsers: stable "bf1:" event ids
from natural keys, a JSONL reader without a line length cap, file
discovery, session selection, and request packing that keeps whole
sessions together and marks a session completed on its last batch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMCwtubXzBYhQTnX44vhzF
* feat(model): parse Claude Code and Codex transcripts for backfill
Rebuild historical sessions from local transcripts as backfill events
matching what the live OTEL pipeline records.
Claude Code (~/.claude/projects, ~/.config/claude/projects or
CLAUDE_CONFIG_DIR): one api_request per message id + request id, keeping
the most complete usage of a streamed response; human prompts only
(no meta, subagent, compaction, local-command or notification lines);
tool results paired with their tool calls, keeping only file paths of
the parameters. Items copied into resumed sessions are credited once,
to the session that started first.
Codex (~/.codex/sessions, archived_sessions or CODEX_HOME):
conversation_starts, user prompts, response.completed token counts from
last_token_usage or the cumulative delta (skipping null and repeated
counts), and tool results with exit code and duration. Items copied
into forked rollouts are dropped.
Batches are also bounded by encoded size, and long prompts and tool
arguments are capped, so a batch stays under the server's body limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMCwtubXzBYhQTnX44vhzF
* feat(commands): add `shelltime cc backfill` and `shelltime codex backfill`
Upload past Claude Code and Codex usage from local transcripts that live
OTEL tracking missed (before `cc install` or while the daemon was down).
The command asks the server which sessions it already has, skips those
tracked live, archived or already uploaded, and uploads the rest in
batches with retries on server errors. Sessions still running are held
back. When it finishes it asks the server to refresh activity data and
caches for the uploaded range.
Flags: --since/--until, --dry-run (per-day preview), --no-prompts and
--ai-summary (opt-in, uses AI credits).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMCwtubXzBYhQTnX44vhzF
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8e12ac1 commit 8feb0bc
16 files changed
Lines changed: 3193 additions & 7 deletions
File tree
- commands
- model
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
192 | 210 | | |
193 | 211 | | |
194 | 212 | | |
| |||
0 commit comments