Skip to content

make sure hook is shown in collapsed title for subagent and thinking#295696

Merged
justschen merged 5 commits intomainfrom
justin/audino
Feb 17, 2026
Merged

make sure hook is shown in collapsed title for subagent and thinking#295696
justschen merged 5 commits intomainfrom
justin/audino

Conversation

@justschen
Copy link
Collaborator

fixes issue where hooks wouldn't be shown in thinking and subagent titles when they were shown in the dropdown

Copilot AI review requested due to automatic review settings February 17, 2026 04:14
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where hook messages (blocked tools or warnings) were not being shown in the collapsed titles of thinking and subagent sections, even though they were visible in the dropdown when expanded.

Changes:

  • Modified thinking part title update logic to allow hook titles to be displayed after response completion
  • Added hook count tracking to inform LLM title generation about blocked/warned tools
  • Updated subagent part to display hook messages in collapsed title immediately when hooks are appended
  • Enhanced LLM title generation prompt to handle blocked/denied content appropriately

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts Added hookCount tracking, modified setTitle to check generatedTitle instead of element.isComplete, updated LLM prompt to conditionally include hook-related guidance
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.ts Added logic to appendHookItem to generate and display hook messages in the title before rendering the hook item
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts:1372

  • The change from checking this.element.isComplete to this.content.generatedTitle creates a potential race condition. Consider this scenario:
  1. Response completes, finalizeTitleIfDefault() is called
  2. LLM title generation starts asynchronously via generateTitleViaLLM()
  3. Hook arrives and calls setTitle() with hook message (line 1235 in trackToolMetadata) - this succeeds because generatedTitle is not set yet
  4. LLM title generation completes, sets this.content.generatedTitle and calls super.setTitle() (line 918), overwriting the hook title

The hook title would be briefly displayed then immediately overwritten. A more robust solution would be to:

  • Track whether title finalization has started with a boolean flag
  • Only allow hook-related updates after finalization starts
  • Or, better yet, include hook information in the context passed to generateTitleViaLLM() so hooks are incorporated into the generated title
	protected override setTitle(title: string, omitPrefix?: boolean): void {
		if (!title || this.element.isComplete) {
			return;
		}

		if (omitPrefix) {

justschen and others added 3 commits February 16, 2026 20:22
…chatThinkingContentPart.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@justschen justschen enabled auto-merge (squash) February 17, 2026 04:51
@justschen justschen merged commit fe621df into main Feb 17, 2026
18 checks passed
@justschen justschen deleted the justin/audino branch February 17, 2026 06:08
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