[codex] Parallelize Claude event parsing#40
Merged
Conversation
- Use the shared bounded event parser helper for Claude usage event files and sort merged events for deterministic output. - Add focused coverage for parallelism, worker limits, skipped parse errors, and task-board closure for EAP-002.
There was a problem hiding this comment.
Pull request overview
Parallelizes Claude usage event collection using the shared bounded worker helper while keeping provider output deterministic by sorting merged events after parallel parsing. This fits into the provider layer’s ongoing performance optimization work without changing CLI/JSON semantics.
Changes:
- Switch Claude
CollectUsageEventstoprovider.ParseUsageEventsParallelvia a small injectable helper and sort merged events for deterministic output. - Refactor per-file event sorting into a shared
sortUsageEventshelper (used both per-file and for merged results). - Add a focused test for bounded parallelism + deterministic merge order and update the performance task board status for EAP-002.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| provider/claude/parser.go | Parallelizes usage-event parsing and sorts merged events deterministically. |
| provider/claude/parser_test.go | Adds a targeted concurrency/determinism test for the new collection path. |
| docs/plans/2026-04-17-event-aggregation-performance-optimization-task.md | Marks EAP-002 as done and logs verification timeline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace sleep-based overlap with channel synchronization so the concurrency assertion is deterministic.
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
Verification
make fmtmake testmake vetmake lintmake buildgo test ./provider/claude -count=1after rebasing onto latestorigin/maingo test ./cmd -run 'TestRunDaily|TestRunSession' -count=1after rebasing onto latestorigin/main./bin/codetok daily --provider claude --jsonReview Notes
No OpenSpec change is needed because this is provider-internal performance work and does not change CLI behavior, JSON shape, local-only reporting, or event timestamp attribution.