[cherry-pick] Hide session chat pills in subagent chats - #334827
[cherry-pick] Hide session chat pills in subagent chats#334827vs-code-engineering[bot] wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 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
ChatPillsWidgetimplementation and an incompatibleChatInputPillsimplementation 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.tsdoes not exportCHAT_INPUT_PILLS_ROW_HEIGHT,getChatPillResourceLocation, orChatPillsCompactMode, so this import fails type-checking. Port the prerequisite pill API or adapt this implementation to the availableChatPillsWidgetAPI.
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.tsmodule 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.tsand itsChatInputPills/StandardChatInputPillSourcesexports 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
AgentHostSessionInputPillsis 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/chatPullRequestmodule 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.tsdoes not exportopenChatFileChangeson 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.tshas no exportedagentHostChangesetFileToEntryDiff; 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
IAgentHostSessionResolutioncontains onlyconnectionandbackendSession;connectionAuthorityanddefaultChangesetKinddo 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
ChatWidgetin this branch has nosetPersistentContentHeightmethod, 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'; |
|
Copilot Resolve merge conflicts. |
Co-authored-by: dmitrivMS <9581278+dmitrivMS@users.noreply.github.com>
84ecaa1
Resolved in |
Cherry-pick of #334510 from
main.<<<<<<</=======/>>>>>>>) are committed to the branch — check it out locally, resolve, and force-push.Conflicting files:
src/vs/sessions/contrib/chat/browser/sessionChatInputToolbar.tssrc/vs/sessions/contrib/chat/test/browser/sessionChatInputToolbar.test.tssrc/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.tssrc/vs/workbench/contrib/chat/test/browser/agentHost/agentHostSessionInputPills.test.tsDescription
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
ChatInputPillsenabledobservable in the two hosts that own it:sessionChatInputToolbar.ts(Agents Window) — new_isSubagentChatderived 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 checksisSubagentChatUri. Covers both addressing forms the subagent editor uses: thesubagentChatResourcequery param, and the canonical fragment-only form resolved through session state. The resolution previously inlined ingetAgentHostSessionBrowserOwnerIdsis extracted intogetAgentHostSessionChatResourceand shared, so the two paths cannot drift.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
persistentContentHeightas 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.