Skip to content

[codex] Parallelize Claude event parsing#40

Merged
Miss-you merged 2 commits into
mainfrom
codex/eap-002-claude-parallel
Apr 17, 2026
Merged

[codex] Parallelize Claude event parsing#40
Miss-you merged 2 commits into
mainfrom
codex/eap-002-claude-parallel

Conversation

@Miss-you

Copy link
Copy Markdown
Owner

Summary

  • Parallelize Claude usage event file parsing with the shared bounded worker helper.
  • Sort merged Claude usage events after parallel collection so provider output stays deterministic.
  • Add focused coverage for worker overlap, worker limits, skipped parser errors, slug propagation, and stable merge order.
  • Mark EAP-002 complete in the performance optimization task board.

Verification

  • make fmt
  • make test
  • make vet
  • make lint
  • make build
  • go test ./provider/claude -count=1 after rebasing onto latest origin/main
  • go test ./cmd -run 'TestRunDaily|TestRunSession' -count=1 after rebasing onto latest origin/main
  • ./bin/codetok daily --provider claude --json

Review 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.

- 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.
Copilot AI review requested due to automatic review settings April 17, 2026 06:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CollectUsageEvents to provider.ParseUsageEventsParallel via a small injectable helper and sort merged events for deterministic output.
  • Refactor per-file event sorting into a shared sortUsageEvents helper (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.

Comment thread provider/claude/parser_test.go Outdated
- Replace sleep-based overlap with channel synchronization so the concurrency assertion is deterministic.
@Miss-you
Miss-you merged commit 7694bf2 into main Apr 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants