From 1d6c952890bc75cbf862d3afd86b46a9fa3f70f1 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 11 Aug 2026 12:25:49 -0400 Subject: [PATCH 1/7] agentHost: coordinate overlapping sessions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa352131-aed7-4160-a87f-4aa9a424de5c --- .../node/copilot/prompts/toolInstructions.ts | 6 +++- .../node/shared/sessionServerTools.ts | 4 +-- .../test/node/toolInstructions.test.ts | 28 +++++++++++-------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts b/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts index 9ede4409f9a41c..550e4011fef720 100644 --- a/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts +++ b/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts @@ -45,6 +45,10 @@ const agenticBrowserToolNames = browserChatToolReferenceNames.filter(name => nam export const COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION = 'When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again.'; const largeOutputToolInstructions: ToolInstructionLine = () => COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION; +/** Coordinates work across sessions that may use different worktrees for the same repository. */ +export const COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION = 'Before beginning code changes or creating a session, use `list_sessions` to check active sessions across the same project or repository—not only the same working directory—for overlapping activity, branches, pull requests, or changes; when overlap is plausible, use `get_session_context` and `send_message` to coordinate, and reuse or wait for existing work instead of duplicating it or editing the same area concurrently.'; +const sessionCoordinationToolInstructions: ToolInstructionLine = () => COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION; + /** * Front-end guidance for the integrated browser tools, ported from the Copilot * extension's `defaultAgentInstructions`/per-model prompts. Emitted only when the @@ -65,7 +69,7 @@ const browserToolInstructions: ToolInstructionLine = hasTool => { /** * The registered tool-instruction lines, in render order. */ -const TOOL_INSTRUCTION_LINES: readonly ToolInstructionLine[] = [largeOutputToolInstructions, browserToolInstructions]; +const TOOL_INSTRUCTION_LINES: readonly ToolInstructionLine[] = [largeOutputToolInstructions, sessionCoordinationToolInstructions, browserToolInstructions]; /** Tool-search guidance mirrored from the Copilot extension prompt. */ const toolSearchToolInstructions: ToolInstructionLine = hasTool => diff --git a/src/vs/platform/agentHost/node/shared/sessionServerTools.ts b/src/vs/platform/agentHost/node/shared/sessionServerTools.ts index aaa241865db6a6..bfb50bc3de4104 100644 --- a/src/vs/platform/agentHost/node/shared/sessionServerTools.ts +++ b/src/vs/platform/agentHost/node/shared/sessionServerTools.ts @@ -123,7 +123,7 @@ export const sessionServerToolDefinitions: ToolDefinition[] = [ { name: SessionServerToolName.ListSessions, title: 'List Sessions', - description: 'List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`.', + description: 'List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Use this before starting code changes or creating a session to find overlapping active work across the same project or repository, including sessions in different worktrees. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`.', inputSchema: listSessionsInputSchema, annotations: { readOnlyHint: true }, }, @@ -137,7 +137,7 @@ export const sessionServerToolDefinitions: ToolDefinition[] = [ { name: SessionServerToolName.CreateSession, title: 'Create Session', - description: 'Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button.', + description: 'Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for overlapping active work in the same project or repository, even when working directories differ. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button.', inputSchema: createSessionInputSchema, annotations: { readOnlyHint: false }, }, diff --git a/src/vs/platform/agentHost/test/node/toolInstructions.test.ts b/src/vs/platform/agentHost/test/node/toolInstructions.test.ts index ffc80d320a736b..b51ba9097489a3 100644 --- a/src/vs/platform/agentHost/test/node/toolInstructions.test.ts +++ b/src/vs/platform/agentHost/test/node/toolInstructions.test.ts @@ -5,7 +5,7 @@ import assert from 'assert'; import type { SectionOverride } from '@github/copilot-sdk'; -import { COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION, resolveToolInstructionsOverride, toolSearchInstructionLines, universalToolInstructions } from '../../node/copilot/prompts/toolInstructions.js'; +import { COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION, COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION, resolveToolInstructionsOverride, toolSearchInstructionLines, universalToolInstructions } from '../../node/copilot/prompts/toolInstructions.js'; import { CLIENT_TOOL_SEARCH_REFERENCE_NAME } from '../../common/toolSearchConstants.js'; import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; @@ -25,6 +25,8 @@ suite('toolInstructions', () => { ensureNoDisposablesAreLeakedInTestSuite(); const LARGE_OUTPUT_LINE = COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION; + const SESSION_COORDINATION_LINE = COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION; + const BASE_LINES = `${LARGE_OUTPUT_LINE}\n${SESSION_COORDINATION_LINE}`; suite('universalToolInstructions', () => { test('joins applicable lines in order and drops gated-out ones', () => { @@ -35,13 +37,15 @@ suite('toolInstructions', () => { assert.strictEqual(universalToolInstructions(hasTools('x'), [lineFor('a')]), undefined); }); - test('always renders the registered large-output line from the default registry', () => { + test('always renders the registered host-wide lines from the default registry', () => { assert.deepStrictEqual([ COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION, + COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION, universalToolInstructions(hasTools()), ], [ 'When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again.', - LARGE_OUTPUT_LINE, + 'Before beginning code changes or creating a session, use `list_sessions` to check active sessions across the same project or repository—not only the same working directory—for overlapping activity, branches, pull requests, or changes; when overlap is plausible, use `get_session_context` and `send_message` to coordinate, and reuse or wait for existing work instead of duplicating it or editing the same area concurrently.', + BASE_LINES, ]); }); @@ -53,9 +57,9 @@ suite('toolInstructions', () => { universalToolInstructions(hasTools('readPage')), ], [ - `${LARGE_OUTPUT_LINE}\nUse the browser tools (openBrowserPage, readPage, etc.) when beneficial for front-end tasks, such as when visualizing or validating UI changes.`, - LARGE_OUTPUT_LINE, - LARGE_OUTPUT_LINE, + `${BASE_LINES}\nUse the browser tools (openBrowserPage, readPage, etc.) when beneficial for front-end tasks, such as when visualizing or validating UI changes.`, + BASE_LINES, + BASE_LINES, ] ); }); @@ -107,19 +111,19 @@ suite('toolInstructions', () => { universalToolInstructions(hasTools(CLIENT_TOOL_SEARCH_REFERENCE_NAME), toolSearchInstructionLines(true)), universalToolInstructions(hasTools('other'), toolSearchInstructionLines(true)), ], [ - `${LARGE_OUTPUT_LINE}\n${TOOL_SEARCH_LINE}`, - LARGE_OUTPUT_LINE, + `${BASE_LINES}\n${TOOL_SEARCH_LINE}`, + BASE_LINES, ]); }); test('inactive tool search never contributes the tool-search line', () => { - assert.strictEqual(universalToolInstructions(hasTools(CLIENT_TOOL_SEARCH_REFERENCE_NAME), toolSearchInstructionLines(false)), LARGE_OUTPUT_LINE); + assert.strictEqual(universalToolInstructions(hasTools(CLIENT_TOOL_SEARCH_REFERENCE_NAME), toolSearchInstructionLines(false)), BASE_LINES); }); test('composes the tool-search line after the registered large-output and browser lines', () => { assert.strictEqual( universalToolInstructions(hasTools('openBrowserPage', 'readPage', CLIENT_TOOL_SEARCH_REFERENCE_NAME), toolSearchInstructionLines(true)), - `${LARGE_OUTPUT_LINE}\nUse the browser tools (openBrowserPage, readPage, etc.) when beneficial for front-end tasks, such as when visualizing or validating UI changes.\n${TOOL_SEARCH_LINE}` + `${BASE_LINES}\nUse the browser tools (openBrowserPage, readPage, etc.) when beneficial for front-end tasks, such as when visualizing or validating UI changes.\n${TOOL_SEARCH_LINE}` ); }); @@ -128,8 +132,8 @@ suite('toolInstructions', () => { resolveToolInstructionsOverride(hasTools(CLIENT_TOOL_SEARCH_REFERENCE_NAME), { action: 'append', content: 'A' }, toolSearchInstructionLines(true)), resolveToolInstructionsOverride(hasTools(CLIENT_TOOL_SEARCH_REFERENCE_NAME), { action: 'append', content: 'A' }, toolSearchInstructionLines(false)), ], [ - { action: 'append', content: `\nA\n${LARGE_OUTPUT_LINE}\n${TOOL_SEARCH_LINE}` }, - { action: 'append', content: `\nA\n${LARGE_OUTPUT_LINE}` }, + { action: 'append', content: `\nA\n${BASE_LINES}\n${TOOL_SEARCH_LINE}` }, + { action: 'append', content: `\nA\n${BASE_LINES}` }, ]); }); }); From b9c26f24738490ae2cb56bb9a50d1ac0b3cd9133 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 11 Aug 2026 12:31:45 -0400 Subject: [PATCH 2/7] agentHost: clarify session coordination guidance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa352131-aed7-4160-a87f-4aa9a424de5c --- .../node/copilot/prompts/toolInstructions.ts | 9 +++++++-- .../agentHost/node/shared/sessionServerTools.ts | 4 ++-- .../agentHost/test/node/toolInstructions.test.ts | 12 ++++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts b/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts index 550e4011fef720..eaf5cfbef8d177 100644 --- a/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts +++ b/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts @@ -45,8 +45,13 @@ const agenticBrowserToolNames = browserChatToolReferenceNames.filter(name => nam export const COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION = 'When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again.'; const largeOutputToolInstructions: ToolInstructionLine = () => COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION; -/** Coordinates work across sessions that may use different worktrees for the same repository. */ -export const COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION = 'Before beginning code changes or creating a session, use `list_sessions` to check active sessions across the same project or repository—not only the same working directory—for overlapping activity, branches, pull requests, or changes; when overlap is plausible, use `get_session_context` and `send_message` to coordinate, and reuse or wait for existing work instead of duplicating it or editing the same area concurrently.'; +/** + * Coordinates work across sessions that may use different worktrees for the + * same repository. Session-management server tools are contributed to every + * Agent Host session; `hasTool` only reflects client tools, so this is + * intentionally unconditional. + */ +export const COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION = 'Before beginning code changes or creating a session, use `list_sessions` to check active sessions across the same project or repository—not only the same working directory—for potentially overlapping work. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.'; const sessionCoordinationToolInstructions: ToolInstructionLine = () => COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION; /** diff --git a/src/vs/platform/agentHost/node/shared/sessionServerTools.ts b/src/vs/platform/agentHost/node/shared/sessionServerTools.ts index bfb50bc3de4104..d9149dec3e5162 100644 --- a/src/vs/platform/agentHost/node/shared/sessionServerTools.ts +++ b/src/vs/platform/agentHost/node/shared/sessionServerTools.ts @@ -123,7 +123,7 @@ export const sessionServerToolDefinitions: ToolDefinition[] = [ { name: SessionServerToolName.ListSessions, title: 'List Sessions', - description: 'List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Use this before starting code changes or creating a session to find overlapping active work across the same project or repository, including sessions in different worktrees. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`.', + description: 'List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`.', inputSchema: listSessionsInputSchema, annotations: { readOnlyHint: true }, }, @@ -137,7 +137,7 @@ export const sessionServerToolDefinitions: ToolDefinition[] = [ { name: SessionServerToolName.CreateSession, title: 'Create Session', - description: 'Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for overlapping active work in the same project or repository, even when working directories differ. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button.', + description: 'Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button.', inputSchema: createSessionInputSchema, annotations: { readOnlyHint: false }, }, diff --git a/src/vs/platform/agentHost/test/node/toolInstructions.test.ts b/src/vs/platform/agentHost/test/node/toolInstructions.test.ts index b51ba9097489a3..377d1da0bcb4ab 100644 --- a/src/vs/platform/agentHost/test/node/toolInstructions.test.ts +++ b/src/vs/platform/agentHost/test/node/toolInstructions.test.ts @@ -40,15 +40,23 @@ suite('toolInstructions', () => { test('always renders the registered host-wide lines from the default registry', () => { assert.deepStrictEqual([ COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION, - COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION, universalToolInstructions(hasTools()), ], [ 'When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again.', - 'Before beginning code changes or creating a session, use `list_sessions` to check active sessions across the same project or repository—not only the same working directory—for overlapping activity, branches, pull requests, or changes; when overlap is plausible, use `get_session_context` and `send_message` to coordinate, and reuse or wait for existing work instead of duplicating it or editing the same area concurrently.', BASE_LINES, ]); }); + test('renders session coordination guidance from the default registry', () => { + assert.deepStrictEqual([ + COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION, + universalToolInstructions(hasTools())?.includes(SESSION_COORDINATION_LINE), + ], [ + 'Before beginning code changes or creating a session, use `list_sessions` to check active sessions across the same project or repository—not only the same working directory—for potentially overlapping work. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.', + true, + ]); + }); + test('adds the registered browser line only when openBrowserPage + an agentic browser tool are present', () => { assert.deepStrictEqual( [ From 1ef5fc00e7ff8ba20b8ef9b4e958fed257f2bb29 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 11 Aug 2026 12:33:32 -0400 Subject: [PATCH 3/7] agentHost: exclude the current session from overlap checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa352131-aed7-4160-a87f-4aa9a424de5c --- .../platform/agentHost/node/copilot/prompts/toolInstructions.ts | 2 +- src/vs/platform/agentHost/node/shared/sessionServerTools.ts | 2 +- src/vs/platform/agentHost/test/node/toolInstructions.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts b/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts index eaf5cfbef8d177..8401bdb439e09d 100644 --- a/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts +++ b/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts @@ -51,7 +51,7 @@ const largeOutputToolInstructions: ToolInstructionLine = () => COPILOT_AGENT_HOS * Agent Host session; `hasTool` only reflects client tools, so this is * intentionally unconditional. */ -export const COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION = 'Before beginning code changes or creating a session, use `list_sessions` to check active sessions across the same project or repository—not only the same working directory—for potentially overlapping work. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.'; +export const COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION = 'Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.'; const sessionCoordinationToolInstructions: ToolInstructionLine = () => COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION; /** diff --git a/src/vs/platform/agentHost/node/shared/sessionServerTools.ts b/src/vs/platform/agentHost/node/shared/sessionServerTools.ts index d9149dec3e5162..3dc29f1409f846 100644 --- a/src/vs/platform/agentHost/node/shared/sessionServerTools.ts +++ b/src/vs/platform/agentHost/node/shared/sessionServerTools.ts @@ -123,7 +123,7 @@ export const sessionServerToolDefinitions: ToolDefinition[] = [ { name: SessionServerToolName.ListSessions, title: 'List Sessions', - description: 'List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`.', + description: 'List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`.', inputSchema: listSessionsInputSchema, annotations: { readOnlyHint: true }, }, diff --git a/src/vs/platform/agentHost/test/node/toolInstructions.test.ts b/src/vs/platform/agentHost/test/node/toolInstructions.test.ts index 377d1da0bcb4ab..6e01660f8ef808 100644 --- a/src/vs/platform/agentHost/test/node/toolInstructions.test.ts +++ b/src/vs/platform/agentHost/test/node/toolInstructions.test.ts @@ -52,7 +52,7 @@ suite('toolInstructions', () => { COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION, universalToolInstructions(hasTools())?.includes(SESSION_COORDINATION_LINE), ], [ - 'Before beginning code changes or creating a session, use `list_sessions` to check active sessions across the same project or repository—not only the same working directory—for potentially overlapping work. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.', + 'Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.', true, ]); }); From 635ebb8f6a11f82da5a95b43a0ed68898778baa3 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 11 Aug 2026 12:42:56 -0400 Subject: [PATCH 4/7] test: include session coordination in prompt expectations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa352131-aed7-4160-a87f-4aa9a424de5c --- .../test/node/agentHostPromptRegistry.test.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/vs/platform/agentHost/test/node/agentHostPromptRegistry.test.ts b/src/vs/platform/agentHost/test/node/agentHostPromptRegistry.test.ts index 61ec57dd46d12c..52d39019575710 100644 --- a/src/vs/platform/agentHost/test/node/agentHostPromptRegistry.test.ts +++ b/src/vs/platform/agentHost/test/node/agentHostPromptRegistry.test.ts @@ -10,7 +10,7 @@ import type { SchemaValues } from '../../common/agentHostSchema.js'; import type { ModelSelection } from '../../common/state/protocol/state.js'; import { AgentHostPromptRegistry, agentHostPromptRegistry, type IAgentHostPromptContext } from '../../node/copilot/prompts/promptRegistry.js'; import { COPILOT_AGENT_HOST_FILE_LINK_INSTRUCTIONS, COPILOT_AGENT_HOST_WORKSPACELESS_INSTRUCTIONS, COPILOT_AGENT_HOST_SYSTEM_MESSAGE } from '../../node/copilot/prompts/systemMessage.js'; -import { COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION } from '../../node/copilot/prompts/toolInstructions.js'; +import { COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION, COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION } from '../../node/copilot/prompts/toolInstructions.js'; import { BrowserChatToolReferenceName } from '../../../browserView/common/browserChatToolReferenceNames.js'; import { CLIENT_TOOL_SEARCH_REFERENCE_NAME } from '../../common/toolSearchConstants.js'; import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; @@ -35,6 +35,8 @@ suite('AgentHostPromptRegistry', () => { ensureNoDisposablesAreLeakedInTestSuite(); const LARGE_OUTPUT_LINE = COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION; + const SESSION_COORDINATION_LINE = COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION; + const BASE_LINES = `${LARGE_OUTPUT_LINE}\n${SESSION_COORDINATION_LINE}`; const withUniversalAgentHostInstructions = (config: SystemMessageConfig): SystemMessageConfig => { const content = config.content ? `${config.content}\n\n${COPILOT_AGENT_HOST_FILE_LINK_INSTRUCTIONS}` : COPILOT_AGENT_HOST_FILE_LINK_INSTRUCTIONS; @@ -45,7 +47,7 @@ suite('AgentHostPromptRegistry', () => { ...config, sections: { ...config.sections, - tool_instructions: { action: 'append', content: `\n${LARGE_OUTPUT_LINE}` } satisfies SectionOverride, + tool_instructions: { action: 'append', content: `\n${BASE_LINES}` } satisfies SectionOverride, }, content, }; @@ -176,7 +178,7 @@ suite('AgentHostPromptRegistry', () => { mode: 'customize', sections: { ...COPILOT_AGENT_HOST_SYSTEM_MESSAGE.sections, - tool_instructions: { action: 'append', content: `\n${LARGE_OUTPUT_LINE}` }, + tool_instructions: { action: 'append', content: `\n${BASE_LINES}` }, }, content: `${COPILOT_AGENT_HOST_WORKSPACELESS_INSTRUCTIONS}\n\n${COPILOT_AGENT_HOST_FILE_LINK_INSTRUCTIONS}`, } @@ -205,7 +207,7 @@ suite('AgentHostPromptRegistry', () => { mode: 'customize', sections: { guidelines: { action: 'append', content: 'Be concise.' }, - tool_instructions: { action: 'append', content: `\n${LARGE_OUTPUT_LINE}` }, + tool_instructions: { action: 'append', content: `\n${BASE_LINES}` }, }, content: `${COPILOT_AGENT_HOST_WORKSPACELESS_INSTRUCTIONS}\n\n${COPILOT_AGENT_HOST_FILE_LINK_INSTRUCTIONS}`, } @@ -233,7 +235,7 @@ suite('AgentHostPromptRegistry', () => { const BROWSER_LINE = 'Use the browser tools (openBrowserPage, readPage, etc.) when beneficial for front-end tasks, such as when visualizing or validating UI changes.'; const browserTools = [BrowserChatToolReferenceName.OpenBrowserPage, BrowserChatToolReferenceName.ReadPage]; - test('layers the unconditional large-output instruction onto the default config', () => { + test('layers the unconditional host-wide instructions onto the default config', () => { const registry = new AgentHostPromptRegistry(); assert.deepStrictEqual(registry.resolveSystemMessageConfig({ id: 'm' }, context({}, ['anyTool'])), withUniversalAgentHostInstructions(COPILOT_AGENT_HOST_SYSTEM_MESSAGE)); }); @@ -246,7 +248,7 @@ suite('AgentHostPromptRegistry', () => { mode: 'customize', sections: { identity: COPILOT_AGENT_HOST_SYSTEM_MESSAGE.sections.identity, - tool_instructions: { action: 'append', content: `\n${LARGE_OUTPUT_LINE}\n${BROWSER_LINE}` }, + tool_instructions: { action: 'append', content: `\n${BASE_LINES}\n${BROWSER_LINE}` }, }, }) ); @@ -262,11 +264,11 @@ suite('AgentHostPromptRegistry', () => { }); assert.deepStrictEqual( registry.resolveSystemMessageConfig({ id: 'claude-x' }, context({}, browserTools)), - withUniversalAgentHostInstructions({ mode: 'customize', sections: { tool_instructions: { action: 'append', content: `\nAlways prefer ripgrep.\n${LARGE_OUTPUT_LINE}\n${BROWSER_LINE}` } } }) + withUniversalAgentHostInstructions({ mode: 'customize', sections: { tool_instructions: { action: 'append', content: `\nAlways prefer ripgrep.\n${BASE_LINES}\n${BROWSER_LINE}` } } }) ); }); - test('composes the unconditional large-output instruction with a per-model override', () => { + test('composes the unconditional host-wide instructions with a per-model override', () => { const registry = new AgentHostPromptRegistry(); registry.registerPrompt(class { static readonly familyPrefixes = ['claude']; @@ -276,7 +278,7 @@ suite('AgentHostPromptRegistry', () => { }); assert.deepStrictEqual( registry.resolveSystemMessageConfig({ id: 'claude-x' }, context({}, ['anyTool'])), - withUniversalAgentHostInstructions({ mode: 'customize', sections: { tool_instructions: { action: 'append', content: `\nAlways prefer ripgrep.\n${LARGE_OUTPUT_LINE}` } } }) + withUniversalAgentHostInstructions({ mode: 'customize', sections: { tool_instructions: { action: 'append', content: `\nAlways prefer ripgrep.\n${BASE_LINES}` } } }) ); }); }); @@ -296,7 +298,7 @@ suite('AgentHostPromptRegistry', () => { mode: 'customize', sections: { identity: COPILOT_AGENT_HOST_SYSTEM_MESSAGE.sections.identity, - tool_instructions: { action: 'append', content: `\n${LARGE_OUTPUT_LINE}\n${TOOL_SEARCH_LINE}` }, + tool_instructions: { action: 'append', content: `\n${BASE_LINES}\n${TOOL_SEARCH_LINE}` }, }, }) ); @@ -328,7 +330,7 @@ suite('AgentHostPromptRegistry', () => { }); assert.deepStrictEqual( registry.resolveSystemMessageConfig({ id: 'claude-x' }, context({}, [CLIENT_TOOL_SEARCH_REFERENCE_NAME], false, true)), - withUniversalAgentHostInstructions({ mode: 'customize', sections: { tool_instructions: { action: 'append', content: `\nAlways prefer ripgrep.\n${LARGE_OUTPUT_LINE}\n${TOOL_SEARCH_LINE}` } } }) + withUniversalAgentHostInstructions({ mode: 'customize', sections: { tool_instructions: { action: 'append', content: `\nAlways prefer ripgrep.\n${BASE_LINES}\n${TOOL_SEARCH_LINE}` } } }) ); }); }); From 91401d50e7be4552f86084339333ca53dc4e825e Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 11 Aug 2026 12:51:22 -0400 Subject: [PATCH 5/7] test: update materialized Agent Host prompt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa352131-aed7-4160-a87f-4aa9a424de5c --- src/vs/platform/agentHost/test/node/copilotAgent.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/agentHost/test/node/copilotAgent.test.ts b/src/vs/platform/agentHost/test/node/copilotAgent.test.ts index 088ba216469496..196cf646798637 100644 --- a/src/vs/platform/agentHost/test/node/copilotAgent.test.ts +++ b/src/vs/platform/agentHost/test/node/copilotAgent.test.ts @@ -51,7 +51,7 @@ import { IAgentHostOTelService } from '../../common/otel/agentHostOTelService.js import { AgentHostCompletions, IAgentHostCompletions } from '../../node/agentHostCompletions.js'; import { COPILOT_AGENT_HOST_SYSTEM_MESSAGE, CopilotAgent, CopilotSessionEntry, getCopilotManagedSettingsDiagnostics, rebaseUnder, REFRESH_DEBOUNCE_MS, resolveCopilotOtlpMetricsEndpoint } from '../../node/copilot/copilotAgent.js'; import { COPILOT_AGENT_HOST_FILE_LINK_INSTRUCTIONS } from '../../node/copilot/prompts/systemMessage.js'; -import { COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION } from '../../node/copilot/prompts/toolInstructions.js'; +import { COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION, COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION } from '../../node/copilot/prompts/toolInstructions.js'; import { NULL_CHECKPOINT_SERVICE } from '../../common/agentHostCheckpointService.js'; import { IAgentHostReviewService, NULL_REVIEW_SERVICE } from '../../common/agentHostReviewService.js'; import { getCopilotHomePath } from '../../common/copilotHome.js'; @@ -4389,7 +4389,7 @@ suite('CopilotAgent', () => { ...COPILOT_AGENT_HOST_SYSTEM_MESSAGE.sections, tool_instructions: { action: 'append', - content: `\n${COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION}`, + content: `\n${COPILOT_AGENT_HOST_LARGE_OUTPUT_TOOL_INSTRUCTION}\n${COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION}`, }, }, content: COPILOT_AGENT_HOST_FILE_LINK_INSTRUCTIONS, From 44f2b941239bc8aca42f1df99be099125e7efaae Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 11 Aug 2026 13:04:34 -0400 Subject: [PATCH 6/7] test: update Copilot Agent Host prompt snapshots Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa352131-aed7-4160-a87f-4aa9a424de5c --- ...t_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md | 7 ++++--- ...nt_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md | 7 ++++--- ...nt_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md | 7 ++++--- ...nt_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md | 7 ++++--- ...nt_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md | 7 ++++--- ...gent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md | 7 ++++--- ..._Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md | 7 ++++--- ..._Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md | 7 ++++--- ...nt_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md | 7 ++++--- ...t_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md | 7 ++++--- .../Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md | 7 ++++--- .../Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md | 7 ++++--- .../Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md | 7 ++++--- ...Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md | 7 ++++--- ...gent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md | 7 ++++--- .../Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md | 7 ++++--- ...Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md | 7 ++++--- .../Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md | 7 ++++--- ...gent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md | 7 ++++--- 19 files changed, 76 insertions(+), 57 deletions(-) diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md index 098a9057ec61cf..1bfb5e82039f3c 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md @@ -326,7 +326,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1137,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1202,7 +1203,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md index e77fdbf9cd23b9..414da954d507e4 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md @@ -326,7 +326,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1137,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1202,7 +1203,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md index 1150ed68b336e2..184211a48c7b12 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md @@ -326,7 +326,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1137,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1202,7 +1203,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md index 5d0eb57064e73a..d37ad854353510 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md @@ -326,7 +326,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1143,7 +1144,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1208,7 +1209,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md index f34ecad320fa31..b0459448b5db07 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md @@ -327,7 +327,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1147,7 +1148,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1212,7 +1213,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md index 094b7eb521ef6d..4a209687baa9f5 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md @@ -327,7 +327,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1147,7 +1148,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1212,7 +1213,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md index 9bceb77aeb0e04..4188be436d45f3 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md @@ -326,7 +326,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1137,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1202,7 +1203,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md index c9eb2b0ed545bb..d09753521641a9 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md @@ -326,7 +326,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1137,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1202,7 +1203,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md index 3b14a6e34fd3b2..b668dc7aed3858 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md @@ -326,7 +326,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1146,7 +1147,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1211,7 +1212,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md index 1f7bc769e0d7ee..b38cf01bee702d 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md @@ -345,7 +345,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1182,7 +1183,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1247,7 +1248,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md index 3ab3e2d65f21a0..bcd2b637139d12 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md @@ -293,7 +293,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1091,7 +1092,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1156,7 +1157,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md index 3340b5c444c4dd..e7cf7b4cc407a8 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md @@ -317,7 +317,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1129,7 +1130,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1194,7 +1195,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md index e49a9e68a83356..733c1662909c1b 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md @@ -317,7 +317,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1143,7 +1144,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1208,7 +1209,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md index b4524c05214ca0..1303d3253ce53b 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md @@ -293,7 +293,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1091,7 +1092,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1156,7 +1157,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md index bbb577ca1119f7..462aaf4e4e3f4a 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md @@ -293,7 +293,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1091,7 +1092,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1156,7 +1157,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md index af6a4fedd2cf75..1dff693228344b 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md @@ -317,7 +317,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1143,7 +1144,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1208,7 +1209,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md index f7f6ccda250f5a..fda913a565e99a 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md @@ -293,7 +293,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1105,7 +1106,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1170,7 +1171,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md index 89118d5032b3e7..b722ef76a9322d 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md @@ -293,7 +293,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1105,7 +1106,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1170,7 +1171,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md index a6e893293c0a7c..e04af4507c61ba 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md @@ -293,7 +293,8 @@ Best practices: * PARALLELIZE - make multiple independent search calls in ONE call. -When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1105,7 +1106,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", @@ -1170,7 +1171,7 @@ Get metadata and the open link for the session this conversation is running in. ``` #### create_session -Create a session in a workspace and start it with an initial prompt. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. +Create a session in a workspace and start it with an initial prompt. Before creating one, use `list_sessions` to check for potentially overlapping active work. The UI shows a "Session Created" confirmation with a button to open it, so reply with a single short sentence confirming the session was created and do NOT print the session URL or tell the user to click a button. ```json { "type": "object", From 0f1365f1dac427f3a377815f76b739a1df1c2999 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Wed, 12 Aug 2026 10:52:02 -0400 Subject: [PATCH 7/7] agentHost: refine overlap coordination Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa352131-aed7-4160-a87f-4aa9a424de5c --- .../agentHost/node/copilot/prompts/toolInstructions.ts | 2 +- src/vs/platform/agentHost/node/shared/sessionServerTools.ts | 2 +- ...gent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md | 4 ++-- ...Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md | 4 ++-- ...Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md | 4 ++-- ...Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md | 4 ++-- ...Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md | 4 ++-- ...ent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md | 4 ++-- ...ent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md | 4 ++-- ...Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md | 4 ++-- ...gent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md | 4 ++-- ...nt_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md | 4 ++-- .../Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md | 4 ++-- src/vs/platform/agentHost/test/node/toolInstructions.test.ts | 2 +- 22 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts b/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts index 8401bdb439e09d..8e88f35c48ba95 100644 --- a/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts +++ b/src/vs/platform/agentHost/node/copilot/prompts/toolInstructions.ts @@ -51,7 +51,7 @@ const largeOutputToolInstructions: ToolInstructionLine = () => COPILOT_AGENT_HOS * Agent Host session; `hasTool` only reflects client tools, so this is * intentionally unconditional. */ -export const COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION = 'Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.'; +export const COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION = 'Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session\'s title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.'; const sessionCoordinationToolInstructions: ToolInstructionLine = () => COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION; /** diff --git a/src/vs/platform/agentHost/node/shared/sessionServerTools.ts b/src/vs/platform/agentHost/node/shared/sessionServerTools.ts index 3dc29f1409f846..5833f5843fba88 100644 --- a/src/vs/platform/agentHost/node/shared/sessionServerTools.ts +++ b/src/vs/platform/agentHost/node/shared/sessionServerTools.ts @@ -123,7 +123,7 @@ export const sessionServerToolDefinitions: ToolDefinition[] = [ { name: SessionServerToolName.ListSessions, title: 'List Sessions', - description: 'List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`.', + description: 'List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`.', inputSchema: listSessionsInputSchema, annotations: { readOnlyHint: true }, }, diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md index 1bfb5e82039f3c..bd4924a02f0001 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md @@ -327,7 +327,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1138,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md index 414da954d507e4..39f3d59afce9c5 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md @@ -327,7 +327,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1138,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md index 184211a48c7b12..81b873cfb7f3f5 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md @@ -327,7 +327,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1138,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md index d37ad854353510..97beb23bab30a6 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md @@ -327,7 +327,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1144,7 +1144,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md index b0459448b5db07..09b32b3086676a 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-4_8.prompt.md @@ -328,7 +328,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1148,7 +1148,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md index 4a209687baa9f5..0f972239b5f225 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md @@ -328,7 +328,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1148,7 +1148,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md index 4188be436d45f3..c8d63be0f768ae 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md @@ -327,7 +327,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1138,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md index d09753521641a9..7acc564622bf4e 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md @@ -327,7 +327,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1138,7 +1138,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md index b668dc7aed3858..038824d3191c9b 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md @@ -327,7 +327,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1147,7 +1147,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md index b38cf01bee702d..65b6a092e6551f 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md @@ -346,7 +346,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1183,7 +1183,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md index bcd2b637139d12..cd6b9913634ab0 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md @@ -294,7 +294,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1092,7 +1092,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md index e7cf7b4cc407a8..f093c96a287b59 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md @@ -318,7 +318,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1130,7 +1130,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md index 733c1662909c1b..a544875c3b6137 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md @@ -318,7 +318,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1144,7 +1144,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md index 1303d3253ce53b..f4b32992f54436 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md @@ -294,7 +294,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1092,7 +1092,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md index 462aaf4e4e3f4a..22d8062f304f12 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md @@ -294,7 +294,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1092,7 +1092,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md index 1dff693228344b..82ac225473560b 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md @@ -318,7 +318,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1144,7 +1144,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md index fda913a565e99a..957353f31e9256 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md @@ -294,7 +294,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1106,7 +1106,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md index b722ef76a9322d..4489e0ec3c57f2 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md @@ -294,7 +294,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1106,7 +1106,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md index e04af4507c61ba..57100a347cc189 100644 --- a/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md +++ b/src/vs/platform/agentHost/test/node/e2e/providers/__snapshots__/Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md @@ -294,7 +294,7 @@ Best practices: When a tool reports that its output was saved to a temporary file because it was too large, ONLY use the `view` tool with a narrow `view_range` to inspect that file. NEVER read it with shell commands such as `cat`, `head`, `tail`, or `sed`, because their output may be offloaded again. -Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. +Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session's title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts. ${repository_instructions} @@ -1106,7 +1106,7 @@ View pull request or code review comments that the user has not reviewed yet. Th ``` #### list_sessions -List sessions and their compact metadata (status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; use project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. +List sessions and their compact metadata (title, status, activity, working directory, project, worktree changes, git/GitHub info, timestamps). Results include the calling session and do not mark it as current; use `get_current_session` to identify and exclude it when comparing work. Sessions from different worktrees may belong to the same repository; compare their titles and changed files as well as project and git/GitHub metadata to identify potentially overlapping work. Pass `session` to fetch a single known session by URI. By default archived sessions are omitted. Optionally filter by `status`, `workspace`, `withChanges`, `unread`, `withPullRequest`, `includeArchived`, `createdAfter`, or `createdBefore`. ```json { "type": "object", diff --git a/src/vs/platform/agentHost/test/node/toolInstructions.test.ts b/src/vs/platform/agentHost/test/node/toolInstructions.test.ts index 6e01660f8ef808..1d30bc61df2f67 100644 --- a/src/vs/platform/agentHost/test/node/toolInstructions.test.ts +++ b/src/vs/platform/agentHost/test/node/toolInstructions.test.ts @@ -52,7 +52,7 @@ suite('toolInstructions', () => { COPILOT_AGENT_HOST_SESSION_COORDINATION_TOOL_INSTRUCTION, universalToolInstructions(hasTools())?.includes(SESSION_COORDINATION_LINE), ], [ - 'Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—for potentially overlapping work; exclude the current session URI from overlap candidates. If another session may overlap based on its activity, branch, pull request, or changes, inspect it with `get_session_context` and use `send_message` to coordinate work between sessions. Prefer dividing or sequencing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.', + 'Before beginning code changes or creating a session, use `get_current_session` to identify the current session, then use `list_sessions` to check other active sessions across the same project or repository—not only the same working directory—and exclude the current session URI. Compare each session\'s title, activity, branch, pull request, and changed files to identify plausible overlap. For plausible overlaps, use `get_session_context` to confirm the scope and `send_message` to agree on ownership or sequencing before editing shared files; otherwise continue independently without waiting. Prefer dividing work to avoid duplicate effort, conflicting edits, and unnecessary merge conflicts.', true, ]); });