Skip to content

Add agent session metrics - #532

Merged
govindavashishtha merged 15 commits into
mainfrom
chore/hv/agent-session-matrics
Sep 2, 2026
Merged

Add agent session metrics#532
govindavashishtha merged 15 commits into
mainfrom
chore/hv/agent-session-matrics

Conversation

@harshil-2096

@harshil-2096 harshil-2096 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

image

Changes

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
New optional server contract and internal metrics API dependency; chart loading issues N+1 requests per definition on range change, but changes are gated behind the metrics port and mostly additive UI.

Overview
Adds an optional Metrics tab on library agent details (?tab=metrics), shown only when AgentUIServer exposes the new metrics port (getCharts, getMeters, getChartData). The tab is built from overridable slots (AgentMetrics, AgentMetricsView, aggregate cards, Chart.js line charts, and a preset time-range filter that reuses AgentSessionsFilters).

AgentMetricsContainer loads chart definitions once, then fetches meters and per-chart series for the selected agent and time window (default last 24h). The TrueForge Harness adapter wires this to client.internal.metrics; local dev proxies /internal to the server alongside /api. Session list rows now surface real session metrics from the API instead of zeros.

Also exports hooks (useAgentMetricsServer / useOptionalAgentMetricsServer), documents the port and slots, bumps @truefoundry/assistant-ui-runtime to 0.1.23, and closes the drawer threads panel when library/sessions overlays open.

Reviewed by Cursor Bugbot for commit 13aa9dd. Bugbot is set up for automated code reviews on this repo. Configure here.

govindavashishtha and others added 11 commits August 31, 2026 16:05
…ove session state management. Update AgentSessionsFilters to load all agents in pagination. Adjust matchLocation function to accept an object for better readability. Add tests for AgentSessionsFilters and enhance existing tests for AgentDetailsPage and ThreadListContainer.
- Introduced a new agent metrics tab with features like aggregate cards, time-range filtering, and line charts in the trueforge-ui package.
- Enhanced various components and types to support the new metrics functionality, including AgentMetrics, AgentMetricsView, and AgentMetricChart.
- Updated README and API documentation to reflect the new metrics features and components.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 13aa9dd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-ui Minor
@truefoundry/trueforge Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 454f216. Configure here.

Comment thread pnpm-workspace.yaml Outdated
@harshil-2096
harshil-2096 marked this pull request as draft September 1, 2026 09:30
@harshil-2096
harshil-2096 marked this pull request as ready for review September 1, 2026 10:46
@govindavashishtha
govindavashishtha enabled auto-merge (squash) September 2, 2026 06:37
@govindavashishtha

Copy link
Copy Markdown
Contributor

Need to standardise the colors here @harshil-2096, merging for now. Please make a followup PR

@govindavashishtha
govindavashishtha merged commit 8491843 into main Sep 2, 2026
11 checks passed
@govindavashishtha
govindavashishtha deleted the chore/hv/agent-session-matrics branch September 2, 2026 06:41
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