Skip to content

Feature: Add agent details, sessions and code snippet - #529

Merged
govindavashishtha merged 7 commits into
mainfrom
feat/gv/sessions
Sep 1, 2026
Merged

govindavashishtha merged 7 commits into
mainfrom
feat/gv/sessions

Conversation

@harshil-2096

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

Copy link
Copy Markdown
Contributor

Summary

Ships the agent library as a full-page experience with Overview / Use In Code / Sessions, plus a sidebar Sessions with metrics and an event timeline.

Changes

  • Full-screen Agents Library and routed agent details (/library, /library/:agentId)
  • Overview and Use In Code tabs, backed by optional AgentSessionsServer
  • Shared Sessions UI for a single agent and all-user sessions, with shareable URL state
  • Session metrics strip and Chart.js event timeline (turns, tools, sub-agents)
  • Load code snippets via client.internal.agents.getCodeSnippets instead of raw client.fetch

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
Large new surface area (routing, URL state, session/event fetching) and new runtime dependencies (chart.js), but changes are mostly additive behind optional sessions and library capabilities rather than altering core chat send/receive paths.

Overview
Turns the Agents Library from a modal into a shell overlay (sidebar Sessions entry included), with routed /library, /library/:agentId, and /sessions when withRouter is on. Agent rows can open detail pages with Overview, Sessions, and Use In Code tabs driven by shareable query state (?tab=, ?view=sessions, filters, session links).

Introduces an optional AgentSessionsServer port (wired in the TrueForge adapter via createHarnessAgentSessionsServer, including getCodeSnippets through client.internal.agents.getCodeSnippets). The Sessions experience is a shared two-pane list + metrics strip, Chart.js event timeline, and read-only turn transcript projection; layouts and thread list navigation close library/sessions overlays when returning to chat.

Routing sync now sanitizes shell-owned query keys across places; LibrarySessionShareBoot deep-links library agents and the sessions browser without requiring the router. New UI is slot-overridable (documented + Cursor rule), with tooltip upgrades for timeline hovers and a small adapter fix to absolutize relative SDK baseUrl for Bearer auth.

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

@changeset-bot

changeset-bot Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c841547

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
frontend Patch

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

harshil-2096 and others added 2 commits September 1, 2026 10:57
…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.
@govindavashishtha
govindavashishtha enabled auto-merge (squash) September 1, 2026 09:18
@govindavashishtha
govindavashishtha merged commit a189482 into main Sep 1, 2026
10 checks passed
@govindavashishtha
govindavashishtha deleted the feat/gv/sessions branch September 1, 2026 09:20

@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 c841547. Configure here.

if (matched == null || matched.type !== 'root') return matched;
const { agentId } = readSessionShareSearch(search);
return agentId != null ? { type: 'libraryAgent', agentId } : matched;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sessions share query opens agent details

High Severity

matchLocation promotes any root URL with agentId to a library-agent place and never reads view=sessions. With withRouter, boot then calls openLibraryAgent, which closes the sessions browser. Share links of the form ?view=sessions&agentId= (the no-router Sessions URL, including an agent filter) therefore open that agent's details instead of the all-user Sessions page.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c841547. Configure here.

{agent.name}
</option>
);
})}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent filter sends name as ID

Medium Severity

The Sessions agent dropdown uses agent.agentId ?? agent.name as the listSessions agentId. agentId is optional on library rows (the library only enables details when it is present), so picking an agent that only has a name sends a display name to an ID filter. The list then comes back empty or the request fails, even when that agent has sessions.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c841547. Configure here.

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