Skip to content

[cherry-pick] Hide session chat pills in subagent chats - #334827

Open
vs-code-engineering[bot] wants to merge 2 commits into
release/1.136from
cherry-pick/334510
Open

[cherry-pick] Hide session chat pills in subagent chats#334827
vs-code-engineering[bot] wants to merge 2 commits into
release/1.136from
cherry-pick/334510

Conversation

@vs-code-engineering

Copy link
Copy Markdown
Contributor

Cherry-pick of #334510 from main.

⚠️ This cherry-pick has merge conflicts that need manual resolution. Conflict markers (<<<<<<</=======/>>>>>>>) are committed to the branch — check it out locally, resolve, and force-push.

git fetch origin cherry-pick/334510 && git checkout cherry-pick/334510
# resolve conflicts, then:
git add -A && git commit --amend --no-edit && git push --force-with-lease

Conflicting files:

  • src/vs/sessions/contrib/chat/browser/sessionChatInputToolbar.ts
  • src/vs/sessions/contrib/chat/test/browser/sessionChatInputToolbar.test.ts
  • src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts
  • src/vs/workbench/contrib/chat/test/browser/agentHost/agentHostSessionInputPills.test.ts

Description

Session pills (changes, PRs, issues, artifacts, references, customizations, browsers, subagents) describe the whole session, but were also rendered under a subagent chat's transcript — where they read as the subagent's own work.

The row is now hidden while a subagent chat is viewed, gated at the shared ChatInputPills enabled observable in the two hosts that own it:

  • sessionChatInputToolbar.ts (Agents Window) — new _isSubagentChat derived following the layer's existing convention (chat.origin?.kind === ChatOriginKind.Tool). The pills debug overlay still forces the row visible.
  • agentHostSessionInputPills.ts (chat editor + view pane) — resolves the viewed chat channel and checks isSubagentChatUri. Covers both addressing forms the subagent editor uses: the subagentChatResource query param, and the canonical fragment-only form resolved through session state. The resolution previously inlined in getAgentHostSessionBrowserOwnerIds is extracted into getAgentHostSessionChatResource and shared, so the two paths cannot drift.
// sessionChatInputToolbar.ts
const pillsEnabled = derived(reader => this._debugData.read(reader) !== undefined
    || (turnStatusPillsEnabled.read(reader) && !this._isSubagentChat.read(reader)));

Hiding produces the same state as a chat with no pill data, so layout is unchanged: the Agents Window keeps its static height reservation, and the workbench host releases persistentContentHeight as it already does when empty.

Per-turn pills (ChatTurnPillsWidget) are untouched — they describe a single turn's own changes, which is legitimate inside a subagent transcript. Fork, side, and peer chats keep their pills.

Tests cover both surfaces: a single widget navigating session → subagent (both URI forms) → back, asserting pills and reserved height; and the Agents Window toolbar across main, subagent, and fork chats.

Copilot AI balanced review requested due to automatic review settings September 6, 2026 21:02
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label Sep 6, 2026

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.

🟡 Changes recommended

Unresolved conflict markers, missing prerequisite APIs, and absent production wiring prevent compilation and intended behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Cherry-picks session-pill hiding for subagent chats across Agents Window and workbench surfaces, but the port is incomplete.

Changes:

  • Detects subagent chats and suppresses session-wide pills.
  • Adds navigation and visibility regression tests.
  • Extracts workbench chat-resource resolution.
File summaries
File Description
sessionChatInputToolbar.ts Adds Agents Window subagent detection; contains unresolved conflicts.
sessionChatInputToolbar.test.ts Adds visibility coverage; contains unresolved conflicts.
agentHostSessionInputPills.ts Adds workbench pill handling, but depends on unavailable APIs.
agentHostSessionInputPills.test.ts Tests workbench pill visibility and navigation.
Review details

Suppressed comments (11)

src/vs/sessions/contrib/chat/browser/sessionChatInputToolbar.ts:195

  • This conflict leaves both the existing ChatPillsWidget implementation and an incompatible ChatInputPills implementation in the constructor, so the file cannot parse or type-check. Resolve the block against the target branch's current pill architecture.
<<<<<<< HEAD

src/vs/sessions/contrib/chat/browser/sessionChatInputToolbar.ts:342

  • A third unresolved conflict interrupts the context-menu callback and constructor body, leaving unmatched syntax and references from two implementations. This block must be resolved before compilation.
<<<<<<< HEAD

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:26

  • This target branch's workbench/browser/chatPills.ts does not export CHAT_INPUT_PILLS_ROW_HEIGHT, getChatPillResourceLocation, or ChatPillsCompactMode, so this import fails type-checking. Port the prerequisite pill API or adapt this implementation to the available ChatPillsWidget API.
import { CHAT_INPUT_PILLS_ROW_HEIGHT, getChatPillEntries, getChatPillResourceLocation, IChatPillEntry, IChatPillSection, type ChatPillsCompactMode } from '../../../../../browser/chatPills.js';

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:32

  • The imported src/vs/workbench/contrib/chat/common/sessionChatPills.ts module is absent from this branch, so this production file and its test cannot compile. Include the prerequisite shared visibility service before using it here.
import { ISessionChatPillVisibilityService, SessionChatPillKind } from '../../../common/sessionChatPills.js';

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:38

  • chatInputPills.ts and its ChatInputPills/StandardChatInputPillSources exports do not exist in this target checkout, making this new file uncompilable. The cherry-pick needs to port that prerequisite or use the branch's existing pill components.
import { ChatInputPills, StandardChatInputPillSources } from '../../chatInputPills.js';

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:229

  • AgentHostSessionInputPills is referenced only by its new test and is never instantiated from production code, so the workbench chat editor/view pane behavior described by the PR cannot run. Wire the component into the agent-host chat widget lifecycle and dispose it with that owner.
export class AgentHostSessionInputPills extends Disposable {

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:31

  • The imported vs/workbench/common/chatPullRequest module is not present in this checkout, so pull-request pill construction cannot compile. This cherry-pick must include an appropriate workbench-layer implementation rather than importing the Sessions layer downward.
import { computePullRequestIcon, getHighestPriorityPullRequestIcon } from '../../../../../common/chatPullRequest.js';

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:37

  • editorChatResponseFileChangesService.ts does not export openChatFileChanges on this branch, making this import invalid. Port the helper or use the target service API to open the changes editor.
import { openChatFileChanges } from '../../editorChatResponseFileChangesService.js';

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:39

  • agentHostResponseFileChanges.ts has no exported agentHostChangesetFileToEntryDiff; its conversion is currently a private class method. This import and the call below therefore fail type-checking.
import { agentHostChangesetFileToEntryDiff } from './agentHostResponseFileChanges.js';

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:176

  • The target IAgentHostSessionResolution contains only connection and backendSession; connectionAuthority and defaultChangesetKind do not exist. All reads of those fields in this class are compile errors until the prerequisite resolution contract is ported or the implementation is adapted.
function resolutionEquals(first: IAgentHostSessionResolution | undefined, second: IAgentHostSessionResolution | undefined): boolean {
	return first === second || (!!first && !!second
		&& first.connection === second.connection
		&& first.connectionAuthority === second.connectionAuthority
		&& first.defaultChangesetKind === second.defaultChangesetKind
		&& isEqual(first.backendSession, second.backendSession));

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts:396

  • ChatWidget in this branch has no setPersistentContentHeight method, so this call and the corresponding test stubs do not type-check. Port the widget API or update layout through the target branch's existing persistent-content mechanism.
			this._widget.setPersistentContentHeight(visible ? CHAT_INPUT_PILLS_ROW_HEIGHT : undefined);
  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

import { OPEN_ISSUE_ACTION_ID, OPEN_PULL_REQUEST_ACTION_ID } from '../../github/common/types.js';
import { getSessionChatPillMenu, SessionChatPillKind, SessionChatPillVisibility, type ISessionChatPillMenuEntry } from '../common/sessionChatPills.js';
import { ISessionsService } from '../../../services/sessions/browser/sessionsService.js';
<<<<<<< HEAD
*--------------------------------------------------------------------------------------------*/

import assert from 'assert';
<<<<<<< HEAD
import { localize } from '../../../../../../nls.js';
import { IAgentHostConnectionsService, IAgentHostSessionResolution } from '../../../../../../platform/agentHost/common/agentHostConnectionsService.js';
import { toAgentHostUri } from '../../../../../../platform/agentHost/common/agentHostUri.js';
import { resolveChangesetUriTemplate, selectDefaultChangeset, type DefaultChangesetKind } from '../../../../../../platform/agentHost/common/changesetUri.js';
@dmitrivMS

Copy link
Copy Markdown
Collaborator

Copilot Resolve merge conflicts.

Co-authored-by: dmitrivMS <9581278+dmitrivMS@users.noreply.github.com>

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Copilot Resolve merge conflicts.

Resolved in 84ecaa17. The conflicted Sessions toolbar files are fixed, the main-only unwired workbench additions were removed for release/1.136, and validation passes (npm run typecheck-client; focused browser test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants