Commit Graph

2 Commits

  • refactor(usage): replace channel-based queue with mutex-protected slice
    - Switched to a slice-based queue with mutex and condition variable for better control over queuing and dispatching.
    - Removed fixed buffer size to handle dynamic queuing.
    - Enhanced shutdown logic to safely close the queue and wake up waiting goroutines.
  • feat(usage): implement usage tracking infrastructure across executors
    - Added `LoggerPlugin` to log usage metrics for observability.
    - Introduced a new `Manager` to handle usage record queuing and plugin registration.
    - Integrated new usage reporter and detailed metrics parsing into executors, covering providers like OpenAI, Codex, Claude, and Gemini.
    - Improved token usage breakdown across streaming and non-streaming responses.