Skip to content

feat(admin-costs): conversations on the user page + session profile, diagnoses and trajectory - #1094

Open
philmerrell wants to merge 2 commits into
developfrom
feature/admin-cost-drilldown-ui
Open

feat(admin-costs): conversations on the user page + session profile, diagnoses and trajectory#1094
philmerrell wants to merge 2 commits into
developfrom
feature/admin-cost-drilldown-ui

Conversation

@philmerrell

Copy link
Copy Markdown
Contributor

Summary

The SPA half of the content-free cost drill-down. PR 2 of 3 — requires the API PR (feature/admin-cost-drilldown-api) to be live; until then the new section shows its error state and the anatomy page is otherwise unchanged.

  • /admin/users/:userId gains a Conversations section, rendered only for admins holding admin.costs (it is cost data and its drill-down target is admin.costs-gated; a users-only delegate sees the page without it rather than a 403 inside it). Period/sort controls; per row: model, tools on, context bar against the window, cost with share of the user's month ("unknown" when unrecorded), cache waste, a severity dot for the diagnoses that fired. Row → anatomy.
  • /admin/costs/sessions/:id gains a profile band ("not tracked" wherever a counter predates the session), an expandable Diagnoses list (severity, headline, code, suggestion, evidence, ref), a per-call context trajectory chart with the compaction threshold always in view, a back-to-user link, and Copy diagnostic JSON — profile + anatomy, content-free by construction, meant to be handed to a model for a second opinion. The profile loads independently of the anatomy so one failing does not hide the other.
  • Top-users table shows email / tier / quota % now that the API fills them.

Deploy notes

🌐 frontend-deploy.yml only. No backend or infra change.

Verification

  • npm run test:ci — 2,942 passed (99 in the admin suites, 30 new).
  • In-app browser against dev data through a branch server: list, profile, diagnoses and chart rendered; dark mode via both levers; copy produced a 15.8 KB document with no denylisted keys; console clean.

🤖 Generated with Claude Code

philmerrell and others added 2 commits September 13, 2026 13:19
…diagnoses and trajectory

The SPA half of the content-free cost drill-down (API in
feature/admin-cost-drilldown-api). Requires that API to be live; until then
the new section shows its error state and the anatomy page is unchanged.

- /admin/users/:userId gains a Conversations section (component owned by the
  costs feature, rendered only for admins holding admin.costs): period/sort
  controls, per-row model, tools on, context bar against the window, cost
  with share of the user's month ("unknown" when unrecorded — never $0),
  cache waste, and a severity dot for the diagnoses that fired. Row → anatomy.
- /admin/costs/sessions/:id gains a profile band (messages, model calls +
  mix, tool calls, attachments, compactions, peak context of window,
  write:read — "not tracked" wherever a counter predates the session), an
  expandable Diagnoses list (severity chip, headline, code, suggestion,
  evidence, ref), a per-call context trajectory chart with the compaction
  threshold always in view, a back-to-user link, and "Copy diagnostic JSON"
  (profile + anatomy — content-free by construction, meant to be handed to a
  model for a second opinion). The profile loads independently of the
  anatomy so one failing does not hide the other.
- Top-users table shows email / tier / quota % now that the API fills them.

Verified in the in-app browser against dev data through a branch server:
93 conversations listed for September's top user, profile + diagnoses +
chart rendered, dark mode via both levers, copy produced a 15.8 KB document
with no denylisted keys, console clean. Full SPA suite green.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… global

The anatomy spec replaced `navigator` with a spread copy to stub the clipboard.
A spread drops prototype getters such as `userAgent`, and with the suite
running `isolate: false` Angular's forms `DefaultValueAccessor` in a later
spec file (agent-form-*.spec.ts under the coverage build's ordering) threw on
`navigator.userAgent.toLowerCase()`. Override the `clipboard` property alone
and restore it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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