Skip to content

Add AI-generated Agent Host session titles#320887

Merged
DonJayamanne merged 2 commits into
mainfrom
agents/we-have-src-vs-platform-agenthost-node-shared-0c38c4fa
Jun 11, 2026
Merged

Add AI-generated Agent Host session titles#320887
DonJayamanne merged 2 commits into
mainfrom
agents/we-have-src-vs-platform-agenthost-node-shared-0c38c4fa

Conversation

@DonJayamanne

Copy link
Copy Markdown
Contributor

Adds AI-generated session titles for Agent Host sessions using Copilot utility chat completion after seeding the existing first-message fallback title.

The title workflow now guards against clobbering manual renames, skips pre-titled/forked sessions, cancels pending generation when sessions are disposed, and persists generated titles as custom titles.

Validation:

  • npm run compile-check-ts-native -- --pretty false
  • fnm exec --using 24 npm run test-node -- --run src/vs/platform/agentHost/test/node/agentHostSessionTitleController.test.ts --run src/vs/platform/agentHost/test/node/agentService.test.ts --run src/vs/platform/agentHost/test/node/agentSideEffects.test.ts --run src/vs/platform/agentHost/test/node/agentHostTurnTelemetry.test.ts
  • npm run precommit

Generate agent host session titles with a Copilot utility request after seeding the first-message fallback title. Guard generated title application against manual renames, cancel pending generation on session disposal, and persist generated custom titles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 04:43
@DonJayamanne DonJayamanne marked this pull request as draft June 11, 2026 04:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds AI-generated titles for Agent Host sessions by seeding an immediate first-message fallback title, then asynchronously generating a short “utility” title via Copilot CAPI and persisting it as customTitle, with cancellation/guardrails to avoid clobbering manual renames or disposed sessions.

Changes:

  • Introduces AgentHostSessionTitleController to manage fallback title seeding, AI title generation, persistence, and cancellation.
  • Wires title generation into AgentSideEffects on first user turn and cancels in-flight generation on session disposal via AgentService.
  • Adds targeted unit tests covering generation success, failure, manual rename protection, cancellation, and fork/title skip behavior.
Show a summary per file
File Description
src/vs/platform/agentHost/test/node/agentService.test.ts Adds end-to-end-ish tests exercising title generation via AgentService dispatch flow and persistence behavior.
src/vs/platform/agentHost/test/node/agentHostSessionTitleController.test.ts New unit tests for AgentHostSessionTitleController behaviors (seed, generate, skip, cancel, no-clobber).
src/vs/platform/agentHost/node/agentSideEffects.ts Routes first-turn title seeding to the new controller and exposes cancellation hook.
src/vs/platform/agentHost/node/agentService.ts Plumbs Copilot API service/token getter into side effects and cancels title generation when sessions dispose.
src/vs/platform/agentHost/node/agentHostSessionTitleController.ts New controller implementing fallback seeding, CAPI utility prompt, title cleaning, persistence, and cancellation.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment thread src/vs/platform/agentHost/node/agentHostSessionTitleController.ts
Comment thread src/vs/platform/agentHost/node/agentHostSessionTitleController.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@DonJayamanne DonJayamanne requested a review from roblourens June 11, 2026 05:52
@DonJayamanne DonJayamanne marked this pull request as ready for review June 11, 2026 05:52
@DonJayamanne DonJayamanne requested a review from connor4312 June 11, 2026 16:06
@DonJayamanne DonJayamanne merged commit c3f4c30 into main Jun 11, 2026
25 checks passed
@DonJayamanne DonJayamanne deleted the agents/we-have-src-vs-platform-agenthost-node-shared-0c38c4fa branch June 11, 2026 17:02
@vs-code-engineering vs-code-engineering Bot added this to the 1.125.0 milestone Jun 11, 2026
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.

3 participants