Get task buttons working for Claude#312232
Merged
TylerLeonhardt merged 2 commits intomainfrom Apr 23, 2026
Merged
Conversation
By hard coding it along with CLI...
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends “background/local workspace agent” behavior (notably task/terminal affordances) to Claude Code sessions in the Agents (Sessions) window by treating Claude Code similarly to Copilot CLI sessions.
Changes:
- Added a shared helper to identify workspace-backed agent session types (currently Copilot CLI + Claude Code).
- Updated active-session context key wiring and terminal path resolution to use the shared helper.
- Expanded terminal contribution test coverage to include Claude sessions and repository-only archival cleanup.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/services/sessions/common/session.ts | Adds isLocalAgentSessionType helper for Copilot CLI + Claude Code session-type checks. |
| src/vs/sessions/services/sessions/browser/sessionsManagementService.ts | Uses the new helper to drive the “background provider” active-session context key. |
| src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.ts | Uses the helper to decide when to use worktree/repo cwd and when to close terminals on archive/remove. |
| src/vs/sessions/contrib/terminal/test/browser/sessionsTerminalContribution.test.ts | Adds Claude-specific terminal cwd tests and a repository-only archived-session terminal close test. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.ts:160
- The comment says this closes terminals for a session’s “worktree”, but
getSessionTerminalInfonow uses worktree or repository (and unwraps agent-host URIs). Update the comment to match the behavior so it’s clear terminals can also be keyed/closed by repository path when no worktree is present.
// When a session is archived or removed, close all terminals for its worktree
this._register(this._sessionsManagementService.onDidChangeSessions(e => {
for (const session of [...e.removed, ...e.changed.filter(s => s.isArchived.get())]) {
const info = getSessionTerminalInfo(session);
if (info) {
this._closeTerminalsForPath(info.cwd.fsPath);
- Files reviewed: 4/4 changed files
- Comments generated: 3
TylerLeonhardt
commented
Apr 23, 2026
Member
Author
TylerLeonhardt
left a comment
There was a problem hiding this comment.
Addressed: renamed isLocalAgentSessionType → isWorkspaceAgentSessionType, updated JSDoc and comments to describe workspace/worktree-backed behavior rather than locality. Renamed the backing field _isBackgroundProvider → _isWorkspaceAgent to align semantics.
roblourens
approved these changes
Apr 23, 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.
By hard coding it along with CLI...