Skip to content

feat: display retained Agent Time usage - #28742

Open
jaaydenh wants to merge 4 commits into
mainfrom
agent-usage-wanb
Open

feat: display retained Agent Time usage#28742
jaaydenh wants to merge 4 commits into
mainfrom
agent-usage-wanb

Conversation

@jaaydenh

@jaaydenh jaaydenh commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

closes CODAGT-960

Summary

Screenshot 2026-08-28 at 2 28 25 PM

Display retained Coder Agent Time in the Coder Agents deployment settings page using the existing design from #28489.

Problem

The previous design sourced the displayed total from entitlement usage reporting and was stacked on #28488. That value can lag retained chat data and couples the card to an unrelated API-boundary change.

Fix

Add a deployment-admin endpoint that sums retained chat_messages.runtime_ms over the licensed usage period, or all retained history for Community deployments. Wire the Usage card to that endpoint while continuing to use entitlement metadata for allocation and concurrent-agent enforcement. This does not add a migration or change the existing usage-event publisher.

Refs #28489

@github-actions

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@jaaydenh

Copy link
Copy Markdown
Contributor Author

@codex 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: 89ded49a9e

ℹ️ 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 site/src/pages/AISettingsPage/CoderAgentsPage/CoderAgentsPageView.tsx Outdated
Comment thread site/src/api/queries/deployment.ts Outdated
@jaaydenh
jaaydenh marked this pull request as ready for review August 28, 2026 07:27
@jaaydenh
jaaydenh requested a review from ibetitsmike August 28, 2026 07:28
@jaaydenh

Copy link
Copy Markdown
Contributor Author

@codex review

@coderagents

coderagents Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/agents/licensing-usage.md - This PR adds an admin-facing Usage card to the Coder Agents settings page (backed by the new GET /api/v2/deployment/agent-time endpoint) that shows Agent hours used, allocation, and max concurrent agents. The doc this card links to ("View usage documentation") doesn't mention that admins can view current Agent Time usage in the UI, so a short note on where to find it would keep the doc in sync.
  • docs/ai-coder/agents/licensing-usage.md - Accuracy: the page states Coder "sums it across all Coder Agents chats in the deployment," but the new card's total is retained Agent Time. Its tooltip notes that "Time from archived chats is excluded once deleted based on the conversation retention period." Consider clarifying that the value shown in Settings reflects retained chat data and can differ from the usage reported to Tallyman for billing.

Note

The API reference (docs/reference/api/general.md, docs/reference/api/schemas.md) is auto-generated from Swagger annotations and is already correctly regenerated in this PR. No action needed there.


Automated review via Coder Agents

@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: 0cd53ebdd0

ℹ️ 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 site/src/pages/AISettingsPage/CoderAgentsPage/CoderAgentsPage.tsx
Comment thread site/src/pages/AISettingsPage/CoderAgentsPage/CoderAgentsPage.stories.tsx Outdated
Comment thread site/src/pages/AISettingsPage/CoderAgentsPage/CoderAgentsPage.stories.tsx Outdated
@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

CODAGT-960

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