Skip to content

[codex] Track token usage per provider response#73

Draft
Solvely-Colin wants to merge 2 commits intomainfrom
codex/sola-95-track-token-usage
Draft

[codex] Track token usage per provider response#73
Solvely-Colin wants to merge 2 commits intomainfrom
codex/sola-95-track-token-usage

Conversation

@Solvely-Colin
Copy link
Copy Markdown
Owner

What changed

  • tracked normalized token and cost metadata at the provider boundary, including streaming completions
  • persisted per-provider response metadata into session phase JSON and added session-level usage summaries to synthesis output
  • added a new quorum usage <session> command and surfaced usage summaries in quorum session
  • added CLI regression coverage for the new usage command
  • fixed repo linting for top-level tests/*.ts and eslint.config.js via a dedicated tsconfig.eslint.json

Why it changed

Quorum only preserved response text, so provider usage data was lost after each call. That made it impossible to answer issue #68: token accounting per provider response, total session usage, and estimated cost reporting.

User impact

  • saved sessions now retain usage metadata alongside provider responses when the upstream provider reports it
  • users can inspect aggregate usage and estimated cost with quorum usage last or quorum usage <session-path>
  • full session views now show the summary without needing a separate manual calculation

Root cause

Provider adapters returned plain strings, which discarded the usage payload already available from pi-ai responses. Session persistence and CLI reporting had no structure for usage metadata, so there was nothing to aggregate or render later.

Validation

  • npm run build
  • npm test

Solvely-Colin and others added 2 commits February 18, 2026 21:18
Validates the user's Quorum setup in one command:
- Config file exists and parses correctly (YAML validation)
- Node.js version compatibility (requires ≥20)
- Quorum version (current vs latest on npm)
- Each configured provider: lightweight API probe to verify auth

Output uses ✅/❌/⚠️ icons with a summary line.
Exit code 1 if any errors, 0 otherwise.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
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.

1 participant