Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/sessions-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Sessions E2E Tests

on:
pull_request:
branches:
- main
- 'release/*'
paths:
- 'src/vs/sessions/**'
- 'scripts/code-sessions-web.*'
# on:
# pull_request:
# branches:
# - main
# - 'release/*'
# paths:
# - 'src/vs/sessions/**'
# - 'scripts/code-sessions-web.*'

permissions:
contents: read
Expand Down
4 changes: 4 additions & 0 deletions build/lib/i18n.resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,10 @@
"name": "vs/sessions/contrib/chat",
"project": "vscode-sessions"
},
{
"name": "vs/sessions/contrib/copilotChatSessions",
"project": "vscode-sessions"
},
{
"name": "vs/sessions/contrib/codeReview",
"project": "vscode-sessions"
Expand Down
6 changes: 5 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ export default tseslint.config(
'src/vs/workbench/services/remote/common/tunnelModel.ts',
'src/vs/workbench/services/search/common/textSearchManager.ts',
'src/vs/workbench/test/browser/workbenchTestServices.ts',
'src/vs/platform/agentHost/common/state/protocol/reducers.ts',
'test/automation/src/playwrightDriver.ts',
'.eslint-plugin-local/**/*',
],
Expand Down Expand Up @@ -1989,11 +1990,14 @@ export default tseslint.config(
'vs/editor/~',
'vs/editor/contrib/*/~',
'vs/editor/editor.all.js',
'vs/sessions/~',
'vs/sessions/services/*/~',
'vs/sessions/contrib/*/~',
'vs/workbench/~',
'vs/workbench/api/~',
'vs/workbench/services/*/~',
'vs/workbench/contrib/*/~',
'vs/workbench/contrib/terminal/terminal.all.js'
'vs/workbench/contrib/terminal/terminal.all.js',
]
},
{
Expand Down
17 changes: 11 additions & 6 deletions extensions/git/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,17 @@ export class Repository implements Disposable {

this.disposables.push(new FileEventLogger(onRepositoryWorkingTreeFileChange, onRepositoryDotGitFileChange, logger));

// Parent source control
const parentRoot = repository.kind === 'submodule'
? repository.dotGit.superProjectPath
: repository.kind === 'worktree' && repository.dotGit.commonPath
? path.dirname(repository.dotGit.commonPath)
: undefined;
// Parent source control. Repositories opened in the Sessions app
// don't use the parent/child relationship and it is expected for
// a worktree repository to be opened while the main repository
// is closed.
const parentRoot = workspace.isAgentSessionsWorkspace
? undefined
: repository.kind === 'submodule'
? repository.dotGit.superProjectPath
: repository.kind === 'worktree' && repository.dotGit.commonPath
? path.dirname(repository.dotGit.commonPath)
: undefined;
const parent = parentRoot
? this.repositoryResolver.getRepository(parentRoot)?.sourceControl
: undefined;
Expand Down
38 changes: 15 additions & 23 deletions src/vs/platform/agentHost/common/agentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { URI } from '../../../base/common/uri.js';
import { createDecorator } from '../../instantiation/common/instantiation.js';
import type { IActionEnvelope, INotification, ISessionAction } from './state/sessionActions.js';
import type { IBrowseDirectoryResult, IFetchContentResult, IStateSnapshot } from './state/sessionProtocol.js';
import { AttachmentType, PermissionKind, type IToolCallResult, type PolicyState } from './state/sessionState.js';
import { AttachmentType, type IToolCallResult, type PolicyState, type StringOrMarkdown } from './state/sessionState.js';

// IPC contract between the renderer and the agent host utility process.
// Defines all serializable event types, the IAgent provider interface,
Expand Down Expand Up @@ -226,27 +226,19 @@ export interface IAgentUsageEvent extends IAgentProgressEventBase {
readonly cacheReadTokens?: number;
}

/** A tool permission request from the SDK requiring a renderer-side decision. */
export interface IAgentPermissionRequestEvent extends IAgentProgressEventBase {
readonly type: 'permission_request';
/** Unique ID for correlating the response. */
readonly requestId: string;
/** The kind of permission being requested. */
readonly permissionKind: PermissionKind;
/** The tool call ID that triggered this permission request. */
readonly toolCallId?: string;
/** File path involved (for read/write). */
readonly path?: string;
/** For shell: the full command text. */
readonly fullCommandText?: string;
/** For shell: the intention description. */
readonly intention?: string;
/** For MCP: the server name. */
readonly serverName?: string;
/** For MCP: the tool name. */
readonly toolName?: string;
/** Serialized JSON of the full permission request for fallback display. */
readonly rawRequest: string;
/**
* A running tool requires re-confirmation (e.g. a mid-execution permission check).
* Maps to `SessionToolCallReady` without `confirmed` to transition Running → PendingConfirmation.
*/
export interface IAgentToolReadyEvent extends IAgentProgressEventBase {
readonly type: 'tool_ready';
readonly toolCallId: string;
/** Message describing what confirmation is needed. */
readonly invocationMessage: StringOrMarkdown;
/** Raw tool input to display. */
readonly toolInput?: string;
/** Short title for the confirmation prompt. */
readonly confirmationTitle?: StringOrMarkdown;
}

/** Streaming reasoning/thinking content from the assistant. */
Expand All @@ -260,11 +252,11 @@ export type IAgentProgressEvent =
| IAgentMessageEvent
| IAgentIdleEvent
| IAgentToolStartEvent
| IAgentToolReadyEvent
| IAgentToolCompleteEvent
| IAgentTitleChangedEvent
| IAgentErrorEvent
| IAgentUsageEvent
| IAgentPermissionRequestEvent
| IAgentReasoningEvent;

// ---- Session URI helpers ----------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 409b385
// Synced from agent-host-protocol @ 69603e5

// Generated from types/actions.ts — do not edit
// Run `npm run generate` to regenerate.

import { ActionType, type IStateAction, type IRootAgentsChangedAction, type IRootActiveSessionsChangedAction, type ISessionReadyAction, type ISessionCreationFailedAction, type ISessionTurnStartedAction, type ISessionDeltaAction, type ISessionResponsePartAction, type ISessionToolCallStartAction, type ISessionToolCallDeltaAction, type ISessionToolCallReadyAction, type ISessionToolCallConfirmedAction, type ISessionToolCallCompleteAction, type ISessionToolCallResultConfirmedAction, type ISessionPermissionRequestAction, type ISessionPermissionResolvedAction, type ISessionTurnCompleteAction, type ISessionTurnCancelledAction, type ISessionErrorAction, type ISessionTitleChangedAction, type ISessionUsageAction, type ISessionReasoningAction, type ISessionModelChangedAction, type ISessionServerToolsChangedAction, type ISessionActiveClientChangedAction, type ISessionActiveClientToolsChangedAction } from './actions.js';
import { ActionType, type IStateAction, type IRootAgentsChangedAction, type IRootActiveSessionsChangedAction, type ISessionReadyAction, type ISessionCreationFailedAction, type ISessionTurnStartedAction, type ISessionDeltaAction, type ISessionResponsePartAction, type ISessionToolCallStartAction, type ISessionToolCallDeltaAction, type ISessionToolCallReadyAction, type ISessionToolCallConfirmedAction, type ISessionToolCallCompleteAction, type ISessionToolCallResultConfirmedAction, type ISessionTurnCompleteAction, type ISessionTurnCancelledAction, type ISessionErrorAction, type ISessionTitleChangedAction, type ISessionUsageAction, type ISessionReasoningAction, type ISessionModelChangedAction, type ISessionServerToolsChangedAction, type ISessionActiveClientChangedAction, type ISessionActiveClientToolsChangedAction } from './actions.js';


// ─── Root vs Session Action Unions ───────────────────────────────────────────
Expand All @@ -34,8 +34,6 @@ export type ISessionAction =
| ISessionToolCallConfirmedAction
| ISessionToolCallCompleteAction
| ISessionToolCallResultConfirmedAction
| ISessionPermissionRequestAction
| ISessionPermissionResolvedAction
| ISessionTurnCompleteAction
| ISessionTurnCancelledAction
| ISessionErrorAction
Expand All @@ -54,7 +52,6 @@ export type IClientSessionAction =
| ISessionToolCallConfirmedAction
| ISessionToolCallCompleteAction
| ISessionToolCallResultConfirmedAction
| ISessionPermissionResolvedAction
| ISessionTurnCancelledAction
| ISessionModelChangedAction
| ISessionActiveClientChangedAction
Expand All @@ -70,7 +67,6 @@ export type IServerSessionAction =
| ISessionToolCallStartAction
| ISessionToolCallDeltaAction
| ISessionToolCallReadyAction
| ISessionPermissionRequestAction
| ISessionTurnCompleteAction
| ISessionErrorAction
| ISessionTitleChangedAction
Expand Down Expand Up @@ -99,8 +95,6 @@ export const IS_CLIENT_DISPATCHABLE: { readonly [K in IStateAction['type']]: boo
[ActionType.SessionToolCallConfirmed]: true,
[ActionType.SessionToolCallComplete]: true,
[ActionType.SessionToolCallResultConfirmed]: true,
[ActionType.SessionPermissionRequest]: false,
[ActionType.SessionPermissionResolved]: true,
[ActionType.SessionTurnComplete]: false,
[ActionType.SessionTurnCancelled]: true,
[ActionType.SessionError]: false,
Expand Down
70 changes: 25 additions & 45 deletions src/vs/platform/agentHost/common/state/protocol/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 409b385
// Synced from agent-host-protocol @ 69603e5

import { ToolCallConfirmationReason, ToolCallCancellationReason, type URI, type StringOrMarkdown, type IAgentInfo, type IErrorInfo, type IUserMessage, type IResponsePart, type IToolCallResult, type IToolDefinition, type ISessionActiveClient, type IUsageInfo, type IPermissionRequest } from './state.js';
import { ToolCallConfirmationReason, ToolCallCancellationReason, type URI, type StringOrMarkdown, type IAgentInfo, type IErrorInfo, type IUserMessage, type IResponsePart, type IToolCallResult, type IToolDefinition, type ISessionActiveClient, type IUsageInfo } from './state.js';


// ─── Action Type Enum ────────────────────────────────────────────────────────
Expand All @@ -31,8 +31,6 @@ export const enum ActionType {
SessionToolCallConfirmed = 'session/toolCallConfirmed',
SessionToolCallComplete = 'session/toolCallComplete',
SessionToolCallResultConfirmed = 'session/toolCallResultConfirmed',
SessionPermissionRequest = 'session/permissionRequest',
SessionPermissionResolved = 'session/permissionResolved',
SessionTurnComplete = 'session/turnComplete',
SessionTurnCancelled = 'session/turnCancelled',
SessionError = 'session/error',
Expand Down Expand Up @@ -161,7 +159,10 @@ export interface ISessionTurnStartedAction {
}

/**
* Streaming text chunk from the assistant.
* Streaming text chunk from the assistant, appended to a specific response part.
*
* The server MUST first emit a `session/responsePart` to create the target
* part (markdown or reasoning), then use this action to append text to it.
*
* @category Session Actions
* @version 1
Expand All @@ -172,6 +173,8 @@ export interface ISessionDeltaAction {
session: URI;
/** Turn identifier */
turnId: string;
/** Identifier of the response part to append to */
partId: string;
/** Text chunk */
content: string;
}
Expand Down Expand Up @@ -230,9 +233,16 @@ export interface ISessionToolCallDeltaAction extends IToolCallActionBase {
}

/**
* Tool call parameters are complete. Transitions to `pending-confirmation`
* Tool call parameters are complete, or a running tool requires re-confirmation.
*
* When dispatched for a `streaming` tool call, transitions to `pending-confirmation`
* or directly to `running` if `confirmed` is set.
*
* When dispatched for a `running` tool call (e.g. mid-execution permission needed),
* transitions back to `pending-confirmation`. The `invocationMessage` and `_meta`
* SHOULD be updated to describe the specific confirmation needed. Clients use the
* standard `session/toolCallConfirmed` flow to approve or deny.
*
* For client-provided tools, the server typically sets `confirmed` to
* `'not-needed'` so the tool transitions directly to `running`, where the
* owning client can begin execution immediately.
Expand All @@ -242,10 +252,12 @@ export interface ISessionToolCallDeltaAction extends IToolCallActionBase {
*/
export interface ISessionToolCallReadyAction extends IToolCallActionBase {
type: ActionType.SessionToolCallReady;
/** Message describing what the tool will do */
/** Message describing what the tool will do or what confirmation is needed */
invocationMessage: StringOrMarkdown;
/** Raw tool input */
toolInput?: string;
/** Short title for the confirmation prompt (e.g. `"Run in terminal"`, `"Write file"`) */
confirmationTitle?: StringOrMarkdown;
/** If set, the tool was auto-confirmed and transitions directly to `running` */
confirmed?: ToolCallConfirmationReason;
}
Expand Down Expand Up @@ -337,41 +349,6 @@ export interface ISessionToolCallResultConfirmedAction extends IToolCallActionBa
approved: boolean;
}

/**
* Permission needed from the user to proceed.
*
* @category Session Actions
* @version 1
*/
export interface ISessionPermissionRequestAction {
type: ActionType.SessionPermissionRequest;
/** Session URI */
session: URI;
/** Turn identifier */
turnId: string;
/** Permission request details */
request: IPermissionRequest;
}

/**
* Permission granted or denied.
*
* @category Session Actions
* @version 1
* @clientDispatchable
*/
export interface ISessionPermissionResolvedAction {
type: ActionType.SessionPermissionResolved;
/** Session URI */
session: URI;
/** Turn identifier */
turnId: string;
/** Permission request ID */
requestId: string;
/** Whether permission was granted */
approved: boolean;
}

/**
* Turn finished — the assistant is idle.
*
Expand Down Expand Up @@ -448,7 +425,10 @@ export interface ISessionUsageAction {
}

/**
* Reasoning/thinking text from the model.
* Reasoning/thinking text from the model, appended to a specific reasoning response part.
*
* The server MUST first emit a `session/responsePart` to create the target
* reasoning part, then use this action to append text to it.
*
* @category Session Actions
* @version 1
Expand All @@ -459,6 +439,8 @@ export interface ISessionReasoningAction {
session: URI;
/** Turn identifier */
turnId: string;
/** Identifier of the reasoning response part to append to */
partId: string;
/** Reasoning text chunk */
content: string;
}
Expand Down Expand Up @@ -552,8 +534,6 @@ export type IStateAction =
| ISessionToolCallConfirmedAction
| ISessionToolCallCompleteAction
| ISessionToolCallResultConfirmedAction
| ISessionPermissionRequestAction
| ISessionPermissionResolvedAction
| ISessionTurnCompleteAction
| ISessionTurnCancelledAction
| ISessionErrorAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 409b385
// Synced from agent-host-protocol @ 69603e5

import type { URI, ISnapshot, ISessionSummary, ITurn } from './state.js';
import type { IActionEnvelope, IStateAction } from './actions.js';
Expand Down
2 changes: 1 addition & 1 deletion src/vs/platform/agentHost/common/state/protocol/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 409b385
// Synced from agent-host-protocol @ 69603e5

// ─── Standard JSON-RPC Codes ─────────────────────────────────────────────────

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 409b385
// Synced from agent-host-protocol @ 69603e5

import type { IInitializeParams, IInitializeResult, IReconnectParams, IReconnectResult, ISubscribeParams, ISubscribeResult, ICreateSessionParams, IDisposeSessionParams, IListSessionsParams, IListSessionsResult, IFetchContentParams, IFetchContentResult, IBrowseDirectoryParams, IBrowseDirectoryResult, IFetchTurnsParams, IFetchTurnsResult, IUnsubscribeParams, IDispatchActionParams, IAuthenticateParams, IAuthenticateResult } from './commands.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 409b385
// Synced from agent-host-protocol @ 69603e5

import type { URI, ISessionSummary } from './state.js';

Expand Down
Loading
Loading