Skip to content

[Feature]: Report Grok and OpenCode activity on the Usage page #5706

Description

@devteapot

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I am describing a concrete problem or use case, not just a vague idea.

Area

apps/web and apps/server

Problem or use case

The Usage page reports Claude Code and Codex activity, but users who also work through Grok or OpenCode cannot see those providers in their totals. That makes cross-provider usage and cost comparisons incomplete.

Connected environments are also difficult to inspect independently: aggregate totals are useful, but there is no direct way to focus the page on one environment or provider when investigating where usage came from.

Proposed solution

Extend Usage reporting to:

  • read Grok usage from persisted turn_completed updates and clearly mark its coverage as partial
  • read OpenCode assistant usage from its legacy and next-generation SQLite databases
  • include Grok and OpenCode in totals, charts, model breakdowns, and coverage reporting
  • allow the Usage page to focus on one connected environment or provider
  • continue merging compatible usage summaries from older connected servers

Why this matters

People often use several coding providers on the same machine or across multiple T3 Code environments. A unified but inspectable Usage page makes provider comparisons useful without implying that partial histories or raw token-cost estimates are invoices.

Smallest useful scope

Support the durable Grok and OpenCode usage sources, expose them through the existing Usage contract, and preserve honest coverage notices. Environment and provider filters should reuse the existing merged summary rather than introduce a separate analytics system.

Alternatives considered

  • Deriving usage only from T3 Code orchestration would miss sessions started directly in provider CLIs.
  • Treating missing Grok history as complete would overstate coverage because interactive sessions do not always persist usage updates.
  • Requiring every connected environment to run the exact same contract version would unnecessarily drop otherwise compatible Claude and Codex summaries.

Risks or tradeoffs

  • Grok coverage remains partial and must be labeled as such.
  • OpenCode stores usage in SQLite, so cache invalidation must account for WAL writes.
  • Provider histories and public model prices can only produce estimates, not subscription invoices.
  • The Usage contract needs an additive provider expansion while remaining compatible with older servers.

Examples or references

Implementation draft: #5704

Contribution

  • I would be open to helping implement this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions