Add AI-generated Agent Host session titles#320887
Merged
DonJayamanne merged 2 commits intoJun 11, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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
AgentHostSessionTitleControllerto manage fallback title seeding, AI title generation, persistence, and cancellation. - Wires title generation into
AgentSideEffectson first user turn and cancels in-flight generation on session disposal viaAgentService. - 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
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
connor4312
approved these changes
Jun 11, 2026
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: