Skip to content

fix(agent-admin): return session titles with a first-message fallback - #277

Merged
vmelikyan merged 1 commit into
mainfrom
fix/admin-session-titles
Oct 29, 2026
Merged

vmelikyan merged 1 commit into
mainfrom
fix/admin-session-titles

Conversation

@vmelikyan

@vmelikyan vmelikyan commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • The admin session list and session detail (GET /api/v2/ai/admin/agent/sessions, GET /api/v2/ai/admin/agent/sessions/{sessionId}) now return a title for each session: the latest conversation's title when it is named, otherwise the first user message on one line, truncated to 80 characters. This is the same fallback the user sessions list already uses.
  • Before, the admin UI had only latestThreadTitle, which is usually Default thread or null, so almost every row showed "Untitled conversation".
  • readUsefulThreadTitle, deriveTitleFromMessageParts and loadFirstUserMessageParts are now exported from SessionReadService and reused, not copied.
  • The list loads first messages only for sessions on the current page that have no named conversation, so the extra query stays bounded by the page size.
  • title is added to the AgentAdminSessionSummary OpenAPI schema as optional and nullable. The admin UI uses it in GoodRxOSS/lifecycle-ui#101.

Verifying Changes

  • AdminService.test.ts covers the first-message title, a named conversation title winning over the first message, the page-only first-message load, and no extra query when the page is empty.
  • jest for src/server/services/agent, openApiSpec and the admin routes (2181 tests), eslint and prettier pass.

@vmelikyan
vmelikyan marked this pull request as ready for review October 29, 2026 04:02
@vmelikyan
vmelikyan requested a review from a team as a code owner October 29, 2026 04:02
@vmelikyan
vmelikyan merged commit a6e603f into main Oct 29, 2026
1 check passed
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