Feature: run timeline, token telemetry, and JSON export#106
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds run timeline tracking, token/context metric capture, and JSON export support for Codex CLI runs, surfacing the new data in the task queue UI and exposing it through a new API route.
Changes:
- Adds normalized timeline event and token metric storage to task records.
- Adds a
/api/run-eventsendpoint for per-run JSON export with path redaction. - Adds task queue UI timeline display, token metric summary, and JSON download action.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
apps/codex-claw/src/server/codex-cli.ts |
Persists run timeline events, captures token metrics, and builds redacted run event logs. |
apps/codex-claw/src/server/codex-cli.test.ts |
Adds coverage for redacted run timeline export and token metric output. |
apps/codex-claw/src/screens/chat/types.ts |
Adds public timeline and token metric TypeScript types. |
apps/codex-claw/src/screens/chat/components/task-queue-panel.tsx |
Displays timeline events, metric summaries, and JSON export action in the task queue panel. |
apps/codex-claw/src/routes/api/run-events.ts |
Adds API/download route for run event logs. |
apps/codex-claw/src/routeTree.gen.ts |
Registers the new generated run-events route. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| finishedAt: task.finishedAt, | ||
| durationMs: task.durationMs, | ||
| exitCode: task.exitCode, | ||
| tokenMetrics: task.tokenMetrics ?? null, |
| typeof metrics.totalTokens === 'number' || | ||
| typeof metrics.contextTokens === 'number' | ||
| if (!hasMetrics) return undefined | ||
| metrics.raw = record |
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.
Summary
Files
Testing
Risk
Closes #93
Summary by cubic
Adds run timeline tracking, token usage capture, and per-run JSON export to Codex Claw. Introduces a timeline panel in the task queue with relative timings, command names, exit codes, and final status. Closes #93.
GET /api/run-events?id=:id&download=1to view or download a redacted JSON log for a run.Written for commit 6de50d4. Summary will update on new commits.