feat: add compression time to /dcp stats#471
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd7937574f
ℹ️ 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.
Pull request overview
Adds tracking and reporting of how long it takes the LLM to generate compress tool inputs, and surfaces that metric in /dcp stats.
Changes:
- Track per-
compresstool-call “pending → running” duration and accumulate it into session stats. - Persist and reset the new
compressionTimeMsstat, and add acompressionStartsmap to session state. - Display the new metric in
/dcp statsand add tests for the event hook behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/hooks-permission.test.ts | Adds tests validating event-hook timing accumulation and filtering to compress only. |
| lib/state/types.ts | Extends session state/types with compressionTimeMs and compressionStarts. |
| lib/state/state.ts | Initializes, resets, and loads the new session stat and map. |
| lib/hooks.ts | Adds createEventHandler that records compress input-generation durations from events. |
| lib/compress/range.ts | Removes an extraneous stray character/line in the tool implementation. |
| lib/compress/message.ts | Removes an extraneous stray character/line in the tool implementation. |
| lib/commands/stats.ts | Prints the new compression/summary time metric in /dcp stats. |
| index.ts | Registers the new event hook handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.