Skip to content

feat(admin): add compute charge observability - #5410

Merged
pandemicsyn merged 16 commits into
mainfrom
feat/cloud-agent-billing-admin-observability
Aug 21, 2026
Merged

feat(admin): add compute charge observability#5410
pandemicsyn merged 16 commits into
mainfrom
feat/cloud-agent-billing-admin-observability

Conversation

@pandemicsyn

@pandemicsyn pandemicsyn commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add paid/shadow mode, accepted rate, settled seconds, settled amount, and Cloud Agent session links to Cloud Billing usage records.
  • Add a read-only charge ledger with bounded payer, interval, session, SKU, and date filters plus cursor pagination.
  • Add exact Cloud Agent session lookup and bookmarkable interval/session deep links for support investigations.

Stacked on #5358. This PR contains only the admin observability commit and should merge after its base PR.

Verification

  • Browser-tested the populated Charges tab against local PostgreSQL using a fake admin account.
  • Verified real payer, interval, and session-trace links.
  • Verified an interval deep link restored Usage Records and showed Paid · 14s settled with the exact settled amount.
  • Verified a session deep link restored session search and returned both related sandbox intervals.
  • Verified conflicting user and organization filters produce an accessible inline validation error.
  • Checked desktop and 375px mobile layouts; the dense ledger table scrolls horizontally on narrow screens.

Visual Changes

New charges tab in cloud billing admin ui:

cloud-agent-billing-admin-charges

Reviewer Notes

  • Charge amounts come directly from immutable compute_usage_charge rows. Interval settled totals use decimal-string arithmetic matching the meter's cumulative flooring semantics.
  • Searches require a maximum 31-day window. Payer filters use existing payer/time indexes; interval and session support queries remain bounded and partition-prunable without a schema migration.
  • The ledger is intentionally read-only. This PR adds no refunds, corrections, interval mutations, rollout controls, schema changes, or customer-facing UI.
  • Automated checks passed: 59 focused web tests, web typecheck/lint, root lint, formatting, and git diff --check. Independent static review found no blocking defects.

Comment thread apps/web/src/app/admin/cloud-billing-skus/UsageRecordsContent.tsx Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • apps/web/src/app/admin/cloud-billing-skus/UsageRecordsContent.tsx
Previous Review Summary (commit 36c7357)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 36c7357)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

Session deep links query a 7-day window while the visible From/To fields still default to 24 hours, so the next Search changes the result set.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/app/admin/cloud-billing-skus/UsageRecordsContent.tsx 313 Session deep-link query window does not match the displayed date inputs
Files Reviewed (7 files)
  • apps/web/src/app/admin/cloud-billing-skus/ChargesContent.tsx - 0 issues
  • apps/web/src/app/admin/cloud-billing-skus/UsageRecordsContent.tsx - 1 issue
  • apps/web/src/app/admin/cloud-billing-skus/page.tsx - 0 issues
  • apps/web/src/lib/cloud-billing-sku.ts - 0 issues
  • apps/web/src/lib/cloud-billing-sku.test.ts - 0 issues
  • apps/web/src/routers/admin/cloud-billing-skus-router.ts - 0 issues
  • apps/web/src/routers/admin/cloud-billing-skus-router.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 63.4K · Output: 6.1K · Cached: 218.5K

Review guidance: REVIEW.md from base branch feat/cloud-agent-paid-container-billing

Base automatically changed from feat/cloud-agent-paid-container-billing to main August 21, 2026 15:09
@pandemicsyn
pandemicsyn merged commit b10c5b3 into main Aug 21, 2026
26 of 27 checks passed
@pandemicsyn
pandemicsyn deleted the feat/cloud-agent-billing-admin-observability branch August 21, 2026 16:45
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