Skip to content

feat(cli): add reporting and billing reads - #474

Merged
aamir merged 2 commits into
mainfrom
codex/reporting-cli
Aug 27, 2026
Merged

feat(cli): add reporting and billing reads#474
aamir merged 2 commits into
mainfrom
codex/reporting-cli

Conversation

@aamir

@aamir aamir commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Understudy agents can now inspect customer-safe usage, workload routing health, per-call and workload customer cost, and organization billing history through authenticated, read-only CLI commands. This replaces the reporting skill's shell and curl workarounds while preserving repository-selected organization and project scope.

Design decisions

  • Customer pricing, provider cost, and the authoritative billing ledger remain separate. Unpriced calls stay null, and billing request/event count differences are described neutrally because zero-cost traffic can legitimately have no priced event.
  • Cost breakdowns expose pricing coverage and known gaps. Organization reporting explicitly notes that it has no coverage block.
  • Response validation preserves additive customer-safe fields for --json, while strict provider-label and pricing-status contracts continue to fail closed at safety and decision boundaries.
  • Human output escapes terminal control characters. Billing timestamps require an explicit timezone and are normalized to UTC before the request.
  • The raw billing model-breakdown endpoint remains out of scope because its provider/model fields do not follow the customer-safe reporting contract.

Validation

  • npm run check - build and type checks passed; 1,215 tests passed; all 43 public skills validated; package smoke passed.
  • Focused hosted-fixture coverage exercises organization/project scope, usage and workload health, call and category costs, billing balance/summary/trend, additive fields, unpriced and zero-cost semantics, terminal escaping, UTC normalization, and the 5,000-group fail-closed boundary.

Open in Devin Review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12f4c3cefb

ℹ️ 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".

Comment thread src/internal/reporting-contracts.ts
Comment thread src/internal/reporting-contracts.ts Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

- reject impossible billing calendar dates\n- enforce call-cost pricing consistency
@aamir
aamir merged commit 35ea90e into main Aug 27, 2026
8 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.

1 participant