From a3c7e9e094f758ee112a8e6ff99048d6a2cd3c00 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 5 Nov 2025 10:21:24 -0800 Subject: [PATCH 01/25] Upstream model generated file/line Linkification --- .../linkify/common/filePathLinkifier.ts | 9 +- .../linkify/common/linkifyService.ts | 3 + .../linkify/common/modelFilePathLinkifier.ts | 96 +++++++++++++++++++ .../test/node/modelFilePathLinkifier.spec.ts | 39 ++++++++ .../prompts/node/agent/anthropicPrompts.tsx | 2 + .../agent/fileLinkificationInstructions.tsx | 37 +++++++ .../prompts/node/agent/geminiPrompts.tsx | 2 + .../prompts/node/agent/openAIPrompts.tsx | 7 ++ .../prompts/node/agent/vscModelPrompts.tsx | 2 + .../prompts/node/agent/xAIPrompts.tsx | 2 + 10 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 src/extension/linkify/common/modelFilePathLinkifier.ts create mode 100644 src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts create mode 100644 src/extension/prompts/node/agent/fileLinkificationInstructions.tsx diff --git a/src/extension/linkify/common/filePathLinkifier.ts b/src/extension/linkify/common/filePathLinkifier.ts index 1571f2c53e..97963f4e64 100644 --- a/src/extension/linkify/common/filePathLinkifier.ts +++ b/src/extension/linkify/common/filePathLinkifier.ts @@ -79,7 +79,14 @@ export class FilePathLinkifier implements IContributedLinkifier { pathText ??= match.groups?.['inlineCodePath'] ?? match.groups?.['plainTextPath'] ?? ''; parts.push(this.resolvePathText(pathText, context) - .then(uri => uri ? new LinkifyLocationAnchor(uri) : matched)); + .then(uri => { + if (uri) { + // TEMP DEBUG: log when legacy linkifier creates a link (remove before release) + try { console.log('[linkify][legacy] linkified', { path: uri.toString(), requestId: context.requestId }); } catch { /* noop */ } + return new LinkifyLocationAnchor(uri); + } + return matched; + })); endLastMatch = match.index + matched.length; } diff --git a/src/extension/linkify/common/linkifyService.ts b/src/extension/linkify/common/linkifyService.ts index dfaa18bc3f..55410ac642 100644 --- a/src/extension/linkify/common/linkifyService.ts +++ b/src/extension/linkify/common/linkifyService.ts @@ -13,6 +13,7 @@ import { PromptReference } from '../../prompt/common/conversation'; import { FilePathLinkifier } from './filePathLinkifier'; import { LinkifiedText } from './linkifiedText'; import { Linkifier } from './linkifier'; +import { ModelFilePathLinkifier } from './modelFilePathLinkifier'; /** * A stateful linkifier. @@ -86,6 +87,8 @@ export class LinkifyService implements ILinkifyService { @IWorkspaceService workspaceService: IWorkspaceService, @IEnvService private readonly envService: IEnvService, ) { + // Model-generated links first (anchors), fallback legacy path linkifier afterwards + this.registerGlobalLinkifier({ create: () => new ModelFilePathLinkifier(fileSystem, workspaceService) }); this.registerGlobalLinkifier({ create: () => new FilePathLinkifier(fileSystem, workspaceService) }); } diff --git a/src/extension/linkify/common/modelFilePathLinkifier.ts b/src/extension/linkify/common/modelFilePathLinkifier.ts new file mode 100644 index 0000000000..160c0c19e4 --- /dev/null +++ b/src/extension/linkify/common/modelFilePathLinkifier.ts @@ -0,0 +1,96 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IFileSystemService } from '../../../platform/filesystem/common/fileSystemService'; +import { FileType } from '../../../platform/filesystem/common/fileTypes'; +import { IWorkspaceService } from '../../../platform/workspace/common/workspaceService'; +import { CancellationToken } from '../../../util/vs/base/common/cancellation'; +import { Location, Position, Range, Uri } from '../../../vscodeTypes'; +import { coalesceParts, LinkifiedPart, LinkifiedText, LinkifyLocationAnchor } from './linkifiedText'; +import { IContributedLinkifier, LinkifierContext } from './linkifyService'; + +// Matches markdown links where the text is a path and optional #L anchor is present +// Example: [src/file.ts](src/file.ts#L10-12) or [src/file.ts](src/file.ts) +const modelLinkRe = /\[(?[^\]\n]+)\]\((?[^\s)]+)\)/gu; + +export class ModelFilePathLinkifier implements IContributedLinkifier { + constructor( + @IFileSystemService private readonly fileSystem: IFileSystemService, + @IWorkspaceService private readonly workspaceService: IWorkspaceService, + ) { } + + async linkify(text: string, context: LinkifierContext, token: CancellationToken): Promise { + let lastIndex = 0; + const out: Array> = []; + + for (const match of text.matchAll(modelLinkRe)) { + const prefix = text.slice(lastIndex, match.index); + if (prefix) { + out.push(prefix); + } + lastIndex = match.index + match[0].length; + + const rawText = match.groups?.['text'] ?? ''; + const rawTarget = match.groups?.['target'] ?? ''; + + const hashIndex = rawTarget.indexOf('#'); + const baseTarget = hashIndex === -1 ? rawTarget : rawTarget.slice(0, hashIndex); + const anchor = hashIndex === -1 ? undefined : rawTarget.slice(hashIndex + 1); + + let decodedBase = baseTarget; + try { decodedBase = decodeURIComponent(baseTarget); } catch { } + + if (decodedBase !== rawText) { + out.push(match[0]); + continue; + } + + const workspaceFolders = this.workspaceService.getWorkspaceFolders(); + let resolved: Uri | undefined; + for (const folder of workspaceFolders) { + const candidate = Uri.joinPath(folder, decodedBase); + const stat = await this.tryStat(candidate); + if (stat) { resolved = stat; break; } + } + if (!resolved) { + out.push(match[0]); + continue; + } + + if (anchor && /^L\d+(?:-\d+)?$/.test(anchor)) { + const m = /^L(\d+)(?:-(\d+))?$/.exec(anchor); + if (m) { + const start = parseInt(m[1], 10) - 1; + const end = (m[2] ? parseInt(m[2], 10) : parseInt(m[1], 10)) - 1; + if (start >= 0 && end >= start) { + try { console.log('[linkify][model] linkified range', { path: decodedBase, anchor, requestId: context.requestId }); } catch { } + out.push(new LinkifyLocationAnchor(new Location(resolved, new Range(new Position(start, 0), new Position(end, 0))))); + continue; + } + } + } + try { console.log('[linkify][model] linkified file', { path: decodedBase, requestId: context.requestId }); } catch { } + out.push(new LinkifyLocationAnchor(resolved)); + } + + const suffix = text.slice(lastIndex); + if (suffix) { out.push(suffix); } + + if (!out.length) { + return undefined; + } + return { parts: coalesceParts(await Promise.all(out)) }; + } + + private async tryStat(uri: Uri): Promise { + try { + const stat = await this.fileSystem.stat(uri); + if (stat.type === FileType.Directory) { + return uri.path.endsWith('/') ? uri : uri.with({ path: uri.path + '/' }); + } + return uri; + } catch { return undefined; } + } +} diff --git a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts new file mode 100644 index 0000000000..bb149d58e5 --- /dev/null +++ b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { suite, test } from 'vitest'; +import { Location, Position, Range } from '../../../../vscodeTypes'; +import { LinkifyLocationAnchor } from '../../common/linkifiedText'; +import { assertPartsEqual, createTestLinkifierService, linkify, workspaceFile } from './util'; + +suite('Model File Path Linkifier', () => { + test('Should linkify model generated file references with line range', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[src/file.ts](src/file.ts#L10-12)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(9, 0), new Position(11, 0)))); + assertPartsEqual([anchor], [expected]); + }); + + test('Should linkify single line anchors', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[src/file.ts](src/file.ts#L5)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(4, 0), new Position(4, 0)))); + assertPartsEqual([anchor], [expected]); + }); + + test('Should fallback when text does not match base path', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[other](src/file.ts#L2-3)'); + assertPartsEqual(result.parts, ['[other](src/file.ts#L2-3)']); + }); + + test('Should fallback for invalid anchor syntax', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[src/file.ts](src/file.ts#Lines10-12)'); + assertPartsEqual(result.parts, ['[src/file.ts](src/file.ts#Lines10-12)']); + }); +}); diff --git a/src/extension/prompts/node/agent/anthropicPrompts.tsx b/src/extension/prompts/node/agent/anthropicPrompts.tsx index 2104f5f313..d7ba64944f 100644 --- a/src/extension/prompts/node/agent/anthropicPrompts.tsx +++ b/src/extension/prompts/node/agent/anthropicPrompts.tsx @@ -13,6 +13,7 @@ import { EXISTING_CODE_MARKER } from '../panel/codeBlockFormattingRules'; import { MathIntegrationRules } from '../panel/editorIntegrationRules'; import { KeepGoingReminder } from './agentPrompt'; import { CodesearchModeInstructions, DefaultAgentPromptProps, detectToolCapabilities, GenericEditingTips, McpToolInstructions, NotebookInstructions } from './defaultAgentInstructions'; +import { FileLinkificationInstructions } from './fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from './promptRegistry'; class DefaultAnthropicAgentPrompt extends PromptElement { @@ -99,6 +100,7 @@ class DefaultAnthropicAgentPrompt extends PromptElement Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ The class `Person` is in `src/models/person.ts`.
The function `calculateTotal` is defined in `lib/utils/math.ts`.
diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx new file mode 100644 index 0000000000..8474d6defa --- /dev/null +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { PromptElement } from '@vscode/prompt-tsx'; +import { Tag } from '../base/tag'; + +export class FileLinkificationInstructions extends PromptElement<{}> { + render() { + return + ALWAYS convert any filename or path mention into a markdown link using one of these canonical forms (1-based line numbers):
+ `[path/to/file.ts](path/to/file.ts)` whole file
+ `[path/to/file.ts](path/to/file.ts#L10)` single line
+ `[path/to/file.ts](path/to/file.ts#L10-12)` inclusive line range
+ Transformation examples (apply this rewriting proactively):
+ Bad: `The main function is in exampleScript.ts at line 25.`
+ Good: `The main function is in [exampleScript.ts](exampleScript.ts#L25).`
+ Bad: `See src/utils/math.ts lines 40-44 for the loop.`
+ Good: `See [src/utils/math.ts](src/utils/math.ts#L40-44) for the loop.`
+ Bad: `Config lives in docs/My File.md`
+ Good: `Config lives in [docs/My File.md](docs/My%20File.md)`
+ Rules (enforced):
+ - Bracket text MUST exactly equal the file path portion before any `#` anchor (omit line hash from text).
+ - Use workspace-relative POSIX paths (forward slashes). Do NOT invent paths; only cite existing ones or ones already shown in context. If uncertain about directory, prefer reading context before guessing.
+ - If you state a line or range in prose, IMMEDIATELY integrate it into the link anchor instead of leaving it separate.
+ - Only add an anchor when certain; if unsure about exact lines, emit the whole-file link (no anchor) and optionally gather more context before citing lines.
+ - For multiple disjoint ranges from one file, emit separate links (one per range).
+ - Do NOT wrap these links themselves in backticks; they are plain markdown links (the code fences/backticks rule applies only to ordinary inline path references, not these links).
+ - Percent-encode spaces ONLY in the target; bracket text remains unencoded (e.g. `[docs/My File.md](docs/My%20File.md)`).
+ - Prefer citing a range (`#L10-12`) if you reference ≥2 consecutive lines; otherwise single line anchor (`#L10`).
+ - Never leave a bare filename like `exampleScript.ts` in prose without converting it to a link unless you are explicitly quoting user input you will transform next.
+ Self-correction: If you output a filename without the required link format, immediately correct yourself in the very next message by restating it with the proper link.
+ Goal: Maximize model-emitted links so fallback legacy linkifier rarely triggers.
+
; + } +} diff --git a/src/extension/prompts/node/agent/geminiPrompts.tsx b/src/extension/prompts/node/agent/geminiPrompts.tsx index 94fb4d366e..deceaa0744 100644 --- a/src/extension/prompts/node/agent/geminiPrompts.tsx +++ b/src/extension/prompts/node/agent/geminiPrompts.tsx @@ -13,6 +13,7 @@ import { EXISTING_CODE_MARKER } from '../panel/codeBlockFormattingRules'; import { MathIntegrationRules } from '../panel/editorIntegrationRules'; import { KeepGoingReminder } from './agentPrompt'; import { CodesearchModeInstructions, DefaultAgentPromptProps, detectToolCapabilities, GenericEditingTips, McpToolInstructions, NotebookInstructions } from './defaultAgentInstructions'; +import { FileLinkificationInstructions } from './fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from './promptRegistry'; /** @@ -102,6 +103,7 @@ export class DefaultGeminiAgentPrompt extends PromptElement Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ The class `Person` is in `src/models/person.ts`.
The function `calculateTotal` is defined in `lib/utils/math.ts`.
diff --git a/src/extension/prompts/node/agent/openAIPrompts.tsx b/src/extension/prompts/node/agent/openAIPrompts.tsx index 619d1bcc2e..99de773ff9 100644 --- a/src/extension/prompts/node/agent/openAIPrompts.tsx +++ b/src/extension/prompts/node/agent/openAIPrompts.tsx @@ -14,6 +14,7 @@ import { EXISTING_CODE_MARKER } from '../panel/codeBlockFormattingRules'; import { MathIntegrationRules } from '../panel/editorIntegrationRules'; import { KeepGoingReminder } from './agentPrompt'; import { ApplyPatchInstructions, CodesearchModeInstructions, DefaultAgentPromptProps, detectToolCapabilities, GenericEditingTips, McpToolInstructions, NotebookInstructions } from './defaultAgentInstructions'; +import { FileLinkificationInstructions } from './fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from './promptRegistry'; export class DefaultOpenAIAgentPrompt extends PromptElement { @@ -101,6 +102,7 @@ export class DefaultOpenAIAgentPrompt extends PromptElement Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ The class `Person` is in `src/models/person.ts`.
The function `calculateTotal` is defined in `lib/utils/math.ts`.
@@ -313,6 +315,7 @@ class DefaultGpt5AgentPrompt extends PromptElement { For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting.

When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ The class `Person` is in `src/models/person.ts`. @@ -394,10 +397,14 @@ class CodexStyleGPT5CodexPrompt extends PromptElement { * Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.
* Do not use URIs like file://, vscode://, or https://.
* Examples: src/app.ts, C:\repo\project\main.rs
+
+ ; } } +// FileLinkificationInstructions extracted to shared fileLinkificationInstructions.tsx + class OpenAIPromptResolver implements IAgentPrompt { static readonly familyPrefixes = ['gpt', 'o4-mini', 'o3-mini', 'OpenAI']; diff --git a/src/extension/prompts/node/agent/vscModelPrompts.tsx b/src/extension/prompts/node/agent/vscModelPrompts.tsx index 1fa14a7fc9..3afa660338 100644 --- a/src/extension/prompts/node/agent/vscModelPrompts.tsx +++ b/src/extension/prompts/node/agent/vscModelPrompts.tsx @@ -12,6 +12,7 @@ import { ResponseTranslationRules } from '../base/responseTranslationRules'; import { Tag } from '../base/tag'; import { MathIntegrationRules } from '../panel/editorIntegrationRules'; import { ApplyPatchInstructions, DefaultAgentPromptProps, detectToolCapabilities, GenericEditingTips, McpToolInstructions, NotebookInstructions } from './defaultAgentInstructions'; +import { FileLinkificationInstructions } from './fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from './promptRegistry'; class VSCModelPromptA extends PromptElement { @@ -330,6 +331,7 @@ class VSCModelPromptB extends PromptElement { Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ {tools[ToolName.CoreRunInTerminal] ? <> When commands are required, run them yourself in a terminal and summarize the results. Do not print runnable commands unless the user asks. If you must show them for documentation, make them clearly optional and keep one command per line.
: <> diff --git a/src/extension/prompts/node/agent/xAIPrompts.tsx b/src/extension/prompts/node/agent/xAIPrompts.tsx index d82f1d34ca..cf5d140853 100644 --- a/src/extension/prompts/node/agent/xAIPrompts.tsx +++ b/src/extension/prompts/node/agent/xAIPrompts.tsx @@ -13,6 +13,7 @@ import { EXISTING_CODE_MARKER } from '../panel/codeBlockFormattingRules'; import { MathIntegrationRules } from '../panel/editorIntegrationRules'; import { KeepGoingReminder } from './agentPrompt'; import { CodesearchModeInstructions, DefaultAgentPromptProps, detectToolCapabilities, GenericEditingTips, McpToolInstructions, NotebookInstructions } from './defaultAgentInstructions'; +import { FileLinkificationInstructions } from './fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from './promptRegistry'; class DefaultGrokCodeFastAgentPrompt extends PromptElement { @@ -106,6 +107,7 @@ class DefaultGrokCodeFastAgentPrompt extends PromptElement Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ The class `Person` is in `src/models/person.ts`.
The function `calculateTotal` is defined in `lib/utils/math.ts`.
From cd34558312b6f0baa554c665f5540df5f0324ca2 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 5 Nov 2025 10:36:09 -0800 Subject: [PATCH 02/25] CP feedback updated --- .../prompts/node/agent/fileLinkificationInstructions.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx index 8474d6defa..93581f7245 100644 --- a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -22,6 +22,8 @@ export class FileLinkificationInstructions extends PromptElement<{}> { Good: `Config lives in [docs/My File.md](docs/My%20File.md)`
Rules (enforced):
- Bracket text MUST exactly equal the file path portion before any `#` anchor (omit line hash from text).
+ Wrong: `[src/file.ts#L10](src/file.ts#L10)` (anchor included inside brackets)
+ Correct: `[src/file.ts](src/file.ts#L10)` (anchor only in link target)
- Use workspace-relative POSIX paths (forward slashes). Do NOT invent paths; only cite existing ones or ones already shown in context. If uncertain about directory, prefer reading context before guessing.
- If you state a line or range in prose, IMMEDIATELY integrate it into the link anchor instead of leaving it separate.
- Only add an anchor when certain; if unsure about exact lines, emit the whole-file link (no anchor) and optionally gather more context before citing lines.
@@ -30,6 +32,7 @@ export class FileLinkificationInstructions extends PromptElement<{}> { - Percent-encode spaces ONLY in the target; bracket text remains unencoded (e.g. `[docs/My File.md](docs/My%20File.md)`).
- Prefer citing a range (`#L10-12`) if you reference ≥2 consecutive lines; otherwise single line anchor (`#L10`).
- Never leave a bare filename like `exampleScript.ts` in prose without converting it to a link unless you are explicitly quoting user input you will transform next.
+ - Backticks vs links: Backtick wrapping applies ONLY to ordinary inline path mentions you are not converting into links. When producing a markdown link (`[path](path[#Lx[-y]])`), do NOT wrap the link itself in backticks; the link replaces the backticked form.
Self-correction: If you output a filename without the required link format, immediately correct yourself in the very next message by restating it with the proper link.
Goal: Maximize model-emitted links so fallback legacy linkifier rarely triggers.
; From a25735f4f9da82ff5f299eaa8eccffdd44f2874a Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 5 Nov 2025 15:07:50 -0800 Subject: [PATCH 03/25] simplify prompt --- .../agent/fileLinkificationInstructions.tsx | 48 +++++++++---------- .../prompts/node/agent/openAIPrompts.tsx | 5 +- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx index 93581f7245..f16660fc7c 100644 --- a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -9,32 +9,28 @@ import { Tag } from '../base/tag'; export class FileLinkificationInstructions extends PromptElement<{}> { render() { return - ALWAYS convert any filename or path mention into a markdown link using one of these canonical forms (1-based line numbers):
- `[path/to/file.ts](path/to/file.ts)` whole file
- `[path/to/file.ts](path/to/file.ts#L10)` single line
- `[path/to/file.ts](path/to/file.ts#L10-12)` inclusive line range
- Transformation examples (apply this rewriting proactively):
- Bad: `The main function is in exampleScript.ts at line 25.`
- Good: `The main function is in [exampleScript.ts](exampleScript.ts#L25).`
- Bad: `See src/utils/math.ts lines 40-44 for the loop.`
- Good: `See [src/utils/math.ts](src/utils/math.ts#L40-44) for the loop.`
- Bad: `Config lives in docs/My File.md`
- Good: `Config lives in [docs/My File.md](docs/My%20File.md)`
- Rules (enforced):
- - Bracket text MUST exactly equal the file path portion before any `#` anchor (omit line hash from text).
- Wrong: `[src/file.ts#L10](src/file.ts#L10)` (anchor included inside brackets)
- Correct: `[src/file.ts](src/file.ts#L10)` (anchor only in link target)
- - Use workspace-relative POSIX paths (forward slashes). Do NOT invent paths; only cite existing ones or ones already shown in context. If uncertain about directory, prefer reading context before guessing.
- - If you state a line or range in prose, IMMEDIATELY integrate it into the link anchor instead of leaving it separate.
- - Only add an anchor when certain; if unsure about exact lines, emit the whole-file link (no anchor) and optionally gather more context before citing lines.
- - For multiple disjoint ranges from one file, emit separate links (one per range).
- - Do NOT wrap these links themselves in backticks; they are plain markdown links (the code fences/backticks rule applies only to ordinary inline path references, not these links).
- - Percent-encode spaces ONLY in the target; bracket text remains unencoded (e.g. `[docs/My File.md](docs/My%20File.md)`).
- - Prefer citing a range (`#L10-12`) if you reference ≥2 consecutive lines; otherwise single line anchor (`#L10`).
- - Never leave a bare filename like `exampleScript.ts` in prose without converting it to a link unless you are explicitly quoting user input you will transform next.
- - Backticks vs links: Backtick wrapping applies ONLY to ordinary inline path mentions you are not converting into links. When producing a markdown link (`[path](path[#Lx[-y]])`), do NOT wrap the link itself in backticks; the link replaces the backticked form.
- Self-correction: If you output a filename without the required link format, immediately correct yourself in the very next message by restating it with the proper link.
- Goal: Maximize model-emitted links so fallback legacy linkifier rarely triggers.
+ ALWAYS convert file paths to markdown links. Use workspace-relative POSIX paths with 1-based line numbers:
+ `[path/to/file.ts](path/to/file.ts)` - whole file
+ `[path/to/file.ts](path/to/file.ts#L10)` - single line
+ `[path/to/file.ts](path/to/file.ts#L10-12)` - line range (inclusive)
+ Examples:
+ ❌ `The function is in exampleScript.ts at line 25.`
+ ✓ `The function is in [exampleScript.ts](exampleScript.ts#L25).`
+ ❌ `See src/utils/math.ts lines 40-44`
+ ✓ `See [src/utils/math.ts](src/utils/math.ts#L40-44)`
+ ❌ `Config in docs/My File.md`
+ ✓ `Config in [docs/My File.md](docs/My%20File.md)`
+ Critical rules:
+ - Bracket text = file path only (no `#L...`). Wrong: `[file.ts#L10](...)`; Correct: `[file.ts](...#L10)`
+ - Only cite existing paths from context; don't invent paths
+ - Immediately fold any cited line(s)/range into the anchor (not separate prose)
+ - Use ranges (`#L10-12`) for 2+ consecutive lines; single line form otherwise
+ - Percent-encode spaces in link target only: `[My File.md](My%20File.md)` (leave bracket text unencoded)
+ - Backticks only for plain non-linked paths; never wrap the markdown link itself in backticks
+ - No bare filenames left unlinked (exception: verbatim user input you will transform next)
+ - If uncertain about exact lines, link whole file (no anchor) and gather more context before adding anchors
+ - Missed conversion? Correct it in your very next message
+ Goal: High link coverage; fallback rarely triggers.
; } } diff --git a/src/extension/prompts/node/agent/openAIPrompts.tsx b/src/extension/prompts/node/agent/openAIPrompts.tsx index 99de773ff9..35a6a12d51 100644 --- a/src/extension/prompts/node/agent/openAIPrompts.tsx +++ b/src/extension/prompts/node/agent/openAIPrompts.tsx @@ -314,10 +314,11 @@ class DefaultGpt5AgentPrompt extends PromptElement {
For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting.

- When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ When referring to a filename or symbol in the user's workspace, wrap it in backticks.
- The class `Person` is in `src/models/person.ts`. + The class `Person` is in `src/models/person.ts`.
+ Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42).
From 490a4861cc113e4c81db043b5711a5f3131bcad8 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Tue, 11 Nov 2025 22:05:30 -0800 Subject: [PATCH 04/25] Optimization and consolidation --- .../linkify/common/filePathLinkifier.ts | 46 ++-- .../linkify/common/modelFilePathLinkifier.ts | 225 ++++++++++++++---- .../test/node/modelFilePathLinkifier.spec.ts | 21 +- src/extension/linkify/test/node/util.ts | 15 +- .../node/chatParticipantRequestHandler.ts | 6 +- .../prompts/node/agent/anthropicPrompts.tsx | 3 +- .../agent/fileLinkificationInstructions.tsx | 27 +-- .../prompts/node/agent/openAIPrompts.tsx | 6 - 8 files changed, 247 insertions(+), 102 deletions(-) diff --git a/src/extension/linkify/common/filePathLinkifier.ts b/src/extension/linkify/common/filePathLinkifier.ts index 97963f4e64..1f899c5db0 100644 --- a/src/extension/linkify/common/filePathLinkifier.ts +++ b/src/extension/linkify/common/filePathLinkifier.ts @@ -20,9 +20,6 @@ import { IContributedLinkifier, LinkifierContext } from './linkifyService'; // Create a single regex which runs different regexp parts in a big `|` expression. const pathMatchRe = new RegExp( [ - // [path/to/file.md](path/to/file.md) or [`path/to/file.md`](path/to/file.md) - /\[(`?)(?[^`\]\)\n]+)\1\]\((?[^`\s]+)\)/.source, - // Inline code paths /(?[^`\s]+)`(?!\])/.source, @@ -35,8 +32,8 @@ const pathMatchRe = new RegExp( * Linkifies file paths in responses. This includes: * * ``` - * [file.md](file.md) * `file.md` + * foo.ts * ``` */ export class FilePathLinkifier implements IContributedLinkifier { @@ -58,31 +55,11 @@ export class FilePathLinkifier implements IContributedLinkifier { const matched = match[0]; - let pathText: string | undefined; - - // For a md style link, require that the text and path are the same - // However we have to have extra logic since the path may be encoded: `[file name](file%20name)` - if (match.groups?.['mdLinkPath']) { - let mdLinkPath = match.groups?.['mdLinkPath']; - try { - mdLinkPath = decodeURIComponent(mdLinkPath); - } catch { - // noop - } - - if (mdLinkPath !== match.groups?.['mdLinkText']) { - pathText = undefined; - } else { - pathText = mdLinkPath; - } - } - pathText ??= match.groups?.['inlineCodePath'] ?? match.groups?.['plainTextPath'] ?? ''; + const pathText = match.groups?.['inlineCodePath'] ?? match.groups?.['plainTextPath'] ?? ''; parts.push(this.resolvePathText(pathText, context) .then(uri => { if (uri) { - // TEMP DEBUG: log when legacy linkifier creates a link (remove before release) - try { console.log('[linkify][legacy] linkified', { path: uri.toString(), requestId: context.requestId }); } catch { /* noop */ } return new LinkifyLocationAnchor(uri); } return matched; @@ -100,6 +77,7 @@ export class FilePathLinkifier implements IContributedLinkifier { } private async resolvePathText(pathText: string, context: LinkifierContext): Promise { + const includeDirectorySlash = pathText.endsWith('/'); const workspaceFolders = this.workspaceService.getWorkspaceFolders(); // Don't linkify very short paths such as '/' or special paths such as '../' @@ -109,7 +87,7 @@ export class FilePathLinkifier implements IContributedLinkifier { if (pathText.startsWith('/') || (isWindows && (pathText.startsWith('\\') || hasDriveLetter(pathText)))) { try { - const uri = await this.statAndNormalizeUri(Uri.file(pathText.startsWith('/') ? path.posix.normalize(pathText) : path.normalize(pathText))); + const uri = await this.statAndNormalizeUri(Uri.file(pathText.startsWith('/') ? path.posix.normalize(pathText) : path.normalize(pathText)), includeDirectorySlash); if (uri) { if (path.posix.normalize(uri.path) === '/') { return undefined; @@ -128,7 +106,7 @@ export class FilePathLinkifier implements IContributedLinkifier { try { const uri = Uri.parse(pathText); if (uri.scheme === Schemas.file || workspaceFolders.some(folder => folder.scheme === uri.scheme && folder.authority === uri.authority)) { - const statedUri = await this.statAndNormalizeUri(uri); + const statedUri = await this.statAndNormalizeUri(uri, includeDirectorySlash); if (statedUri) { return statedUri; } @@ -140,7 +118,7 @@ export class FilePathLinkifier implements IContributedLinkifier { } for (const workspaceFolder of workspaceFolders) { - const uri = await this.statAndNormalizeUri(Uri.joinPath(workspaceFolder, pathText)); + const uri = await this.statAndNormalizeUri(Uri.joinPath(workspaceFolder, pathText), includeDirectorySlash); if (uri) { return uri; } @@ -161,12 +139,18 @@ export class FilePathLinkifier implements IContributedLinkifier { return refUri; } - private async statAndNormalizeUri(uri: Uri): Promise { + private async statAndNormalizeUri(uri: Uri, includeDirectorySlash: boolean): Promise { try { const stat = await this.fileSystem.stat(uri); if (stat.type === FileType.Directory) { - // Ensure all dir paths have a trailing slash for icon rendering - return uri.path.endsWith('/') ? uri : uri.with({ path: `${uri.path}/` }); + if (includeDirectorySlash) { + return uri.path.endsWith('/') ? uri : uri.with({ path: `${uri.path}/` }); + } + + if (uri.path.endsWith('/') && uri.path !== '/') { + return uri.with({ path: uri.path.slice(0, -1) }); + } + return uri; } return uri; diff --git a/src/extension/linkify/common/modelFilePathLinkifier.ts b/src/extension/linkify/common/modelFilePathLinkifier.ts index 160c0c19e4..6c54b92e3e 100644 --- a/src/extension/linkify/common/modelFilePathLinkifier.ts +++ b/src/extension/linkify/common/modelFilePathLinkifier.ts @@ -5,7 +5,7 @@ import { IFileSystemService } from '../../../platform/filesystem/common/fileSystemService'; import { FileType } from '../../../platform/filesystem/common/fileTypes'; -import { IWorkspaceService } from '../../../platform/workspace/common/workspaceService'; +import { getWorkspaceFileDisplayPath, IWorkspaceService } from '../../../platform/workspace/common/workspaceService'; import { CancellationToken } from '../../../util/vs/base/common/cancellation'; import { Location, Position, Range, Uri } from '../../../vscodeTypes'; import { coalesceParts, LinkifiedPart, LinkifiedText, LinkifyLocationAnchor } from './linkifiedText'; @@ -23,74 +23,217 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { async linkify(text: string, context: LinkifierContext, token: CancellationToken): Promise { let lastIndex = 0; - const out: Array> = []; + const parts: Array> = []; for (const match of text.matchAll(modelLinkRe)) { + const original = match[0]; const prefix = text.slice(lastIndex, match.index); if (prefix) { - out.push(prefix); + parts.push(prefix); } - lastIndex = match.index + match[0].length; + lastIndex = match.index + original.length; - const rawText = match.groups?.['text'] ?? ''; - const rawTarget = match.groups?.['target'] ?? ''; - - const hashIndex = rawTarget.indexOf('#'); - const baseTarget = hashIndex === -1 ? rawTarget : rawTarget.slice(0, hashIndex); - const anchor = hashIndex === -1 ? undefined : rawTarget.slice(hashIndex + 1); - - let decodedBase = baseTarget; - try { decodedBase = decodeURIComponent(baseTarget); } catch { } - - if (decodedBase !== rawText) { - out.push(match[0]); + const parsed = this.parseModelLinkMatch(match); + if (!parsed) { + parts.push(original); continue; } const workspaceFolders = this.workspaceService.getWorkspaceFolders(); - let resolved: Uri | undefined; - for (const folder of workspaceFolders) { - const candidate = Uri.joinPath(folder, decodedBase); - const stat = await this.tryStat(candidate); - if (stat) { resolved = stat; break; } + if (!this.canLinkify(parsed, workspaceFolders)) { + parts.push(original); + continue; } + + const resolved = await this.resolveTarget(parsed.targetPath, workspaceFolders, parsed.preserveDirectorySlash); if (!resolved) { - out.push(match[0]); + parts.push(original); continue; } - if (anchor && /^L\d+(?:-\d+)?$/.test(anchor)) { - const m = /^L(\d+)(?:-(\d+))?$/.exec(anchor); - if (m) { - const start = parseInt(m[1], 10) - 1; - const end = (m[2] ? parseInt(m[2], 10) : parseInt(m[1], 10)) - 1; - if (start >= 0 && end >= start) { - try { console.log('[linkify][model] linkified range', { path: decodedBase, anchor, requestId: context.requestId }); } catch { } - out.push(new LinkifyLocationAnchor(new Location(resolved, new Range(new Position(start, 0), new Position(end, 0))))); - continue; - } - } + const basePath = getWorkspaceFileDisplayPath(this.workspaceService, resolved); + const anchorRange = this.parseAnchor(parsed.anchor); + if (parsed.anchor && !anchorRange) { + parts.push(original); + continue; + } + + if (anchorRange) { + const { range, startLine, endLine } = anchorRange; + const displayPath = endLine && startLine !== endLine + ? `${basePath}#${startLine}-${endLine}` + : `${basePath}#${startLine}`; + parts.push(new LinkifyLocationAnchor(new Location(resolved, range), displayPath)); + continue; } - try { console.log('[linkify][model] linkified file', { path: decodedBase, requestId: context.requestId }); } catch { } - out.push(new LinkifyLocationAnchor(resolved)); + + parts.push(new LinkifyLocationAnchor(resolved, basePath)); } const suffix = text.slice(lastIndex); - if (suffix) { out.push(suffix); } + if (suffix) { + parts.push(suffix); + } + + if (!parts.length) { + return undefined; + } + + return { parts: coalesceParts(await Promise.all(parts)) }; + } + + private parseModelLinkMatch(match: RegExpMatchArray): { readonly text: string; readonly targetPath: string; readonly anchor: string | undefined; readonly preserveDirectorySlash: boolean } | undefined { + const rawText = match.groups?.['text']; + const rawTarget = match.groups?.['target']; + if (!rawText || !rawTarget) { + return undefined; + } + + const hashIndex = rawTarget.indexOf('#'); + const baseTarget = hashIndex === -1 ? rawTarget : rawTarget.slice(0, hashIndex); + const anchor = hashIndex === -1 ? undefined : rawTarget.slice(hashIndex + 1); + + let decodedBase = baseTarget; + try { + decodedBase = decodeURIComponent(baseTarget); + } catch { + // noop + } + + const preserveDirectorySlash = decodedBase.endsWith('/') && decodedBase.length > 1; + const normalizedTarget = this.normalizeSlashes(decodedBase); + const normalizedText = this.normalizeLinkText(rawText); + return { text: normalizedText, targetPath: normalizedTarget, anchor, preserveDirectorySlash }; + } + + private normalizeSlashes(value: string): string { + // Collapse one or more backslashes into a single forward slash so mixed separators normalize consistently. + return value.replace(/\\+/g, '/'); + } + + private normalizeLinkText(rawText: string): string { + let text = this.normalizeSlashes(rawText); + // Remove a leading or trailing backtick that sometimes wraps the visible link label. + text = text.replace(/^`|`$/g, ''); + + // Look for a trailing #L anchor segment so it can be stripped before we compare names. + const anchorMatch = /^(.+?)(#L\d+(?:-\d+)?)$/.exec(text); + return anchorMatch ? anchorMatch[1] : text; + } + + private canLinkify(parsed: { readonly text: string; readonly targetPath: string; readonly anchor: string | undefined }, workspaceFolders: readonly Uri[]): boolean { + const { text, targetPath, anchor } = parsed; + const textMatchesBase = targetPath === text; + const textIsFilename = !text.includes('/') && targetPath.endsWith(`/${text}`); + const descriptiveAbsolute = this.isAbsolutePath(targetPath) && !!anchor; + + return Boolean(workspaceFolders.length) && (textMatchesBase || textIsFilename || descriptiveAbsolute); + } + + private async resolveTarget(targetPath: string, workspaceFolders: readonly Uri[], preserveDirectorySlash: boolean): Promise { + if (!workspaceFolders.length) { + return undefined; + } - if (!out.length) { + const folderUris = workspaceFolders.map(folder => this.toVsUri(folder)); + + if (this.isAbsolutePath(targetPath)) { + const absoluteUri = this.tryCreateFileUri(targetPath); + if (!absoluteUri) { + return undefined; + } + + for (const folderUri of folderUris) { + if (this.isEqualOrParentFs(absoluteUri, folderUri)) { + return this.tryStat(absoluteUri, preserveDirectorySlash); + } + } return undefined; } - return { parts: coalesceParts(await Promise.all(out)) }; + + const segments = targetPath.split('/').filter(Boolean); + for (const folderUri of folderUris) { + const candidate = Uri.joinPath(folderUri, ...segments); + const stat = await this.tryStat(candidate, preserveDirectorySlash); + if (stat) { + return stat; + } + } + + return undefined; } - private async tryStat(uri: Uri): Promise { + private tryCreateFileUri(path: string): Uri | undefined { + try { + return Uri.file(path); + } catch { + return undefined; + } + } + + private toVsUri(folder: Uri): Uri { + return Uri.parse(folder.toString()); + } + + private isEqualOrParentFs(target: Uri, folder: Uri): boolean { + const targetFs = this.normalizeFsPath(target); + const folderFs = this.normalizeFsPath(folder); + return targetFs === folderFs || targetFs.startsWith(folderFs.endsWith('/') ? folderFs : `${folderFs}/`); + } + + private normalizeFsPath(resource: Uri): string { + // Convert Windows backslashes to forward slashes and remove duplicate separators for stable comparisons. + return resource.fsPath.replace(/\\/g, '/').replace(/\/+/g, '/').toLowerCase(); + } + + private parseAnchor(anchor: string | undefined): { readonly range: Range; readonly startLine: string; readonly endLine: string | undefined } | undefined { + // Ensure the anchor follows the #L123 or #L123-456 format before parsing it. + if (!anchor || !/^L\d+(?:-\d+)?$/.test(anchor)) { + return undefined; + } + + // Capture the start (and optional end) line numbers from the anchor. + const match = /^L(\d+)(?:-(\d+))?$/.exec(anchor); + if (!match) { + return undefined; + } + + const startLine = match[1]; + const endLineRaw = match[2]; + const normalizedEndLine = endLineRaw === startLine ? undefined : endLineRaw; + const start = parseInt(startLine, 10) - 1; + const end = parseInt(normalizedEndLine ?? startLine, 10) - 1; + if (Number.isNaN(start) || Number.isNaN(end) || start < 0 || end < start) { + return undefined; + } + + return { + range: new Range(new Position(start, 0), new Position(end, 0)), + startLine, + endLine: normalizedEndLine, + }; + } + + private isAbsolutePath(path: string): boolean { + // Treat drive-letter prefixes (e.g. C:) or leading slashes as absolute paths. + return /^[a-z]:/i.test(path) || path.startsWith('/'); + } + + private async tryStat(uri: Uri, preserveDirectorySlash: boolean): Promise { try { const stat = await this.fileSystem.stat(uri); if (stat.type === FileType.Directory) { - return uri.path.endsWith('/') ? uri : uri.with({ path: uri.path + '/' }); + if (preserveDirectorySlash) { + return uri.path.endsWith('/') ? uri : uri.with({ path: `${uri.path}/` }); + } + if (uri.path.endsWith('/') && uri.path !== '/') { + return uri.with({ path: uri.path.slice(0, -1) }); + } + return uri; } return uri; - } catch { return undefined; } + } catch { + return undefined; + } } } diff --git a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts index bb149d58e5..50c14bd8fb 100644 --- a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts +++ b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts @@ -25,15 +25,32 @@ suite('Model File Path Linkifier', () => { assertPartsEqual([anchor], [expected]); }); + test('Should linkify absolute file paths', async () => { + const absolutePath = workspaceFile('src/file.ts').fsPath; + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, `[src/file.ts](${absolutePath}#L2)`); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(1, 0), new Position(1, 0)))); + assertPartsEqual([anchor], [expected]); + }); + + test('Should decode percent-encoded targets', async () => { + const service = createTestLinkifierService('space file.ts'); + const result = await linkify(service, '[space file.ts](space%20file.ts#L1)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('space file.ts'), new Range(new Position(0, 0), new Position(0, 0)))); + assertPartsEqual([anchor], [expected]); + }); + test('Should fallback when text does not match base path', async () => { const service = createTestLinkifierService('src/file.ts'); const result = await linkify(service, '[other](src/file.ts#L2-3)'); - assertPartsEqual(result.parts, ['[other](src/file.ts#L2-3)']); + assertPartsEqual(result.parts, ['other']); }); test('Should fallback for invalid anchor syntax', async () => { const service = createTestLinkifierService('src/file.ts'); const result = await linkify(service, '[src/file.ts](src/file.ts#Lines10-12)'); - assertPartsEqual(result.parts, ['[src/file.ts](src/file.ts#Lines10-12)']); + assertPartsEqual(result.parts, ['src/file.ts']); }); }); diff --git a/src/extension/linkify/test/node/util.ts b/src/extension/linkify/test/node/util.ts index fd6950cfe9..2106252030 100644 --- a/src/extension/linkify/test/node/util.ts +++ b/src/extension/linkify/test/node/util.ts @@ -21,18 +21,19 @@ export function workspaceFile(path: string) { } export function createMockFsService(listOfFiles: readonly (string | URI)[]): IFileSystemService { - const workspaceFiles = listOfFiles.map(f => URI.isUri(f) ? f : workspaceFile(f)); + const workspaceEntries = listOfFiles.map(f => URI.isUri(f) ? f : workspaceFile(f)); return new class implements Partial { async stat(path: URI): Promise { if (path.path === '/' || path.path === workspace.path) { return { ctime: 0, mtime: 0, size: 0, type: FileType.File }; } - const entry = workspaceFiles.find(f => f.toString() === path.toString() || f.toString() === path.toString() + '/'); + const entry = workspaceEntries.find(f => f.toString() === path.toString() || f.toString() === `${path.toString()}/`); if (!entry) { throw new Error(`File not found: ${path}`); } - return { ctime: 0, mtime: 0, size: 0, type: FileType.File }; + const isDirectory = entry.path.endsWith('/'); + return { ctime: 0, mtime: 0, size: 0, type: isDirectory ? FileType.Directory : FileType.File }; } } as any; } @@ -42,6 +43,14 @@ export function createMockWorkspaceService(): IWorkspaceService { getWorkspaceFolders(): URI[] { return [workspace]; } + + getWorkspaceFolder(): URI | undefined { + return workspace; + } + + getWorkspaceFolderName(): string { + return 'workspace'; + } } as any; } diff --git a/src/extension/prompt/node/chatParticipantRequestHandler.ts b/src/extension/prompt/node/chatParticipantRequestHandler.ts index ba66ccfdb1..db6998988b 100644 --- a/src/extension/prompt/node/chatParticipantRequestHandler.ts +++ b/src/extension/prompt/node/chatParticipantRequestHandler.ts @@ -446,10 +446,12 @@ function anchorPartToMarkdown(workspaceService: IWorkspaceService, anchor: ChatR if (URI.isUri(anchor.value)) { path = getWorkspaceFileDisplayPath(workspaceService, anchor.value); - text = `\`${path}\``; + const label = anchor.title ?? path; + text = `\`${label}\``; } else if (isLocation(anchor.value)) { path = getWorkspaceFileDisplayPath(workspaceService, anchor.value.uri); - text = `\`${path}\``; + const label = anchor.title ?? `${path}#L${anchor.value.range.start.line + 1}${anchor.value.range.start.line === anchor.value.range.end.line ? '' : `-${anchor.value.range.end.line + 1}`}`; + text = `\`${label}\``; } else if (isSymbolInformation(anchor.value)) { path = getWorkspaceFileDisplayPath(workspaceService, anchor.value.location.uri); text = `\`${anchor.value.name}\``; diff --git a/src/extension/prompts/node/agent/anthropicPrompts.tsx b/src/extension/prompts/node/agent/anthropicPrompts.tsx index d7ba64944f..e2ba7110e9 100644 --- a/src/extension/prompts/node/agent/anthropicPrompts.tsx +++ b/src/extension/prompts/node/agent/anthropicPrompts.tsx @@ -100,12 +100,12 @@ class DefaultAnthropicAgentPrompt extends PromptElement Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
- The class `Person` is in `src/models/person.ts`.
The function `calculateTotal` is defined in `lib/utils/math.ts`.
You can find the configuration in `config/app.config.json`.
+
@@ -202,6 +202,7 @@ class Claude45DefaultPrompt extends PromptElement { The function `calculateTotal` is defined in `lib/utils/math.ts`.
You can find the configuration in `config/app.config.json`.
+
diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx index f16660fc7c..f7cf20cc76 100644 --- a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -9,28 +9,23 @@ import { Tag } from '../base/tag'; export class FileLinkificationInstructions extends PromptElement<{}> { render() { return - ALWAYS convert file paths to markdown links. Use workspace-relative POSIX paths with 1-based line numbers:
+ ALWAYS convert file paths to markdown links with 1-based line numbers:
`[path/to/file.ts](path/to/file.ts)` - whole file
`[path/to/file.ts](path/to/file.ts#L10)` - single line
- `[path/to/file.ts](path/to/file.ts#L10-12)` - line range (inclusive)
+ `[path/to/file.ts](path/to/file.ts#L10-12)` - line range
Examples:
❌ `The function is in exampleScript.ts at line 25.`
✓ `The function is in [exampleScript.ts](exampleScript.ts#L25).`
- ❌ `See src/utils/math.ts lines 40-44`
- ✓ `See [src/utils/math.ts](src/utils/math.ts#L40-44)`
- ❌ `Config in docs/My File.md`
- ✓ `Config in [docs/My File.md](docs/My%20File.md)`
Critical rules:
- - Bracket text = file path only (no `#L...`). Wrong: `[file.ts#L10](...)`; Correct: `[file.ts](...#L10)`
- - Only cite existing paths from context; don't invent paths
- - Immediately fold any cited line(s)/range into the anchor (not separate prose)
- - Use ranges (`#L10-12`) for 2+ consecutive lines; single line form otherwise
- - Percent-encode spaces in link target only: `[My File.md](My%20File.md)` (leave bracket text unencoded)
- - Backticks only for plain non-linked paths; never wrap the markdown link itself in backticks
- - No bare filenames left unlinked (exception: verbatim user input you will transform next)
- - If uncertain about exact lines, link whole file (no anchor) and gather more context before adding anchors
- - Missed conversion? Correct it in your very next message
- Goal: High link coverage; fallback rarely triggers.
+ - Bracket text = exact file path only (no backticks, no `#L...`, no descriptive text like "line 549")
+ - Path format: Strip drive letters and workspace parent folders - use only path after workspace root
+ - Transform `c:\Repos\workspace\src\file.ts` → `[src/file.ts](src/file.ts)`
+ - Always use forward slashes `/`, never backslashes `\`
+ - Do not use URIs like file://, vscode://, or https://.
+ - Percent-encode spaces in target only: `[My File.md](My%20File.md)`
+ - Each file reference needs complete path (don't abbreviate repeated files)
+ - Integrate line numbers into anchor: `#L10` or `#L10-12` for ranges
+ - Don't wrap links in backticks; only cite existing paths from context
; } } diff --git a/src/extension/prompts/node/agent/openAIPrompts.tsx b/src/extension/prompts/node/agent/openAIPrompts.tsx index 35a6a12d51..2f893933a8 100644 --- a/src/extension/prompts/node/agent/openAIPrompts.tsx +++ b/src/extension/prompts/node/agent/openAIPrompts.tsx @@ -392,12 +392,6 @@ class CodexStyleGPT5CodexPrompt extends PromptElement { - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.
- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short—wrap/reformat if long; avoid naming formatting styles in answers.
- Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets.
- - File References: When referencing files in your response, always follow the below rules:
- * Use inline code to make file paths clickable.
- * Each reference should have a stand alone path. Even if it's the same file.
- * Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.
- * Do not use URIs like file://, vscode://, or https://.
- * Examples: src/app.ts, C:\repo\project\main.rs

; From e7f3c3edc78b1c5c2641e5a79056a42468298900 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 12 Nov 2025 11:00:50 -0800 Subject: [PATCH 05/25] GCP feedback updates --- .../linkify/common/modelFilePathLinkifier.ts | 4 ++-- .../test/node/modelFilePathLinkifier.spec.ts | 5 ++++- .../node/agent/fileLinkificationInstructions.tsx | 13 ++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/extension/linkify/common/modelFilePathLinkifier.ts b/src/extension/linkify/common/modelFilePathLinkifier.ts index 6c54b92e3e..87a4a4b897 100644 --- a/src/extension/linkify/common/modelFilePathLinkifier.ts +++ b/src/extension/linkify/common/modelFilePathLinkifier.ts @@ -61,8 +61,8 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { if (anchorRange) { const { range, startLine, endLine } = anchorRange; const displayPath = endLine && startLine !== endLine - ? `${basePath}#${startLine}-${endLine}` - : `${basePath}#${startLine}`; + ? `${basePath}#L${startLine}-${endLine}` + : `${basePath}#L${startLine}`; parts.push(new LinkifyLocationAnchor(new Location(resolved, range), displayPath)); continue; } diff --git a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts index 50c14bd8fb..6dc09c6c85 100644 --- a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts +++ b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { suite, test } from 'vitest'; +import { expect, suite, test } from 'vitest'; import { Location, Position, Range } from '../../../../vscodeTypes'; import { LinkifyLocationAnchor } from '../../common/linkifiedText'; import { assertPartsEqual, createTestLinkifierService, linkify, workspaceFile } from './util'; @@ -14,6 +14,7 @@ suite('Model File Path Linkifier', () => { const result = await linkify(service, '[src/file.ts](src/file.ts#L10-12)'); const anchor = result.parts[0] as LinkifyLocationAnchor; const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(9, 0), new Position(11, 0)))); + expect(anchor.title).toBe('src/file.ts#L10-12'); assertPartsEqual([anchor], [expected]); }); @@ -22,6 +23,7 @@ suite('Model File Path Linkifier', () => { const result = await linkify(service, '[src/file.ts](src/file.ts#L5)'); const anchor = result.parts[0] as LinkifyLocationAnchor; const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(4, 0), new Position(4, 0)))); + expect(anchor.title).toBe('src/file.ts#L5'); assertPartsEqual([anchor], [expected]); }); @@ -31,6 +33,7 @@ suite('Model File Path Linkifier', () => { const result = await linkify(service, `[src/file.ts](${absolutePath}#L2)`); const anchor = result.parts[0] as LinkifyLocationAnchor; const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(1, 0), new Position(1, 0)))); + expect(anchor.title).toBe('src/file.ts#L2'); assertPartsEqual([anchor], [expected]); }); diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx index f7cf20cc76..01d1633c01 100644 --- a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -9,15 +9,18 @@ import { Tag } from '../base/tag'; export class FileLinkificationInstructions extends PromptElement<{}> { render() { return - ALWAYS convert file paths to markdown links with 1-based line numbers:
- `[path/to/file.ts](path/to/file.ts)` - whole file
- `[path/to/file.ts](path/to/file.ts#L10)` - single line
- `[path/to/file.ts](path/to/file.ts#L10-12)` - line range
+ ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations:
+ [path/to/file.ts](path/to/file.ts) - whole file
+ [path/to/file.ts](path/to/file.ts#L10) - single line
+ [path/to/file.ts](path/to/file.ts#L10-12) - line range
+ When listing multiple references, start each item with the linked path, for example:
+ [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view
+ [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget
Examples:
❌ `The function is in exampleScript.ts at line 25.`
✓ `The function is in [exampleScript.ts](exampleScript.ts#L25).`
Critical rules:
- - Bracket text = exact file path only (no backticks, no `#L...`, no descriptive text like "line 549")
+ - Link text = exact file path only (no backticks, no `#L` in the visible text, no extra wording). Keep any `#L` anchors in the link target, for example `[src/file.ts](src/file.ts#L25)`.
- Path format: Strip drive letters and workspace parent folders - use only path after workspace root
- Transform `c:\Repos\workspace\src\file.ts` → `[src/file.ts](src/file.ts)`
- Always use forward slashes `/`, never backslashes `\`
From 94547bc993b6270348f1aef773ad47f569bd23f7 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 12 Nov 2025 11:17:39 -0800 Subject: [PATCH 06/25] Update prompt snapshot. --- .../__snapshots__/agentPrompt.spec.tsx.snap | 1053 +++++++++++++++++ 1 file changed, 1053 insertions(+) diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompt.spec.tsx.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompt.spec.tsx.snap index 27cba6d935..e78b971093 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompt.spec.tsx.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompt.spec.tsx.snap @@ -82,6 +82,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -217,6 +240,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -354,6 +400,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -479,6 +548,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -611,6 +703,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -871,6 +986,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -1116,6 +1254,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -1248,6 +1409,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -1370,6 +1554,29 @@ The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + @@ -2759,6 +2966,29 @@ Important Reminder: Markdown cells cannot be executed
Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -2892,6 +3122,29 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -3027,6 +3280,29 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -3121,6 +3397,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -3222,6 +3521,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -3450,6 +3772,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -3662,6 +4007,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -3763,6 +4131,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -3854,6 +4245,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -4022,6 +4436,29 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -4159,6 +4596,29 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -4298,6 +4758,29 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -4396,6 +4879,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -4501,6 +5007,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -4735,6 +5264,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -4955,6 +5507,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -5060,6 +5635,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -5155,6 +5753,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -5479,9 +6100,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -5756,9 +6402,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -6035,9 +6706,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -6314,9 +7010,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -6600,9 +7321,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -7034,9 +7780,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -7473,9 +8244,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -7759,9 +8555,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -8035,9 +8856,34 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + When referring to a filename or symbol in the user's workspace, wrap it in backticks. The class \`Person\` is in \`src/models/person.ts\`. +Code for the HTTP client is in [src/network/httpClient.ts](src/network/httpClient.ts#L42). + @@ -8194,6 +9040,29 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -8334,6 +9203,29 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -8476,6 +9368,29 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -8577,6 +9492,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -8685,6 +9623,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -8920,6 +9881,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -9139,6 +10123,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -9247,6 +10254,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. @@ -9345,6 +10375,29 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: +[path/to/file.ts](path/to/file.ts) - whole file +[path/to/file.ts](path/to/file.ts#L10) - single line +[path/to/file.ts](path/to/file.ts#L10-12) - line range +When listing multiple references, start each item with the linked path, for example: +[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view +[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +Examples: +❌ \`The function is in exampleScript.ts at line 25.\` +✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` +Critical rules: +- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` +- Always use forward slashes \`/\`, never backslashes \`/\` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: \`[My File.md](My%20File.md)\` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: \`#L10\` or \`#L10-12\` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + The class \`Person\` is in \`src/models/person.ts\`. The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. From 9059f78b88d4b2f702ef2be91f46c346849c2adb Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 12 Nov 2025 13:58:59 -0800 Subject: [PATCH 07/25] few prompt tweaks --- .../test/node/modelFilePathLinkifier.spec.ts | 6 + .../agent/fileLinkificationInstructions.tsx | 18 +- .../__snapshots__/agentPrompt.spec.tsx.snap | 810 ++++++++++-------- 3 files changed, 466 insertions(+), 368 deletions(-) diff --git a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts index 6dc09c6c85..00eb937d2a 100644 --- a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts +++ b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts @@ -51,6 +51,12 @@ suite('Model File Path Linkifier', () => { assertPartsEqual(result.parts, ['other']); }); + test('Should return label when text omits path', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[line 54](src/file.ts#L54)'); + assertPartsEqual(result.parts, ['line 54']); + }); + test('Should fallback for invalid anchor syntax', async () => { const service = createTestLinkifierService('src/file.ts'); const result = await linkify(service, '[src/file.ts](src/file.ts#Lines10-12)'); diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx index 01d1633c01..78f398b4c3 100644 --- a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -9,18 +9,20 @@ import { Tag } from '../base/tag'; export class FileLinkificationInstructions extends PromptElement<{}> { render() { return - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations:
- [path/to/file.ts](path/to/file.ts) - whole file
- [path/to/file.ts](path/to/file.ts#L10) - single line
- [path/to/file.ts](path/to/file.ts#L10-12) - line range
- When listing multiple references, start each item with the linked path, for example:
- [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view
- [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget
+ ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer.
+ Format examples:
+ - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line)
+ - `See [path/to/file.ts](path/to/file.ts#L10-12) for the range.`
+ - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file)
+ When you need a bullet list of references, write a short description before the link, for example:
+ - Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142)
+ - Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321)
Examples:
❌ `The function is in exampleScript.ts at line 25.`
✓ `The function is in [exampleScript.ts](exampleScript.ts#L25).`
Critical rules:
- - Link text = exact file path only (no backticks, no `#L` in the visible text, no extra wording). Keep any `#L` anchors in the link target, for example `[src/file.ts](src/file.ts#L25)`.
+ - Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`.
+ - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not.
- Path format: Strip drive letters and workspace parent folders - use only path after workspace root
- Transform `c:\Repos\workspace\src\file.ts` → `[src/file.ts](src/file.ts)`
- Always use forward slashes `/`, never backslashes `\`
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompt.spec.tsx.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompt.spec.tsx.snap index e78b971093..1295b41bd2 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompt.spec.tsx.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompt.spec.tsx.snap @@ -83,18 +83,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -241,18 +243,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -401,18 +405,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -549,18 +555,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -704,18 +712,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -987,18 +997,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -1255,18 +1267,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -1410,18 +1424,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -1555,18 +1571,20 @@ The function \`calculateTotal\` is defined in \`lib/utils/math.ts\`. You can find the configuration in \`config/app.config.json\`.
-ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -2967,18 +2985,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -3123,18 +3143,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -3281,18 +3303,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -3398,18 +3422,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -3522,18 +3548,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -3773,18 +3801,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -4008,18 +4038,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -4132,18 +4164,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -4246,18 +4280,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -4437,18 +4473,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -4597,18 +4635,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -4759,18 +4799,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -4880,18 +4922,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -5008,18 +5052,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -5265,18 +5311,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -5508,18 +5556,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -5636,18 +5686,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -5754,18 +5806,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -6101,18 +6155,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -6403,18 +6459,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -6707,18 +6765,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -7011,18 +7071,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -7322,18 +7384,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -7781,18 +7845,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -8245,18 +8311,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -8556,18 +8624,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -8857,18 +8927,20 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -9041,18 +9113,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -9204,18 +9278,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -9369,18 +9445,20 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -9493,18 +9571,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -9624,18 +9704,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -9882,18 +9964,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -10124,18 +10208,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -10255,18 +10341,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` @@ -10376,18 +10464,20 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations: -[path/to/file.ts](path/to/file.ts) - whole file -[path/to/file.ts](path/to/file.ts#L10) - single line -[path/to/file.ts](path/to/file.ts#L10-12) - line range -When listing multiple references, start each item with the linked path, for example: -[path/to/chatQuick.ts](path/to/chatQuick.ts#L142) - awaiting a call to open the chat view -[path/to/chatQuick.ts](path/to/chatQuick.ts#L321) - awaiting the chat view widget +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- \`The handler lives in [path/to/file.ts](path/to/file.ts#L10).\` (single line) +- \`See [path/to/file.ts](path/to/file.ts#L10-12) for the range.\` +- \`Configuration is defined in [path/to/file.ts](path/to/file.ts).\` (whole file) +When you need a bullet list of references, write a short description before the link, for example: +- Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142) +- Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321) Examples: ❌ \`The function is in exampleScript.ts at line 25.\` ✓ \`The function is in [exampleScript.ts](exampleScript.ts#L25).\` Critical rules: -- Link text = exact file path only (no backticks, no \`#L\` in the visible text, no extra wording). Keep any \`#L\` anchors in the link target, for example \`[src/file.ts](src/file.ts#L25)\`. +- Link text must be the exact file path (no backticks, no \`#L\` in the visible text, no extra wording). Keep the \`#L\` anchor in the **link target**, e.g. \`[src/file.ts](src/file.ts#L25)\`. +- Always include both brackets **and** parentheses. \`[src/file.ts](src/file.ts#L25)\` is valid; \`[src/file.ts#L25]\` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform \`c:/Repos/workspace/src/file.ts\` → \`[src/file.ts](src/file.ts)\` - Always use forward slashes \`/\`, never backslashes \`/\` From 278f6984db740eb1f8514b5374f7da2c0773a1f0 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Fri, 14 Nov 2025 15:03:15 -0800 Subject: [PATCH 08/25] PR feedback updates --- .../linkify/common/modelFilePathLinkifier.ts | 50 ++++++++-------- .../test/node/modelFilePathLinkifier.spec.ts | 59 +++++++++++++++++-- .../agent/fileLinkificationInstructions.tsx | 15 +++-- 3 files changed, 85 insertions(+), 39 deletions(-) diff --git a/src/extension/linkify/common/modelFilePathLinkifier.ts b/src/extension/linkify/common/modelFilePathLinkifier.ts index 87a4a4b897..85b7e38058 100644 --- a/src/extension/linkify/common/modelFilePathLinkifier.ts +++ b/src/extension/linkify/common/modelFilePathLinkifier.ts @@ -45,29 +45,28 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { continue; } - const resolved = await this.resolveTarget(parsed.targetPath, workspaceFolders, parsed.preserveDirectorySlash); - if (!resolved) { - parts.push(original); - continue; - } + // Push promise to resolve in parallel with other matches + parts.push(this.resolveTarget(parsed.targetPath, workspaceFolders, parsed.preserveDirectorySlash).then(resolved => { + if (!resolved) { + return original; + } - const basePath = getWorkspaceFileDisplayPath(this.workspaceService, resolved); - const anchorRange = this.parseAnchor(parsed.anchor); - if (parsed.anchor && !anchorRange) { - parts.push(original); - continue; - } + const basePath = getWorkspaceFileDisplayPath(this.workspaceService, resolved); + const anchorRange = this.parseAnchor(parsed.anchor); + if (parsed.anchor && !anchorRange) { + return original; + } - if (anchorRange) { - const { range, startLine, endLine } = anchorRange; - const displayPath = endLine && startLine !== endLine - ? `${basePath}#L${startLine}-${endLine}` - : `${basePath}#L${startLine}`; - parts.push(new LinkifyLocationAnchor(new Location(resolved, range), displayPath)); - continue; - } + if (anchorRange) { + const { range, startLine, endLine } = anchorRange; + const displayPath = endLine && startLine !== endLine + ? `${basePath}#L${startLine}-L${endLine}` + : `${basePath}#L${startLine}`; + return new LinkifyLocationAnchor(new Location(resolved, range), displayPath); + } - parts.push(new LinkifyLocationAnchor(resolved, basePath)); + return new LinkifyLocationAnchor(resolved, basePath); + })); } const suffix = text.slice(lastIndex); @@ -125,9 +124,9 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { const { text, targetPath, anchor } = parsed; const textMatchesBase = targetPath === text; const textIsFilename = !text.includes('/') && targetPath.endsWith(`/${text}`); - const descriptiveAbsolute = this.isAbsolutePath(targetPath) && !!anchor; + const descriptiveWithAnchor = !!anchor; // Allow any descriptive text when anchor is present - return Boolean(workspaceFolders.length) && (textMatchesBase || textIsFilename || descriptiveAbsolute); + return Boolean(workspaceFolders.length) && (textMatchesBase || textIsFilename || descriptiveWithAnchor); } private async resolveTarget(targetPath: string, workspaceFolders: readonly Uri[], preserveDirectorySlash: boolean): Promise { @@ -187,13 +186,14 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { } private parseAnchor(anchor: string | undefined): { readonly range: Range; readonly startLine: string; readonly endLine: string | undefined } | undefined { - // Ensure the anchor follows the #L123 or #L123-456 format before parsing it. - if (!anchor || !/^L\d+(?:-\d+)?$/.test(anchor)) { + // Ensure the anchor follows the #L123, #L123-456, or #L123-L456 format before parsing it. + if (!anchor || !/^L\d+(?:-L?\d+)?$/.test(anchor)) { return undefined; } // Capture the start (and optional end) line numbers from the anchor. - const match = /^L(\d+)(?:-(\d+))?$/.exec(anchor); + // Support both L123-456 and L123-L456 formats + const match = /^L(\d+)(?:-L?(\d+))?$/.exec(anchor); if (!match) { return undefined; } diff --git a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts index 00eb937d2a..50b30f4631 100644 --- a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts +++ b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts @@ -14,7 +14,7 @@ suite('Model File Path Linkifier', () => { const result = await linkify(service, '[src/file.ts](src/file.ts#L10-12)'); const anchor = result.parts[0] as LinkifyLocationAnchor; const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(9, 0), new Position(11, 0)))); - expect(anchor.title).toBe('src/file.ts#L10-12'); + expect(anchor.title).toBe('src/file.ts#L10-L12'); assertPartsEqual([anchor], [expected]); }); @@ -45,16 +45,19 @@ suite('Model File Path Linkifier', () => { assertPartsEqual([anchor], [expected]); }); - test('Should fallback when text does not match base path', async () => { + test('Should fallback when text does not match base path and no anchor', async () => { const service = createTestLinkifierService('src/file.ts'); - const result = await linkify(service, '[other](src/file.ts#L2-3)'); + const result = await linkify(service, '[other](src/file.ts)'); assertPartsEqual(result.parts, ['other']); }); - test('Should return label when text omits path', async () => { + test('Should linkify descriptive text with anchor', async () => { const service = createTestLinkifierService('src/file.ts'); - const result = await linkify(service, '[line 54](src/file.ts#L54)'); - assertPartsEqual(result.parts, ['line 54']); + const result = await linkify(service, '[Await chat view](src/file.ts#L54)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(53, 0), new Position(53, 0)))); + expect(anchor.title).toBe('src/file.ts#L54'); + assertPartsEqual([anchor], [expected]); }); test('Should fallback for invalid anchor syntax', async () => { @@ -62,4 +65,48 @@ suite('Model File Path Linkifier', () => { const result = await linkify(service, '[src/file.ts](src/file.ts#Lines10-12)'); assertPartsEqual(result.parts, ['src/file.ts']); }); + + test('Should handle backticks in link text', async () => { + const service = createTestLinkifierService('file.ts'); + const result = await linkify(service, '[`file.ts`](file.ts)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(workspaceFile('file.ts')); + assertPartsEqual([anchor], [expected]); + }); + + test('Should handle backticks in link text with line anchor', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[`src/file.ts`](src/file.ts#L42)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(41, 0), new Position(41, 0)))); + expect(anchor.title).toBe('src/file.ts#L42'); + assertPartsEqual([anchor], [expected]); + }); + + test('Should handle L123-L456 anchor format with L prefix on end line', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[src/file.ts](src/file.ts#L10-L15)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(9, 0), new Position(14, 0)))); + expect(anchor.title).toBe('src/file.ts#L10-L15'); + assertPartsEqual([anchor], [expected]); + }); + + test('Should handle descriptive text with L123-L456 anchor format', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[Some descriptive text](src/file.ts#L20-L25)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(19, 0), new Position(24, 0)))); + expect(anchor.title).toBe('src/file.ts#L20-L25'); + assertPartsEqual([anchor], [expected]); + }); + + test('Should normalize non-standard L123-456 format to standard L123-L456', async () => { + const service = createTestLinkifierService('src/file.ts'); + const result = await linkify(service, '[src/file.ts](src/file.ts#L20-25)'); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(19, 0), new Position(24, 0)))); + expect(anchor.title).toBe('src/file.ts#L20-L25'); + assertPartsEqual([anchor], [expected]); + }); }); diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx index 78f398b4c3..8c82666086 100644 --- a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -12,14 +12,13 @@ export class FileLinkificationInstructions extends PromptElement<{}> { ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer.
Format examples:
- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line)
- - `See [path/to/file.ts](path/to/file.ts#L10-12) for the range.`
+ - `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.`
- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file)
- When you need a bullet list of references, write a short description before the link, for example:
- - Await chat view: [path/to/chatQuick.ts](path/to/chatQuick.ts#L142)
- - Show widget: [path/to/chatQuick.ts](path/to/chatQuick.ts#L321)
- Examples:
- ❌ `The function is in exampleScript.ts at line 25.`
- ✓ `The function is in [exampleScript.ts](exampleScript.ts#L25).`
+ - `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses)
+ When you need a bullet list of references with line numbers, you can use descriptive text:
+ - [Await chat view](path/to/chatQuick.ts#L142)
+ - [Show widget](path/to/chatQuick.ts#L321)
+ NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).`
Critical rules:
- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`.
- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not.
@@ -29,7 +28,7 @@ export class FileLinkificationInstructions extends PromptElement<{}> { - Do not use URIs like file://, vscode://, or https://.
- Percent-encode spaces in target only: `[My File.md](My%20File.md)`
- Each file reference needs complete path (don't abbreviate repeated files)
- - Integrate line numbers into anchor: `#L10` or `#L10-12` for ranges
+ - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges
- Don't wrap links in backticks; only cite existing paths from context
; } From e4869a388e78fbab066ef5d37ed55cec4a4544ff Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Fri, 14 Nov 2025 17:06:40 -0800 Subject: [PATCH 09/25] Move fileLinkifiction instruction to correct location --- .../prompts/node/agent/defaultAgentInstructions.tsx | 5 ++++- src/extension/prompts/node/agent/geminiPrompts.tsx | 2 +- src/extension/prompts/node/agent/openAIPrompts.tsx | 2 +- src/extension/prompts/node/agent/xAIPrompts.tsx | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/extension/prompts/node/agent/defaultAgentInstructions.tsx b/src/extension/prompts/node/agent/defaultAgentInstructions.tsx index 44d3e05f73..f745831d58 100644 --- a/src/extension/prompts/node/agent/defaultAgentInstructions.tsx +++ b/src/extension/prompts/node/agent/defaultAgentInstructions.tsx @@ -6,6 +6,7 @@ import { BasePromptElementProps, PromptElement, PromptSizing } from '@vscode/prompt-tsx'; import type { LanguageModelToolInformation } from 'vscode'; import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService'; +import { isHiddenModelB } from '../../../../platform/endpoint/common/chatModelCapabilities'; import { IExperimentationService } from '../../../../platform/telemetry/common/nullExperimentationService'; import { LanguageModelToolMCPSource } from '../../../../vscodeTypes'; import { ToolName } from '../../../tools/common/toolNames'; @@ -16,7 +17,7 @@ import { Tag } from '../base/tag'; import { CodeBlockFormattingRules, EXISTING_CODE_MARKER } from '../panel/codeBlockFormattingRules'; import { MathIntegrationRules } from '../panel/editorIntegrationRules'; import { KeepGoingReminder } from './agentPrompt'; -import { isHiddenModelB } from '../../../../platform/endpoint/common/chatModelCapabilities'; +import { FileLinkificationInstructions } from './fileLinkificationInstructions'; // Types and interfaces for reusable components interface ToolCapabilities extends Partial> { @@ -137,6 +138,7 @@ export class DefaultAgentPrompt extends PromptElement { The function `calculateTotal` is defined in `lib/utils/math.ts`.
You can find the configuration in `config/app.config.json`. + @@ -302,6 +304,7 @@ export class AlternateGPTPrompt extends PromptElement { The class `Person` is in `src/models/person.ts`. + diff --git a/src/extension/prompts/node/agent/geminiPrompts.tsx b/src/extension/prompts/node/agent/geminiPrompts.tsx index deceaa0744..22a166d8c0 100644 --- a/src/extension/prompts/node/agent/geminiPrompts.tsx +++ b/src/extension/prompts/node/agent/geminiPrompts.tsx @@ -103,12 +103,12 @@ export class DefaultGeminiAgentPrompt extends PromptElement Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
- The class `Person` is in `src/models/person.ts`.
The function `calculateTotal` is defined in `lib/utils/math.ts`.
You can find the configuration in `config/app.config.json`.
+
diff --git a/src/extension/prompts/node/agent/openAIPrompts.tsx b/src/extension/prompts/node/agent/openAIPrompts.tsx index 0e24ff1413..0af3a1823d 100644 --- a/src/extension/prompts/node/agent/openAIPrompts.tsx +++ b/src/extension/prompts/node/agent/openAIPrompts.tsx @@ -102,12 +102,12 @@ export class DefaultOpenAIAgentPrompt extends PromptElement Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
- The class `Person` is in `src/models/person.ts`.
The function `calculateTotal` is defined in `lib/utils/math.ts`.
You can find the configuration in `config/app.config.json`.
+
diff --git a/src/extension/prompts/node/agent/xAIPrompts.tsx b/src/extension/prompts/node/agent/xAIPrompts.tsx index cf5d140853..61bae78059 100644 --- a/src/extension/prompts/node/agent/xAIPrompts.tsx +++ b/src/extension/prompts/node/agent/xAIPrompts.tsx @@ -107,12 +107,12 @@ class DefaultGrokCodeFastAgentPrompt extends PromptElement Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
- The class `Person` is in `src/models/person.ts`.
The function `calculateTotal` is defined in `lib/utils/math.ts`.
You can find the configuration in `config/app.config.json`.
+
From 6fd00ab06b1078434fc8afb2385402c9aaba1546 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Fri, 14 Nov 2025 17:12:29 -0800 Subject: [PATCH 10/25] Remove from default --- src/extension/prompts/node/agent/defaultAgentInstructions.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/extension/prompts/node/agent/defaultAgentInstructions.tsx b/src/extension/prompts/node/agent/defaultAgentInstructions.tsx index f745831d58..a88c696516 100644 --- a/src/extension/prompts/node/agent/defaultAgentInstructions.tsx +++ b/src/extension/prompts/node/agent/defaultAgentInstructions.tsx @@ -17,7 +17,6 @@ import { Tag } from '../base/tag'; import { CodeBlockFormattingRules, EXISTING_CODE_MARKER } from '../panel/codeBlockFormattingRules'; import { MathIntegrationRules } from '../panel/editorIntegrationRules'; import { KeepGoingReminder } from './agentPrompt'; -import { FileLinkificationInstructions } from './fileLinkificationInstructions'; // Types and interfaces for reusable components interface ToolCapabilities extends Partial> { @@ -138,7 +137,6 @@ export class DefaultAgentPrompt extends PromptElement { The function `calculateTotal` is defined in `lib/utils/math.ts`.
You can find the configuration in `config/app.config.json`. - @@ -304,7 +302,6 @@ export class AlternateGPTPrompt extends PromptElement { The class `Person` is in `src/models/person.ts`. - From d9d8f9d19b18e08d9869a8fba5e1064f81f9faef Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Tue, 18 Nov 2025 22:57:09 -0800 Subject: [PATCH 11/25] update gpt prompts --- .../node/agent/openai/defaultOpenAIPrompt.tsx | 2 ++ .../node/agent/openai/gpt51CodexPrompt.tsx | 4 +++- .../prompts/node/agent/openai/gpt51Prompt.tsx | 8 ++++--- .../node/agent/openai/gpt5CodexPrompt.tsx | 4 +++- .../prompts/node/agent/openai/gpt5Prompt.tsx | 8 ++++--- ...non_edit_tools-claude-sonnet-4.5.spec.snap | 24 +++++++++++++++++++ ..._non_edit_tools-gemini-2.0-flash.spec.snap | 24 +++++++++++++++++++ ...ompts-all_non_edit_tools-gpt-4.1.spec.snap | 24 +++++++++++++++++++ ...on_edit_tools-gpt-5.1-codex-mini.spec.snap | 24 +++++++++++++++++++ ...all_non_edit_tools-gpt-5.1-codex.spec.snap | 24 +++++++++++++++++++ ...ompts-all_non_edit_tools-gpt-5.1.spec.snap | 24 +++++++++++++++++++ ...Prompts-all_non_edit_tools-gpt-5.spec.snap | 24 +++++++++++++++++++ ..._non_edit_tools-grok-code-fast-1.spec.snap | 24 +++++++++++++++++++ ...mpts-all_tools-claude-sonnet-4.5.spec.snap | 24 +++++++++++++++++++ ...ompts-all_tools-gemini-2.0-flash.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-all_tools-gpt-4.1.spec.snap | 24 +++++++++++++++++++ ...pts-all_tools-gpt-5.1-codex-mini.spec.snap | 24 +++++++++++++++++++ ...tPrompts-all_tools-gpt-5.1-codex.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-all_tools-gpt-5.1.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-all_tools-gpt-5.spec.snap | 24 +++++++++++++++++++ ...ompts-all_tools-grok-code-fast-1.spec.snap | 24 +++++++++++++++++++ ...mpts-cache_BPs-claude-sonnet-4.5.spec.snap | 24 +++++++++++++++++++ ...ompts-cache_BPs-gemini-2.0-flash.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-cache_BPs-gpt-4.1.spec.snap | 24 +++++++++++++++++++ ...pts-cache_BPs-gpt-5.1-codex-mini.spec.snap | 24 +++++++++++++++++++ ...tPrompts-cache_BPs-gpt-5.1-codex.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-cache_BPs-gpt-5.1.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-cache_BPs-gpt-5.spec.snap | 24 +++++++++++++++++++ ...ompts-cache_BPs-grok-code-fast-1.spec.snap | 24 +++++++++++++++++++ ...Ps_multi_round-claude-sonnet-4.5.spec.snap | 24 +++++++++++++++++++ ...BPs_multi_round-gemini-2.0-flash.spec.snap | 24 +++++++++++++++++++ ...ts-cache_BPs_multi_round-gpt-4.1.spec.snap | 24 +++++++++++++++++++ ...s_multi_round-gpt-5.1-codex-mini.spec.snap | 24 +++++++++++++++++++ ...he_BPs_multi_round-gpt-5.1-codex.spec.snap | 24 +++++++++++++++++++ ...ts-cache_BPs_multi_round-gpt-5.1.spec.snap | 24 +++++++++++++++++++ ...mpts-cache_BPs_multi_round-gpt-5.spec.snap | 24 +++++++++++++++++++ ...BPs_multi_round-grok-code-fast-1.spec.snap | 24 +++++++++++++++++++ ...system_message-claude-sonnet-4.5.spec.snap | 24 +++++++++++++++++++ ..._system_message-gemini-2.0-flash.spec.snap | 24 +++++++++++++++++++ ...ns_not_in_system_message-gpt-4.1.spec.snap | 24 +++++++++++++++++++ ...ystem_message-gpt-5.1-codex-mini.spec.snap | 24 +++++++++++++++++++ ..._in_system_message-gpt-5.1-codex.spec.snap | 24 +++++++++++++++++++ ...ns_not_in_system_message-gpt-5.1.spec.snap | 24 +++++++++++++++++++ ...ions_not_in_system_message-gpt-5.spec.snap | 24 +++++++++++++++++++ ..._system_message-grok-code-fast-1.spec.snap | 24 +++++++++++++++++++ ...one_attachment-claude-sonnet-4.5.spec.snap | 24 +++++++++++++++++++ ...-one_attachment-gemini-2.0-flash.spec.snap | 24 +++++++++++++++++++ ...ntPrompts-one_attachment-gpt-4.1.spec.snap | 24 +++++++++++++++++++ ...ne_attachment-gpt-5.1-codex-mini.spec.snap | 24 +++++++++++++++++++ ...pts-one_attachment-gpt-5.1-codex.spec.snap | 24 +++++++++++++++++++ ...ntPrompts-one_attachment-gpt-5.1.spec.snap | 24 +++++++++++++++++++ ...gentPrompts-one_attachment-gpt-5.spec.snap | 24 +++++++++++++++++++ ...-one_attachment-grok-code-fast-1.spec.snap | 24 +++++++++++++++++++ ...ts-simple_case-claude-sonnet-4.5.spec.snap | 24 +++++++++++++++++++ ...pts-simple_case-gemini-2.0-flash.spec.snap | 24 +++++++++++++++++++ ...agentPrompts-simple_case-gpt-4.1.spec.snap | 24 +++++++++++++++++++ ...s-simple_case-gpt-5.1-codex-mini.spec.snap | 24 +++++++++++++++++++ ...rompts-simple_case-gpt-5.1-codex.spec.snap | 24 +++++++++++++++++++ ...agentPrompts-simple_case-gpt-5.1.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-simple_case-gpt-5.spec.snap | 24 +++++++++++++++++++ ...pts-simple_case-grok-code-fast-1.spec.snap | 24 +++++++++++++++++++ ...ompts-tool_use-claude-sonnet-4.5.spec.snap | 24 +++++++++++++++++++ ...rompts-tool_use-gemini-2.0-flash.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-tool_use-gpt-4.1.spec.snap | 24 +++++++++++++++++++ ...mpts-tool_use-gpt-5.1-codex-mini.spec.snap | 24 +++++++++++++++++++ ...ntPrompts-tool_use-gpt-5.1-codex.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-tool_use-gpt-5.1.spec.snap | 24 +++++++++++++++++++ .../agentPrompts-tool_use-gpt-5.spec.snap | 24 +++++++++++++++++++ ...rompts-tool_use-grok-code-fast-1.spec.snap | 24 +++++++++++++++++++ 69 files changed, 1554 insertions(+), 8 deletions(-) diff --git a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx index a9b725f69e..78b74cf532 100644 --- a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx @@ -13,6 +13,7 @@ import { EXISTING_CODE_MARKER } from '../../panel/codeBlockFormattingRules'; import { MathIntegrationRules } from '../../panel/editorIntegrationRules'; import { KeepGoingReminder } from '../agentPrompt'; import { ApplyPatchInstructions, CodesearchModeInstructions, DefaultAgentPromptProps, detectToolCapabilities, GenericEditingTips, McpToolInstructions, NotebookInstructions } from '../defaultAgentInstructions'; +import { FileLinkificationInstructions } from '../fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from '../promptRegistry'; export class DefaultOpenAIAgentPrompt extends PromptElement { @@ -108,6 +109,7 @@ export class DefaultOpenAIAgentPrompt extends PromptElement + ; } } diff --git a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx index ff0760d677..e62f73bf8f 100644 --- a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx @@ -10,6 +10,7 @@ import { InstructionMessage } from '../../base/instructionMessage'; import { Tag } from '../../base/tag'; import { MathIntegrationRules } from '../../panel/editorIntegrationRules'; import { DefaultAgentPromptProps, detectToolCapabilities } from '../defaultAgentInstructions'; +import { FileLinkificationInstructions } from '../fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from '../promptRegistry'; /** @@ -69,7 +70,7 @@ class Gpt51CodexPrompt extends PromptElement { - Markdown text. Use structure only when it helps scanability.
- Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help.
- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.
- - Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.
+ - Monospace: backticks for commands, env vars, and code identifiers; DO NOT backtick file paths when citing code lines—use markdown links with #Lstart or #Lstart-Lend anchors per linkification rules; never combine with **.
- Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible.
- Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.
- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.
@@ -83,6 +84,7 @@ class Gpt51CodexPrompt extends PromptElement { + ; } } diff --git a/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx index 2d9d1d3292..3cbc3024b1 100644 --- a/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx @@ -12,6 +12,7 @@ import { ResponseTranslationRules } from '../../base/responseTranslationRules'; import { Tag } from '../../base/tag'; import { MathIntegrationRules } from '../../panel/editorIntegrationRules'; import { ApplyPatchInstructions, DefaultAgentPromptProps, detectToolCapabilities, McpToolInstructions } from '../defaultAgentInstructions'; +import { FileLinkificationInstructions } from '../fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from '../promptRegistry'; class Gpt51Prompt extends PromptElement { @@ -219,9 +220,9 @@ class Gpt51Prompt extends PromptElement {
**Monospace**

- - Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``).
- - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.
- - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``).
+ - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). Do NOT backtick file paths when citing code; instead produce markdown links with line anchors (#Lstart or #Lstart-Lend) following file linkification rules.
+ - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command (excluding file paths needing line anchors).
+ - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). File path links must not be bold or backticked.

**Structure**

@@ -260,6 +261,7 @@ class Gpt51Prompt extends PromptElement { For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + ; } } diff --git a/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx index 1946ae24aa..0b3dadda04 100644 --- a/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx @@ -8,6 +8,7 @@ import { IChatEndpoint } from '../../../../../platform/networking/common/network import { ToolName } from '../../../../tools/common/toolNames'; import { InstructionMessage } from '../../base/instructionMessage'; import { DefaultAgentPromptProps, detectToolCapabilities } from '../defaultAgentInstructions'; +import { FileLinkificationInstructions } from '../fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from '../promptRegistry'; class CodexStyleGpt5CodexPrompt extends PromptElement { @@ -69,7 +70,7 @@ class CodexStyleGpt5CodexPrompt extends PromptElement { - Markdown text. Use structure only when it helps scanability.
- Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help.
- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.
- - Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.
+ - Monospace: backticks for commands, env vars, and code identifiers; DO NOT backtick file paths when citing code lines—use markdown links with #Lstart or #Lstart-Lend anchors per linkification rules; never combine with **.
- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.
- Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.
- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.
@@ -81,6 +82,7 @@ class CodexStyleGpt5CodexPrompt extends PromptElement { * Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.
* Do not use URIs like file://, vscode://, or https://.
* Examples: src/app.ts, C:\repo\project\main.rs
+ ; } } diff --git a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx index 57b5f12032..5d1a7dec40 100644 --- a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx @@ -12,6 +12,7 @@ import { ResponseTranslationRules } from '../../base/responseTranslationRules'; import { Tag } from '../../base/tag'; import { MathIntegrationRules } from '../../panel/editorIntegrationRules'; import { ApplyPatchInstructions, DefaultAgentPromptProps, detectToolCapabilities, McpToolInstructions } from '../defaultAgentInstructions'; +import { FileLinkificationInstructions } from '../fileLinkificationInstructions'; import { IAgentPrompt, PromptConstructor, PromptRegistry } from '../promptRegistry'; class DefaultGpt5AgentPrompt extends PromptElement { @@ -183,9 +184,9 @@ class DefaultGpt5AgentPrompt extends PromptElement { - Use consistent keyword phrasing and formatting across sections.

Monospace:
- - Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``).
- - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.
- - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``).
+ - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). Do NOT backtick file paths when citing code; instead produce a markdown link with line anchors (#Lstart or #Lstart-Lend) per file linkification rules.
+ - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command (excluding file paths needing line anchors).
+ - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). File path links must not be bold or backticked.

Structure:
- Place related bullets together; don't mix unrelated concepts in the same section.
@@ -220,6 +221,7 @@ class DefaultGpt5AgentPrompt extends PromptElement { + ; } } diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap index 70b4100628..da70d5df24 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap @@ -80,6 +80,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap index 655e5bcdea..b9b8ca6ed4 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap @@ -49,6 +49,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap index 8d32f34608..d3d98737b0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap @@ -53,6 +53,30 @@ You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap index 94325df1bd..ba2689697c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap index 94325df1bd..ba2689697c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap index cc85a36bdd..3a01bbb66e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap @@ -235,6 +235,30 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap index e0656a44b4..fc929d1816 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap @@ -204,6 +204,30 @@ The class `Person` is in `src/models/person.ts`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap index 4a1c00c45f..10bd405047 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap @@ -56,6 +56,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap index 677dfcbe7e..dd50113b79 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap @@ -81,6 +81,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap index da269da3a4..9778d5e46f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap @@ -51,6 +51,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap index b63e3af0d5..a378f9a426 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap @@ -89,6 +89,30 @@ You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap index e8d2e765bf..9f71656eb7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap index e8d2e765bf..9f71656eb7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap index d6f1808259..4e0025bfcd 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap @@ -270,6 +270,30 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap index 690ec7e334..1859e4280d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap @@ -240,6 +240,30 @@ The class `Person` is in `src/models/person.ts`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap index 19c05fa248..15e6a9e8cf 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap @@ -58,6 +58,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap index d5c9cee984..9ecdff37bb 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap @@ -68,6 +68,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap index a78efb1ab8..76a017c91c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap @@ -38,6 +38,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap index cd886bb49c..fc755ea1d3 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap @@ -42,6 +42,30 @@ You can find the configuration in `config/app.config.json`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap index 2c228b4ca4..7f75010df9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`.
+ +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap index 2c228b4ca4..7f75010df9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap index fe5116bd1b..fd3182ae62 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap @@ -235,6 +235,30 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap index 8338dc6ec5..715c38eb50 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap @@ -204,6 +204,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap index 8596b3e4f7..e693a1b45c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap @@ -45,6 +45,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap index 2b5882ecd8..8160142ada 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap @@ -68,6 +68,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap index 0c04f7e4cf..04cf9b71c7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap @@ -38,6 +38,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap index 3c05b2bc37..c3b89cca59 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap @@ -42,6 +42,30 @@ You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap index 93561efc31..18c7374f14 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap index 93561efc31..18c7374f14 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap index d58fede5fe..1312504708 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap @@ -235,6 +235,30 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap index 697d75b130..7fad7ae599 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap @@ -204,6 +204,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap index a198c09a07..1cd2142359 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap @@ -45,6 +45,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap index e2854c1d5a..c2d0072471 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap @@ -68,6 +68,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap index 3b3c5901b0..f5d031ad2c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap @@ -38,6 +38,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap index 1122fce6a1..3c56f816b6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap @@ -42,6 +42,30 @@ You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap index b64d0ae9d9..84385058af 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap index b64d0ae9d9..84385058af 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap index 1cd60ccbb0..44fd523d3b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap @@ -235,6 +235,30 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap index d4ac4fb9f2..3aa4598213 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap @@ -204,6 +204,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap index 6ec32c59da..0f4ba6e6be 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap @@ -45,6 +45,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap index 658e151596..ed536104d0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap @@ -68,6 +68,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap index c2e74a3615..dab6460d55 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap @@ -38,6 +38,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap index da9cabbbbb..ff27e1a960 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap @@ -42,6 +42,30 @@ You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap index 2501dd8e21..8f0df55d7d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap index 2501dd8e21..8f0df55d7d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap index 1a8c5ca331..98e4b3ea47 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap @@ -235,6 +235,30 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap index 878d9c6ac4..8d269433d6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap @@ -204,6 +204,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap index 5b37e1931a..951acfd4ce 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap @@ -45,6 +45,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap index a31e7b0aae..e20b7032b3 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap @@ -68,6 +68,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap index f1af247874..b5ba146d66 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap @@ -38,6 +38,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap index 1244d6fd64..43ff3602aa 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap @@ -42,6 +42,30 @@ You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap index 94325df1bd..ba2689697c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap index 94325df1bd..ba2689697c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap index cc85a36bdd..3a01bbb66e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap @@ -235,6 +235,30 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap index e0656a44b4..fc929d1816 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap @@ -204,6 +204,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap index da93b9b0ca..ea5337cdb4 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap @@ -45,6 +45,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap index 847b811727..c4452d538f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap @@ -68,6 +68,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap index e45a9d08a9..e3e7da25be 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap @@ -38,6 +38,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap index 8e4fda165f..bd39956562 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap @@ -42,6 +42,30 @@ You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap index b5ef16d4d2..b27d2ebb01 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap index b5ef16d4d2..b27d2ebb01 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap @@ -61,6 +61,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap index 39b40cef78..7d830048ff 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap @@ -235,6 +235,30 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap index 017a011231..dbf6b09631 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap @@ -204,6 +204,30 @@ The class `Person` is in `src/models/person.ts`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap index 906c460648..c164b8c60d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap @@ -45,6 +45,30 @@ The class `Person` is in `src/models/person.ts`. The function `calculateTotal` is defined in `lib/utils/math.ts`. You can find the configuration in `config/app.config.json`. + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. +Format examples: +- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) +- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) +When you need a bullet list of references with line numbers, you can use descriptive text: +- [Await chat view](path/to/chatQuick.ts#L142) +- [Show widget](path/to/chatQuick.ts#L321) +NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` +Critical rules: +- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. +- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. +- Path format: Strip drive letters and workspace parent folders - use only path after workspace root +- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` +- Always use forward slashes `/`, never backslashes `/` +- Do not use URIs like file://, vscode://, or https://. +- Percent-encode spaces in target only: `[My File.md](My%20File.md)` +- Each file reference needs complete path (don't abbreviate repeated files) +- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges +- Don't wrap links in backticks; only cite existing paths from context + + From a26acc2b98997b8b19b56502c8036b421d60c9db Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 13:59:43 -0800 Subject: [PATCH 12/25] prompt and snapshot updates --- .../prompts/node/agent/anthropicPrompts.tsx | 14 ++++++-------- src/extension/prompts/node/agent/geminiPrompts.tsx | 7 +++---- .../node/agent/openai/defaultOpenAIPrompt.tsx | 7 +++---- .../prompts/node/agent/openai/gpt51CodexPrompt.tsx | 3 ++- .../prompts/node/agent/openai/gpt51Prompt.tsx | 7 ++++--- .../prompts/node/agent/openai/gpt5CodexPrompt.tsx | 9 ++------- .../prompts/node/agent/openai/gpt5Prompt.tsx | 7 ++++--- ...-all_non_edit_tools-claude-sonnet-4.5.spec.snap | 7 +++---- ...s-all_non_edit_tools-gemini-2.0-flash.spec.snap | 7 +++---- ...entPrompts-all_non_edit_tools-gpt-4.1.spec.snap | 8 ++++---- ...all_non_edit_tools-gpt-5.1-codex-mini.spec.snap | 3 ++- ...mpts-all_non_edit_tools-gpt-5.1-codex.spec.snap | 3 ++- ...entPrompts-all_non_edit_tools-gpt-5.1.spec.snap | 5 +++-- ...agentPrompts-all_non_edit_tools-gpt-5.spec.snap | 5 +++-- ...s-all_non_edit_tools-grok-code-fast-1.spec.snap | 7 +++---- ...ntPrompts-all_tools-claude-sonnet-4.5.spec.snap | 7 +++---- ...entPrompts-all_tools-gemini-2.0-flash.spec.snap | 7 +++---- .../agentPrompts-all_tools-gpt-4.1.spec.snap | 8 ++++---- ...tPrompts-all_tools-gpt-5.1-codex-mini.spec.snap | 3 ++- .../agentPrompts-all_tools-gpt-5.1-codex.spec.snap | 3 ++- .../agentPrompts-all_tools-gpt-5.1.spec.snap | 5 +++-- .../agentPrompts-all_tools-gpt-5.spec.snap | 5 +++-- ...entPrompts-all_tools-grok-code-fast-1.spec.snap | 7 +++---- ...ntPrompts-cache_BPs-claude-sonnet-4.5.spec.snap | 7 +++---- ...entPrompts-cache_BPs-gemini-2.0-flash.spec.snap | 7 +++---- .../agentPrompts-cache_BPs-gpt-4.1.spec.snap | 8 ++++---- ...tPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap | 3 ++- .../agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap | 3 ++- .../agentPrompts-cache_BPs-gpt-5.1.spec.snap | 5 +++-- .../agentPrompts-cache_BPs-gpt-5.spec.snap | 5 +++-- ...entPrompts-cache_BPs-grok-code-fast-1.spec.snap | 7 +++---- ...che_BPs_multi_round-claude-sonnet-4.5.spec.snap | 7 +++---- ...ache_BPs_multi_round-gemini-2.0-flash.spec.snap | 7 +++---- ...Prompts-cache_BPs_multi_round-gpt-4.1.spec.snap | 8 ++++---- ...he_BPs_multi_round-gpt-5.1-codex-mini.spec.snap | 3 ++- ...s-cache_BPs_multi_round-gpt-5.1-codex.spec.snap | 3 ++- ...Prompts-cache_BPs_multi_round-gpt-5.1.spec.snap | 5 +++-- ...ntPrompts-cache_BPs_multi_round-gpt-5.spec.snap | 5 +++-- ...ache_BPs_multi_round-grok-code-fast-1.spec.snap | 7 +++---- ...t_in_system_message-claude-sonnet-4.5.spec.snap | 7 +++---- ...ot_in_system_message-gemini-2.0-flash.spec.snap | 7 +++---- ...uctions_not_in_system_message-gpt-4.1.spec.snap | 8 ++++---- ..._in_system_message-gpt-5.1-codex-mini.spec.snap | 3 ++- ...s_not_in_system_message-gpt-5.1-codex.spec.snap | 3 ++- ...uctions_not_in_system_message-gpt-5.1.spec.snap | 5 +++-- ...tructions_not_in_system_message-gpt-5.spec.snap | 5 +++-- ...ot_in_system_message-grok-code-fast-1.spec.snap | 7 +++---- ...mpts-one_attachment-claude-sonnet-4.5.spec.snap | 7 +++---- ...ompts-one_attachment-gemini-2.0-flash.spec.snap | 7 +++---- .../agentPrompts-one_attachment-gpt-4.1.spec.snap | 8 ++++---- ...pts-one_attachment-gpt-5.1-codex-mini.spec.snap | 3 ++- ...tPrompts-one_attachment-gpt-5.1-codex.spec.snap | 3 ++- .../agentPrompts-one_attachment-gpt-5.1.spec.snap | 5 +++-- .../agentPrompts-one_attachment-gpt-5.spec.snap | 5 +++-- ...ompts-one_attachment-grok-code-fast-1.spec.snap | 7 +++---- ...Prompts-simple_case-claude-sonnet-4.5.spec.snap | 7 +++---- ...tPrompts-simple_case-gemini-2.0-flash.spec.snap | 7 +++---- .../agentPrompts-simple_case-gpt-4.1.spec.snap | 8 ++++---- ...rompts-simple_case-gpt-5.1-codex-mini.spec.snap | 3 ++- ...gentPrompts-simple_case-gpt-5.1-codex.spec.snap | 3 ++- .../agentPrompts-simple_case-gpt-5.1.spec.snap | 5 +++-- .../agentPrompts-simple_case-gpt-5.spec.snap | 5 +++-- ...tPrompts-simple_case-grok-code-fast-1.spec.snap | 7 +++---- ...entPrompts-tool_use-claude-sonnet-4.5.spec.snap | 7 +++---- ...gentPrompts-tool_use-gemini-2.0-flash.spec.snap | 7 +++---- .../agentPrompts-tool_use-gpt-4.1.spec.snap | 8 ++++---- ...ntPrompts-tool_use-gpt-5.1-codex-mini.spec.snap | 3 ++- .../agentPrompts-tool_use-gpt-5.1-codex.spec.snap | 3 ++- .../agentPrompts-tool_use-gpt-5.1.spec.snap | 5 +++-- .../agentPrompts-tool_use-gpt-5.spec.snap | 5 +++-- ...gentPrompts-tool_use-grok-code-fast-1.spec.snap | 7 +++---- src/extension/prompts/node/agent/xAIPrompts.tsx | 7 +++---- src/platform/endpoint/common/capiClient.ts | 7 +++++-- src/platform/endpoint/node/capiClientImpl.ts | 3 ++- 74 files changed, 218 insertions(+), 213 deletions(-) diff --git a/src/extension/prompts/node/agent/anthropicPrompts.tsx b/src/extension/prompts/node/agent/anthropicPrompts.tsx index 974cb1daf8..42381db300 100644 --- a/src/extension/prompts/node/agent/anthropicPrompts.tsx +++ b/src/extension/prompts/node/agent/anthropicPrompts.tsx @@ -99,11 +99,10 @@ class DefaultAnthropicAgentPrompt extends PromptElement {this.props.availableTools && } - Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ Use proper Markdown formatting. Backtick code symbols (classes, functions, variables, commands). For file paths and specific code locations, defer to the linking rules in `FileLinkificationInstructions` below (do not backtick paths; use markdown links with line anchors).
- The class `Person` is in `src/models/person.ts`.
- The function `calculateTotal` is defined in `lib/utils/math.ts`.
- You can find the configuration in `config/app.config.json`. + Use backticks for identifiers: `Person`, `calculateTotal`, `config`.
+ See FileLinkificationInstructions for file path link and line anchor rules and examples.
@@ -196,11 +195,10 @@ class Claude45DefaultPrompt extends PromptElement { {this.props.availableTools && } - Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks).
- The class `Person` is in `src/models/person.ts`.
- The function `calculateTotal` is defined in `lib/utils/math.ts`.
- You can find the configuration in `config/app.config.json`. + Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`.
+ File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below.
diff --git a/src/extension/prompts/node/agent/geminiPrompts.tsx b/src/extension/prompts/node/agent/geminiPrompts.tsx index 22a166d8c0..a89668e92b 100644 --- a/src/extension/prompts/node/agent/geminiPrompts.tsx +++ b/src/extension/prompts/node/agent/geminiPrompts.tsx @@ -102,11 +102,10 @@ export class DefaultGeminiAgentPrompt extends PromptElement} - Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below.
- The class `Person` is in `src/models/person.ts`.
- The function `calculateTotal` is defined in `lib/utils/math.ts`.
- You can find the configuration in `config/app.config.json`. + Identifiers: `Person`, `calculateTotal`, `AppConfig`.
+ File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below.
diff --git a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx index 78b74cf532..f2bbabc7f9 100644 --- a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx @@ -100,11 +100,10 @@ export class DefaultOpenAIAgentPrompt extends PromptElement} - Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here.
- The class `Person` is in `src/models/person.ts`.
- The function `calculateTotal` is defined in `lib/utils/math.ts`.
- You can find the configuration in `config/app.config.json`. + Identifiers only: `calculateTotal`, `Person`, `AppConfig`.
+ File path link examples live in FileLinkificationInstructions.
diff --git a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx index e62f73bf8f..43de50ef6d 100644 --- a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx @@ -70,7 +70,8 @@ class Gpt51CodexPrompt extends PromptElement { - Markdown text. Use structure only when it helps scanability.
- Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help.
- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.
- - Monospace: backticks for commands, env vars, and code identifiers; DO NOT backtick file paths when citing code lines—use markdown links with #Lstart or #Lstart-Lend anchors per linkification rules; never combine with **.
+ - Monospace: backticks for commands, env vars, and code identifiers; never combine with **.
+ - File path + line anchor link rules are defined in `FileLinkificationInstructions` below.
- Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible.
- Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.
- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.
diff --git a/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx index 3cbc3024b1..0bb3ea2e6a 100644 --- a/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx @@ -220,9 +220,10 @@ class Gpt51Prompt extends PromptElement {
**Monospace**

- - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). Do NOT backtick file paths when citing code; instead produce markdown links with line anchors (#Lstart or #Lstart-Lend) following file linkification rules.
- - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command (excluding file paths needing line anchors).
- - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). File path links must not be bold or backticked.
+ - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``).
+ - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.
+ - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`).
+ - File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below.

**Structure**

diff --git a/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx index 0b3dadda04..e22abe9924 100644 --- a/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx @@ -70,18 +70,13 @@ class CodexStyleGpt5CodexPrompt extends PromptElement { - Markdown text. Use structure only when it helps scanability.
- Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help.
- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.
- - Monospace: backticks for commands, env vars, and code identifiers; DO NOT backtick file paths when citing code lines—use markdown links with #Lstart or #Lstart-Lend anchors per linkification rules; never combine with **.
+ - Monospace: backticks for commands, env vars, and code identifiers; never combine with **.
- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.
- Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.
- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.
- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short—wrap/reformat if long; avoid naming formatting styles in answers.
- Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets.
- - File References: When referencing files in your response, always follow the below rules:
- * Use inline code to make file paths clickable.
- * Each reference should have a stand alone path. Even if it's the same file.
- * Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.
- * Do not use URIs like file://, vscode://, or https://.
- * Examples: src/app.ts, C:\repo\project\main.rs
+ - File path and line anchor link rules are defined in `FileLinkificationInstructions` below (do not duplicate examples).
; } diff --git a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx index 5d1a7dec40..47ec642d53 100644 --- a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx @@ -184,9 +184,10 @@ class DefaultGpt5AgentPrompt extends PromptElement { - Use consistent keyword phrasing and formatting across sections.

Monospace:
- - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). Do NOT backtick file paths when citing code; instead produce a markdown link with line anchors (#Lstart or #Lstart-Lend) per file linkification rules.
- - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command (excluding file paths needing line anchors).
- - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). File path links must not be bold or backticked.
+ - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``).
+ - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.
+ - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`).
+ - File path and line anchor link rules are defined in `FileLinkificationInstructions` below.

Structure:
- Place related bullets together; don't mix unrelated concepts in the same section.
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap index da70d5df24..623b8e65b0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap @@ -74,11 +74,10 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap index b9b8ca6ed4..b170d6e6a5 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap @@ -43,11 +43,10 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap index d3d98737b0..fb28732f1e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap @@ -45,11 +45,11 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `calculateTotal`, `Person`, `AppConfig`. +File path link examples live in FileLinkificationInstructions. + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap index ba2689697c..08ba72669c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap index ba2689697c..08ba72669c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap index 3a01bbb66e..5b8bcb2729 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap @@ -195,9 +195,10 @@ You are producing plain text that will later be styled by the CLI. Follow these **Monospace** -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. **Structure** diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap index fc929d1816..854d0d8872 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap @@ -168,9 +168,10 @@ Bullets: - Use consistent keyword phrasing and formatting across sections. Monospace: -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap index 10bd405047..ac70ce8511 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap @@ -50,11 +50,10 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap index dd50113b79..ccff09b92c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap @@ -75,11 +75,10 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap index 9778d5e46f..9e3ac37c3d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap @@ -45,11 +45,10 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap index a378f9a426..3e4470fdf8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap @@ -81,11 +81,11 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `calculateTotal`, `Person`, `AppConfig`. +File path link examples live in FileLinkificationInstructions. + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap index 9f71656eb7..f372174677 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap index 9f71656eb7..f372174677 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap index 4e0025bfcd..f621ccc7e7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap @@ -230,9 +230,10 @@ You are producing plain text that will later be styled by the CLI. Follow these **Monospace** -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. **Structure** diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap index 1859e4280d..cf1a233bc9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap @@ -204,9 +204,10 @@ Bullets: - Use consistent keyword phrasing and formatting across sections. Monospace: -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap index 15e6a9e8cf..973f8a1915 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap @@ -52,11 +52,10 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap index 9ecdff37bb..50963b9f8c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap @@ -62,11 +62,10 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap index 76a017c91c..2c344eeaa1 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap @@ -32,11 +32,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap index fc755ea1d3..c9c03bbd5d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap @@ -34,11 +34,11 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `calculateTotal`, `Person`, `AppConfig`. +File path link examples live in FileLinkificationInstructions. + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap index 7f75010df9..c119f8b11b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap index 7f75010df9..c119f8b11b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap index fd3182ae62..bce627c407 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap @@ -195,9 +195,10 @@ You are producing plain text that will later be styled by the CLI. Follow these **Monospace** -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. **Structure** diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap index 715c38eb50..5ffa69b873 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap @@ -168,9 +168,10 @@ Bullets: - Use consistent keyword phrasing and formatting across sections. Monospace: -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap index e693a1b45c..aa93328517 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap @@ -39,11 +39,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap index 8160142ada..d59c580ed5 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap @@ -62,11 +62,10 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap index 04cf9b71c7..21344d3727 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap @@ -32,11 +32,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap index c3b89cca59..d788a3e377 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap @@ -34,11 +34,11 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `calculateTotal`, `Person`, `AppConfig`. +File path link examples live in FileLinkificationInstructions. + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap index 18c7374f14..b4cdb0b3fe 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap index 18c7374f14..b4cdb0b3fe 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap index 1312504708..3da1e448b7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap @@ -195,9 +195,10 @@ You are producing plain text that will later be styled by the CLI. Follow these **Monospace** -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. **Structure** diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap index 7fad7ae599..0fe439fd3f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap @@ -168,9 +168,10 @@ Bullets: - Use consistent keyword phrasing and formatting across sections. Monospace: -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap index 1cd2142359..f8ba7de6a2 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap @@ -39,11 +39,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap index c2d0072471..0ac849e047 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap @@ -62,11 +62,10 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap index f5d031ad2c..b9877da01e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap @@ -32,11 +32,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap index 3c56f816b6..75361a14df 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap @@ -34,11 +34,11 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `calculateTotal`, `Person`, `AppConfig`. +File path link examples live in FileLinkificationInstructions. + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap index 84385058af..827d4b80a8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap index 84385058af..827d4b80a8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap index 44fd523d3b..4c29bb4f8e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap @@ -195,9 +195,10 @@ You are producing plain text that will later be styled by the CLI. Follow these **Monospace** -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. **Structure** diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap index 3aa4598213..88ee582c71 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap @@ -168,9 +168,10 @@ Bullets: - Use consistent keyword phrasing and formatting across sections. Monospace: -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap index 0f4ba6e6be..420cebfbe6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap @@ -39,11 +39,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap index ed536104d0..e81e8f0ec3 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap @@ -62,11 +62,10 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap index dab6460d55..a08b85e47b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap @@ -32,11 +32,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap index ff27e1a960..12056ec50a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap @@ -34,11 +34,11 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `calculateTotal`, `Person`, `AppConfig`. +File path link examples live in FileLinkificationInstructions. + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap index 8f0df55d7d..51c295a221 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap index 8f0df55d7d..51c295a221 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap index 98e4b3ea47..8f5eab6fb6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap @@ -195,9 +195,10 @@ You are producing plain text that will later be styled by the CLI. Follow these **Monospace** -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. **Structure** diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap index 8d269433d6..ca4e4b8d5a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap @@ -168,9 +168,10 @@ Bullets: - Use consistent keyword phrasing and formatting across sections. Monospace: -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap index 951acfd4ce..34b4217e5a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap @@ -39,11 +39,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap index e20b7032b3..22717a59f6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap @@ -62,11 +62,10 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap index b5ba146d66..9d23e0ddd2 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap @@ -32,11 +32,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap index 43ff3602aa..6b0c186f15 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap @@ -34,11 +34,11 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `calculateTotal`, `Person`, `AppConfig`. +File path link examples live in FileLinkificationInstructions. + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap index ba2689697c..08ba72669c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap index ba2689697c..08ba72669c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap index 3a01bbb66e..5b8bcb2729 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap @@ -195,9 +195,10 @@ You are producing plain text that will later be styled by the CLI. Follow these **Monospace** -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. **Structure** diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap index fc929d1816..854d0d8872 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap @@ -168,9 +168,10 @@ Bullets: - Use consistent keyword phrasing and formatting across sections. Monospace: -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap index ea5337cdb4..ab6691a485 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap @@ -39,11 +39,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap index c4452d538f..f057bda5df 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap @@ -62,11 +62,10 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap index e3e7da25be..8458148a46 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap @@ -32,11 +32,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap index bd39956562..fc1b73b8ac 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap @@ -34,11 +34,11 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `calculateTotal`, `Person`, `AppConfig`. +File path link examples live in FileLinkificationInstructions. + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap index b27d2ebb01..a7b0e40964 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap index b27d2ebb01..a7b0e40964 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap index 7d830048ff..7eff226675 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap @@ -195,9 +195,10 @@ You are producing plain text that will later be styled by the CLI. Follow these **Monospace** -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. **Structure** diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap index dbf6b09631..18c559d52e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap @@ -168,9 +168,10 @@ Bullets: - Use consistent keyword phrasing and formatting across sections. Monospace: -- Wrap all commands, file paths, env vars, and code identifiers in backticks (`` `...` ``). +- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. -- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`) or inline code/path (`` ` ``). +- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). +- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap index c164b8c60d..b2a1ffbf7d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap @@ -39,11 +39,10 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. +Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. +Identifiers only: `Person`, `calculateTotal`, `AppConfig`. +File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. diff --git a/src/extension/prompts/node/agent/xAIPrompts.tsx b/src/extension/prompts/node/agent/xAIPrompts.tsx index 61bae78059..db3ee86ea0 100644 --- a/src/extension/prompts/node/agent/xAIPrompts.tsx +++ b/src/extension/prompts/node/agent/xAIPrompts.tsx @@ -106,11 +106,10 @@ class DefaultGrokCodeFastAgentPrompt extends PromptElement} - Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.
+ Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below.
- The class `Person` is in `src/models/person.ts`.
- The function `calculateTotal` is defined in `lib/utils/math.ts`.
- You can find the configuration in `config/app.config.json`. + Identifiers only: `Person`, `calculateTotal`, `AppConfig`.
+ File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below.
diff --git a/src/platform/endpoint/common/capiClient.ts b/src/platform/endpoint/common/capiClient.ts index c86117958e..f615390c02 100644 --- a/src/platform/endpoint/common/capiClient.ts +++ b/src/platform/endpoint/common/capiClient.ts @@ -18,12 +18,14 @@ export interface ICAPIClientService extends CAPIClient { export abstract class BaseCAPIClientService extends CAPIClient implements ICAPIClientService { readonly _serviceBrand: undefined; + readonly integrationId: string | undefined; constructor( hmac: string | undefined, integrationId: string | undefined, fetcherService: IFetcherService, - envService: IEnvService + envService: IEnvService, + forceDevMode?: boolean ) { super({ machineId: envService.machineId, @@ -32,7 +34,8 @@ export abstract class BaseCAPIClientService extends CAPIClient implements ICAPIC buildType: envService.getBuildType(), name: envService.getName(), version: envService.getVersion(), - }, LICENSE_AGREEMENT, fetcherService, hmac, integrationId); + }, LICENSE_AGREEMENT, fetcherService, hmac, forceDevMode); + this.integrationId = integrationId; } } export const ICAPIClientService = createServiceIdentifier('ICAPIClientService'); diff --git a/src/platform/endpoint/node/capiClientImpl.ts b/src/platform/endpoint/node/capiClientImpl.ts index bd3afaad17..e88ffa1006 100644 --- a/src/platform/endpoint/node/capiClientImpl.ts +++ b/src/platform/endpoint/node/capiClientImpl.ts @@ -17,7 +17,8 @@ export class CAPIClientImpl extends BaseCAPIClientService { process.env.HMAC_SECRET, process.env.VSCODE_COPILOT_INTEGRATION_ID, fetcherService, - envService + envService, + undefined ); } } \ No newline at end of file From e1735b5ba1ba7243f1e22e6c0eba8e46dbb53efe Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 14:59:31 -0800 Subject: [PATCH 13/25] Feedback updates --- .../linkify/common/modelFilePathLinkifier.ts | 79 ++++++++++++------- .../test/node/modelFilePathLinkifier.spec.ts | 73 +++++++++++++++++ src/platform/endpoint/common/capiClient.ts | 9 +-- src/platform/endpoint/node/capiClientImpl.ts | 3 +- 4 files changed, 127 insertions(+), 37 deletions(-) diff --git a/src/extension/linkify/common/modelFilePathLinkifier.ts b/src/extension/linkify/common/modelFilePathLinkifier.ts index 85b7e38058..fc4b3dbea6 100644 --- a/src/extension/linkify/common/modelFilePathLinkifier.ts +++ b/src/extension/linkify/common/modelFilePathLinkifier.ts @@ -7,6 +7,7 @@ import { IFileSystemService } from '../../../platform/filesystem/common/fileSyst import { FileType } from '../../../platform/filesystem/common/fileTypes'; import { getWorkspaceFileDisplayPath, IWorkspaceService } from '../../../platform/workspace/common/workspaceService'; import { CancellationToken } from '../../../util/vs/base/common/cancellation'; +import { normalizePath as normalizeUriPath } from '../../../util/vs/base/common/resources'; import { Location, Position, Range, Uri } from '../../../vscodeTypes'; import { coalesceParts, LinkifiedPart, LinkifiedText, LinkifyLocationAnchor } from './linkifiedText'; import { IContributedLinkifier, LinkifierContext } from './linkifyService'; @@ -46,7 +47,7 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { } // Push promise to resolve in parallel with other matches - parts.push(this.resolveTarget(parsed.targetPath, workspaceFolders, parsed.preserveDirectorySlash).then(resolved => { + parts.push(this.resolveTarget(parsed.targetPath, workspaceFolders, parsed.preserveDirectorySlash, token).then(resolved => { if (!resolved) { return original; } @@ -129,31 +130,59 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { return Boolean(workspaceFolders.length) && (textMatchesBase || textIsFilename || descriptiveWithAnchor); } - private async resolveTarget(targetPath: string, workspaceFolders: readonly Uri[], preserveDirectorySlash: boolean): Promise { + private async resolveTarget(targetPath: string, workspaceFolders: readonly Uri[], preserveDirectorySlash: boolean, token: CancellationToken): Promise { if (!workspaceFolders.length) { return undefined; } - const folderUris = workspaceFolders.map(folder => this.toVsUri(folder)); + if (token.isCancellationRequested) { + return undefined; + } if (this.isAbsolutePath(targetPath)) { - const absoluteUri = this.tryCreateFileUri(targetPath); - if (!absoluteUri) { - return undefined; - } + // Choose URI construction strategy based on workspace folder schemes. + // For local (file:) workspaces we keep using Uri.file; for remote schemes we attempt + // to project the absolute path into the remote scheme preserving the folder URI's authority. + const normalizedAbs = targetPath.replace(/\\/g, '/'); + + for (const folderUri of workspaceFolders) { + if (token.isCancellationRequested) { + return undefined; + } + if (folderUri.scheme === 'file') { + const absoluteFileUri = this.tryCreateFileUri(targetPath); + if (!absoluteFileUri) { + continue; + } + if (this.isEqualOrParentFs(absoluteFileUri, folderUri)) { + const stat = await this.tryStat(absoluteFileUri, preserveDirectorySlash, token); + if (stat) { + return stat; + } + } + continue; + } - for (const folderUri of folderUris) { - if (this.isEqualOrParentFs(absoluteUri, folderUri)) { - return this.tryStat(absoluteUri, preserveDirectorySlash); + // Remote / virtual workspace: attempt to map the absolute path into the same scheme. + // Only consider it if the folder path is a prefix of the absolute path to avoid + // generating unrelated URIs. + const folderPath = folderUri.path.replace(/\\/g, '/'); + const prefix = folderPath.endsWith('/') ? folderPath : folderPath + '/'; + if (normalizedAbs.startsWith(prefix)) { + const candidate = folderUri.with({ path: normalizedAbs }); + const stat = await this.tryStat(candidate, preserveDirectorySlash, token); + if (stat) { + return stat; + } } } return undefined; } const segments = targetPath.split('/').filter(Boolean); - for (const folderUri of folderUris) { + for (const folderUri of workspaceFolders) { const candidate = Uri.joinPath(folderUri, ...segments); - const stat = await this.tryStat(candidate, preserveDirectorySlash); + const stat = await this.tryStat(candidate, preserveDirectorySlash, token); if (stat) { return stat; } @@ -170,29 +199,18 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { } } - private toVsUri(folder: Uri): Uri { - return Uri.parse(folder.toString()); - } private isEqualOrParentFs(target: Uri, folder: Uri): boolean { - const targetFs = this.normalizeFsPath(target); - const folderFs = this.normalizeFsPath(folder); - return targetFs === folderFs || targetFs.startsWith(folderFs.endsWith('/') ? folderFs : `${folderFs}/`); - } - - private normalizeFsPath(resource: Uri): string { - // Convert Windows backslashes to forward slashes and remove duplicate separators for stable comparisons. - return resource.fsPath.replace(/\\/g, '/').replace(/\/+/g, '/').toLowerCase(); + const targetPath = normalizeUriPath(target).path; + const folderPath = normalizeUriPath(folder).path; + return targetPath === folderPath || targetPath.startsWith(folderPath.endsWith('/') ? folderPath : `${folderPath}/`); } private parseAnchor(anchor: string | undefined): { readonly range: Range; readonly startLine: string; readonly endLine: string | undefined } | undefined { - // Ensure the anchor follows the #L123, #L123-456, or #L123-L456 format before parsing it. - if (!anchor || !/^L\d+(?:-L?\d+)?$/.test(anchor)) { + // Parse supported anchor formats: L123, L123-456, L123-L456 + if (!anchor) { return undefined; } - - // Capture the start (and optional end) line numbers from the anchor. - // Support both L123-456 and L123-L456 formats const match = /^L(\d+)(?:-L?(\d+))?$/.exec(anchor); if (!match) { return undefined; @@ -219,7 +237,10 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { return /^[a-z]:/i.test(path) || path.startsWith('/'); } - private async tryStat(uri: Uri, preserveDirectorySlash: boolean): Promise { + private async tryStat(uri: Uri, preserveDirectorySlash: boolean, token: CancellationToken): Promise { + if (token.isCancellationRequested) { + return undefined; + } try { const stat = await this.fileSystem.stat(uri); if (stat.type === FileType.Directory) { diff --git a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts index 50b30f4631..5b785c1035 100644 --- a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts +++ b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts @@ -4,8 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import { expect, suite, test } from 'vitest'; +import { NullEnvService } from '../../../../platform/env/common/nullEnvService'; +import { IFileSystemService } from '../../../../platform/filesystem/common/fileSystemService'; +import { FileType } from '../../../../platform/filesystem/common/fileTypes'; +import { NullWorkspaceService } from '../../../../platform/workspace/common/workspaceService'; +import { CancellationToken } from '../../../../util/vs/base/common/cancellation'; +import { URI } from '../../../../util/vs/base/common/uri'; import { Location, Position, Range } from '../../../../vscodeTypes'; import { LinkifyLocationAnchor } from '../../common/linkifiedText'; +import { LinkifyService } from '../../common/linkifyService'; +import { ModelFilePathLinkifier } from '../../common/modelFilePathLinkifier'; import { assertPartsEqual, createTestLinkifierService, linkify, workspaceFile } from './util'; suite('Model File Path Linkifier', () => { @@ -110,3 +118,68 @@ suite('Model File Path Linkifier', () => { assertPartsEqual([anchor], [expected]); }); }); + +suite('Model File Path Linkifier Remote Workspace', () => { + function createRemoteService(root: URI, files: readonly URI[]): LinkifyService { + class MockFs implements IFileSystemService { + readonly _serviceBrand: undefined; + async stat(resource: URI) { + if (resource.toString() === root.toString()) { + return { ctime: 0, mtime: 0, size: 0, type: FileType.Directory }; + } + const found = files.find(f => f.toString() === resource.toString()); + if (!found) { + throw new Error('File not found: ' + resource.toString()); + } + return { ctime: 0, mtime: 0, size: 0, type: found.path.endsWith('/') ? FileType.Directory : FileType.File }; + } + readDirectory(): Promise<[string, FileType][]> { throw new Error('Not implemented'); } + createDirectory(): Promise { throw new Error('Not implemented'); } + readFile(): Promise { throw new Error('Not implemented'); } + writeFile(): Promise { throw new Error('Not implemented'); } + delete(): Promise { throw new Error('Not implemented'); } + rename(): Promise { throw new Error('Not implemented'); } + copy(): Promise { throw new Error('Not implemented'); } + isWritableFileSystem(): boolean | undefined { return true; } + createFileSystemWatcher(): any { throw new Error('Not implemented'); } + } + const fs = new MockFs(); + const workspaceService = new NullWorkspaceService([root]); + const service = new LinkifyService(fs, workspaceService, NullEnvService.Instance); + service.registerGlobalLinkifier({ create: () => new ModelFilePathLinkifier(fs, workspaceService) }); + return service; + } + + async function remoteLinkify(service: LinkifyService, text: string) { + const linkifier = service.createLinkifier({ requestId: undefined, references: [] }, []); + const initial = await linkifier.append(text, CancellationToken.None); + const flushed = await linkifier.flush(CancellationToken.None); + return flushed ? [...initial.parts, ...flushed.parts] : initial.parts; + } + + const remoteRoot = URI.from({ scheme: 'test', authority: 'auth', path: '/home/user/project' }); + const remoteFile = URI.from({ scheme: 'test', authority: 'auth', path: '/home/user/project/src/remote.ts' }); + + test('Should map absolute remote path preserving scheme', async () => { + const service = createRemoteService(remoteRoot, [remoteFile]); + const parts = await remoteLinkify(service, '[/home/user/project/src/remote.ts](/home/user/project/src/remote.ts)'); + expect(parts.length).toBe(1); + const anchor = parts[0] as LinkifyLocationAnchor; + expect(anchor.value.toString()).toBe(remoteFile.toString()); + expect(anchor.title).toBe('src/remote.ts'); + }); + + test('Should parse line range anchor on remote absolute path', async () => { + const service = createRemoteService(remoteRoot, [remoteFile]); + const parts = await remoteLinkify(service, '[/home/user/project/src/remote.ts](/home/user/project/src/remote.ts#L3-5)'); + expect(parts.length).toBe(1); + const anchor = parts[0] as LinkifyLocationAnchor; + // Anchor value is a Location when an anchor is present. + const location = anchor.value as Location; + expect(location.uri.toString()).toBe(remoteFile.toString()); + const range = location.range; + expect(range.start.line).toBe(2); + expect(range.end.line).toBe(4); + expect(anchor.title).toBe('src/remote.ts#L3-L5'); + }); +}); diff --git a/src/platform/endpoint/common/capiClient.ts b/src/platform/endpoint/common/capiClient.ts index f615390c02..f5732f2fb6 100644 --- a/src/platform/endpoint/common/capiClient.ts +++ b/src/platform/endpoint/common/capiClient.ts @@ -18,14 +18,12 @@ export interface ICAPIClientService extends CAPIClient { export abstract class BaseCAPIClientService extends CAPIClient implements ICAPIClientService { readonly _serviceBrand: undefined; - readonly integrationId: string | undefined; constructor( hmac: string | undefined, integrationId: string | undefined, fetcherService: IFetcherService, - envService: IEnvService, - forceDevMode?: boolean + envService: IEnvService ) { super({ machineId: envService.machineId, @@ -34,8 +32,7 @@ export abstract class BaseCAPIClientService extends CAPIClient implements ICAPIC buildType: envService.getBuildType(), name: envService.getName(), version: envService.getVersion(), - }, LICENSE_AGREEMENT, fetcherService, hmac, forceDevMode); - this.integrationId = integrationId; + }, LICENSE_AGREEMENT, fetcherService, hmac, integrationId); } } -export const ICAPIClientService = createServiceIdentifier('ICAPIClientService'); +export const ICAPIClientService = createServiceIdentifier('ICAPIClientService'); \ No newline at end of file diff --git a/src/platform/endpoint/node/capiClientImpl.ts b/src/platform/endpoint/node/capiClientImpl.ts index e88ffa1006..bd3afaad17 100644 --- a/src/platform/endpoint/node/capiClientImpl.ts +++ b/src/platform/endpoint/node/capiClientImpl.ts @@ -17,8 +17,7 @@ export class CAPIClientImpl extends BaseCAPIClientService { process.env.HMAC_SECRET, process.env.VSCODE_COPILOT_INTEGRATION_ID, fetcherService, - envService, - undefined + envService ); } } \ No newline at end of file From 1aca6d76183c6169ae3f38a4b61520ac0294d0bb Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 17:53:10 -0800 Subject: [PATCH 14/25] Minor updates based on feedback --- src/extension/prompts/node/agent/anthropicPrompts.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/extension/prompts/node/agent/anthropicPrompts.tsx b/src/extension/prompts/node/agent/anthropicPrompts.tsx index 42381db300..68787d5402 100644 --- a/src/extension/prompts/node/agent/anthropicPrompts.tsx +++ b/src/extension/prompts/node/agent/anthropicPrompts.tsx @@ -195,9 +195,8 @@ class Claude45DefaultPrompt extends PromptElement { {this.props.availableTools && } - Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks).
+ Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks).
- Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`.
File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below.
From 276c58a7c70091b576fd22f23d621292099e205b Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 18:12:07 -0800 Subject: [PATCH 15/25] Update snapshot --- src/extension/prompts/node/agent/anthropicPrompts.tsx | 3 +-- .../agentPrompts-simple_case-claude-sonnet-4.5.spec.snap | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/extension/prompts/node/agent/anthropicPrompts.tsx b/src/extension/prompts/node/agent/anthropicPrompts.tsx index 68787d5402..4229434f58 100644 --- a/src/extension/prompts/node/agent/anthropicPrompts.tsx +++ b/src/extension/prompts/node/agent/anthropicPrompts.tsx @@ -99,9 +99,8 @@ class DefaultAnthropicAgentPrompt extends PromptElement {this.props.availableTools && } - Use proper Markdown formatting. Backtick code symbols (classes, functions, variables, commands). For file paths and specific code locations, defer to the linking rules in `FileLinkificationInstructions` below (do not backtick paths; use markdown links with line anchors).
+ Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks).
- Use backticks for identifiers: `Person`, `calculateTotal`, `config`.
See FileLinkificationInstructions for file path link and line anchor rules and examples.
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap index 22717a59f6..d2a193271a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap @@ -62,7 +62,7 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. From 7cc79d67459090b8ef72dce53c61c194f27a3041 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 18:12:46 -0800 Subject: [PATCH 16/25] minor update --- .../agentPrompts-simple_case-claude-sonnet-4.5.spec.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap index d2a193271a..ef7fbbef46 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap @@ -110,7 +110,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` From b45ccc1cf4fa2e8e3fa1d64c9c825072011e480e Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 18:33:00 -0800 Subject: [PATCH 17/25] more snapshot updates --- ...ntPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap | 6 +++--- .../agentPrompts-all_tools-claude-sonnet-4.5.spec.snap | 6 +++--- .../agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap | 4 ++-- ...rompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap | 4 ++-- ...ctions_not_in_system_message-claude-sonnet-4.5.spec.snap | 4 ++-- .../agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap | 4 ++-- .../agentPrompts-tool_use-claude-sonnet-4.5.spec.snap | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap index 623b8e65b0..0535f2f3c8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap @@ -33,7 +33,7 @@ When using the read_file tool, prefer reading a large section over calling the r If semantic_search returns the full contents of the text files in the workspace, you have all the workspace context. You can use the grep_search to get an overview of a file by searching for a string within that one file, instead of using read_file many times. If you don't know exactly the string or filename pattern you're looking for, use semantic_search to do a semantic search across the workspace. -When creating files, be intentional and avoid calling the create_file tool unnecessarily. Only create files that are essential to completing the user's request. +When creating files, be intentional and avoid calling the create_file tool unnecessarily. Only create files that are essential to completing the user's request. When invoking a tool that takes a file path, always use the absolute file path. If the file has a scheme like untitled: or vscode-userdata:, then use a URI with the scheme. You don't currently have any tools available for editing files. If the user asks you to edit a file, you can ask the user to enable editing tools or print a codeblock with the suggested changes. You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command. @@ -74,7 +74,7 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. @@ -122,7 +122,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap index ccff09b92c..9f904dc8a6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap @@ -33,7 +33,7 @@ When using the read_file tool, prefer reading a large section over calling the r If semantic_search returns the full contents of the text files in the workspace, you have all the workspace context. You can use the grep_search to get an overview of a file by searching for a string within that one file, instead of using read_file many times. If you don't know exactly the string or filename pattern you're looking for, use semantic_search to do a semantic search across the workspace. -When creating files, be intentional and avoid calling the create_file tool unnecessarily. Only create files that are essential to completing the user's request. +When creating files, be intentional and avoid calling the create_file tool unnecessarily. Only create files that are essential to completing the user's request. When invoking a tool that takes a file path, always use the absolute file path. If the file has a scheme like untitled: or vscode-userdata:, then use a URI with the scheme. You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command. Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. @@ -75,7 +75,7 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. @@ -123,7 +123,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap index 50963b9f8c..ac6ff39297 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap @@ -62,7 +62,7 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. @@ -110,7 +110,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap index d59c580ed5..b2d3668eab 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap @@ -62,7 +62,7 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. @@ -108,7 +108,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap index 0ac849e047..dabb9965ba 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap @@ -62,7 +62,7 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. @@ -123,7 +123,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap index e81e8f0ec3..2ea434c5bc 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap @@ -62,7 +62,7 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. @@ -110,7 +110,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap index f057bda5df..2785be07b6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap @@ -62,7 +62,7 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. Backtick code identifiers (classes, methods, variables). For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. @@ -110,7 +110,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` From 7171dd549fd0822936414ff4f89f0c57c9aa4db8 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 18:56:08 -0800 Subject: [PATCH 18/25] snapshot updates --- .../agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap | 1 - .../agentPrompts-all_tools-claude-sonnet-4.5.spec.snap | 1 - .../agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap | 1 - ...gentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap | 1 - ...nstructions_not_in_system_message-claude-sonnet-4.5.spec.snap | 1 - .../agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap | 1 - .../agentPrompts-simple_case-claude-sonnet-4.5.spec.snap | 1 - .../agentPrompts-tool_use-claude-sonnet-4.5.spec.snap | 1 - 8 files changed, 8 deletions(-) diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap index 0535f2f3c8..8ab2d0c542 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap @@ -76,7 +76,6 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap index 9f904dc8a6..408237a90e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap @@ -77,7 +77,6 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap index ac6ff39297..365cb975b6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap @@ -64,7 +64,6 @@ Do NOT use emojis unless explicitly requested by the user. Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap index b2d3668eab..c20cc329df 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap @@ -64,7 +64,6 @@ Do NOT use emojis unless explicitly requested by the user. Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap index dabb9965ba..1e317a9d1d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap @@ -64,7 +64,6 @@ Do NOT use emojis unless explicitly requested by the user. Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap index 2ea434c5bc..d9b008e928 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap @@ -64,7 +64,6 @@ Do NOT use emojis unless explicitly requested by the user. Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap index ef7fbbef46..df86b2bcc8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap @@ -64,7 +64,6 @@ Do NOT use emojis unless explicitly requested by the user. Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap index 2785be07b6..f1a4fa4ed5 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap @@ -64,7 +64,6 @@ Do NOT use emojis unless explicitly requested by the user. Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). -Identifiers in backticks: `Person`, `calculateTotal`, `AppConfig`. File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. From e8528b8cd0eb9dc8065d54a7f958fbe9b05049df Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 22:32:31 -0800 Subject: [PATCH 19/25] minor optimization --- .../linkify/common/modelFilePathLinkifier.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/extension/linkify/common/modelFilePathLinkifier.ts b/src/extension/linkify/common/modelFilePathLinkifier.ts index fc4b3dbea6..a6bec43777 100644 --- a/src/extension/linkify/common/modelFilePathLinkifier.ts +++ b/src/extension/linkify/common/modelFilePathLinkifier.ts @@ -25,6 +25,7 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { async linkify(text: string, context: LinkifierContext, token: CancellationToken): Promise { let lastIndex = 0; const parts: Array> = []; + const workspaceFolders = this.workspaceService.getWorkspaceFolders(); for (const match of text.matchAll(modelLinkRe)) { const original = match[0]; @@ -40,7 +41,6 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { continue; } - const workspaceFolders = this.workspaceService.getWorkspaceFolders(); if (!this.canLinkify(parsed, workspaceFolders)) { parts.push(original); continue; @@ -244,13 +244,16 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { try { const stat = await this.fileSystem.stat(uri); if (stat.type === FileType.Directory) { - if (preserveDirectorySlash) { - return uri.path.endsWith('/') ? uri : uri.with({ path: `${uri.path}/` }); + const isRoot = uri.path === '/'; + const hasTrailingSlash = uri.path.endsWith('/'); + const shouldHaveTrailingSlash = preserveDirectorySlash && !isRoot; + + if (shouldHaveTrailingSlash && !hasTrailingSlash) { + return uri.with({ path: `${uri.path}/` }); } - if (uri.path.endsWith('/') && uri.path !== '/') { + if (!shouldHaveTrailingSlash && hasTrailingSlash) { return uri.with({ path: uri.path.slice(0, -1) }); } - return uri; } return uri; } catch { From fcd35bee687773e6e69f860522938a92937d0a20 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 23:05:22 -0800 Subject: [PATCH 20/25] Simplification --- .../linkify/common/modelFilePathLinkifier.ts | 16 +++++++++------- .../test/node/modelFilePathLinkifier.spec.ts | 12 ++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/extension/linkify/common/modelFilePathLinkifier.ts b/src/extension/linkify/common/modelFilePathLinkifier.ts index a6bec43777..0a69db95c6 100644 --- a/src/extension/linkify/common/modelFilePathLinkifier.ts +++ b/src/extension/linkify/common/modelFilePathLinkifier.ts @@ -47,7 +47,8 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { } // Push promise to resolve in parallel with other matches - parts.push(this.resolveTarget(parsed.targetPath, workspaceFolders, parsed.preserveDirectorySlash, token).then(resolved => { + // Pass originalTargetPath to preserve platform-specific separators (e.g., c:/path vs c:\path) before Uri.file() conversion + parts.push(this.resolveTarget(parsed.targetPath, parsed.originalTargetPath, workspaceFolders, parsed.preserveDirectorySlash, token).then(resolved => { if (!resolved) { return original; } @@ -82,7 +83,7 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { return { parts: coalesceParts(await Promise.all(parts)) }; } - private parseModelLinkMatch(match: RegExpMatchArray): { readonly text: string; readonly targetPath: string; readonly anchor: string | undefined; readonly preserveDirectorySlash: boolean } | undefined { + private parseModelLinkMatch(match: RegExpMatchArray): { readonly text: string; readonly targetPath: string; readonly anchor: string | undefined; readonly preserveDirectorySlash: boolean; readonly originalTargetPath: string } | undefined { const rawText = match.groups?.['text']; const rawTarget = match.groups?.['target']; if (!rawText || !rawTarget) { @@ -103,7 +104,7 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { const preserveDirectorySlash = decodedBase.endsWith('/') && decodedBase.length > 1; const normalizedTarget = this.normalizeSlashes(decodedBase); const normalizedText = this.normalizeLinkText(rawText); - return { text: normalizedText, targetPath: normalizedTarget, anchor, preserveDirectorySlash }; + return { text: normalizedText, targetPath: normalizedTarget, anchor, preserveDirectorySlash, originalTargetPath: decodedBase }; } private normalizeSlashes(value: string): string { @@ -130,7 +131,7 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { return Boolean(workspaceFolders.length) && (textMatchesBase || textIsFilename || descriptiveWithAnchor); } - private async resolveTarget(targetPath: string, workspaceFolders: readonly Uri[], preserveDirectorySlash: boolean, token: CancellationToken): Promise { + private async resolveTarget(targetPath: string, originalTargetPath: string, workspaceFolders: readonly Uri[], preserveDirectorySlash: boolean, token: CancellationToken): Promise { if (!workspaceFolders.length) { return undefined; } @@ -150,11 +151,12 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { return undefined; } if (folderUri.scheme === 'file') { - const absoluteFileUri = this.tryCreateFileUri(targetPath); + // Use original path (before normalization) for Uri.file to preserve platform-specific separators + const absoluteFileUri = this.tryCreateFileUri(originalTargetPath); if (!absoluteFileUri) { continue; } - if (this.isEqualOrParentFs(absoluteFileUri, folderUri)) { + if (this.isEqualOrParent(absoluteFileUri, folderUri)) { const stat = await this.tryStat(absoluteFileUri, preserveDirectorySlash, token); if (stat) { return stat; @@ -200,7 +202,7 @@ export class ModelFilePathLinkifier implements IContributedLinkifier { } - private isEqualOrParentFs(target: Uri, folder: Uri): boolean { + private isEqualOrParent(target: Uri, folder: Uri): boolean { const targetPath = normalizeUriPath(target).path; const folderPath = normalizeUriPath(folder).path; return targetPath === folderPath || targetPath.startsWith(folderPath.endsWith('/') ? folderPath : `${folderPath}/`); diff --git a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts index 5b785c1035..7a468a1635 100644 --- a/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts +++ b/src/extension/linkify/test/node/modelFilePathLinkifier.spec.ts @@ -117,6 +117,18 @@ suite('Model File Path Linkifier', () => { expect(anchor.title).toBe('src/file.ts#L20-L25'); assertPartsEqual([anchor], [expected]); }); + + test('Should handle absolute paths with forward slashes on Windows', async () => { + const absolutePath = workspaceFile('src/file.ts').fsPath; + const service = createTestLinkifierService('src/file.ts'); + // Simulate model-generated path with forward slashes (e.g., c:/Repos/...) + const pathWithForwardSlashes = absolutePath.replace(/\\/g, '/'); + const result = await linkify(service, `[line 67](${pathWithForwardSlashes}#L67)`); + const anchor = result.parts[0] as LinkifyLocationAnchor; + const expected = new LinkifyLocationAnchor(new Location(workspaceFile('src/file.ts'), new Range(new Position(66, 0), new Position(66, 0)))); + expect(anchor.title).toBe('src/file.ts#L67'); + assertPartsEqual([anchor], [expected]); + }); }); suite('Model File Path Linkifier Remote Workspace', () => { From 7168dcdb29456c93b8b0b2b202112255c85422f8 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Wed, 19 Nov 2025 23:18:01 -0800 Subject: [PATCH 21/25] update snap files --- ...gentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap | 4 ++-- .../agentPrompts-all_tools-claude-sonnet-4.5.spec.snap | 4 ++-- .../agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap | 2 +- ...tPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap | 2 +- ...ructions_not_in_system_message-claude-sonnet-4.5.spec.snap | 2 +- .../agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap | 2 +- .../agentPrompts-simple_case-claude-sonnet-4.5.spec.snap | 2 +- .../agentPrompts-tool_use-claude-sonnet-4.5.spec.snap | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap index 8ab2d0c542..80cc42e833 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap @@ -33,7 +33,7 @@ When using the read_file tool, prefer reading a large section over calling the r If semantic_search returns the full contents of the text files in the workspace, you have all the workspace context. You can use the grep_search to get an overview of a file by searching for a string within that one file, instead of using read_file many times. If you don't know exactly the string or filename pattern you're looking for, use semantic_search to do a semantic search across the workspace. -When creating files, be intentional and avoid calling the create_file tool unnecessarily. Only create files that are essential to completing the user's request. +When creating files, be intentional and avoid calling the create_file tool unnecessarily. Only create files that are essential to completing the user's request. When invoking a tool that takes a file path, always use the absolute file path. If the file has a scheme like untitled: or vscode-userdata:, then use a URI with the scheme. You don't currently have any tools available for editing files. If the user asks you to edit a file, you can ask the user to enable editing tools or print a codeblock with the suggested changes. You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command. @@ -121,7 +121,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap index 408237a90e..2cb057627b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap @@ -33,7 +33,7 @@ When using the read_file tool, prefer reading a large section over calling the r If semantic_search returns the full contents of the text files in the workspace, you have all the workspace context. You can use the grep_search to get an overview of a file by searching for a string within that one file, instead of using read_file many times. If you don't know exactly the string or filename pattern you're looking for, use semantic_search to do a semantic search across the workspace. -When creating files, be intentional and avoid calling the create_file tool unnecessarily. Only create files that are essential to completing the user's request. +When creating files, be intentional and avoid calling the create_file tool unnecessarily. Only create files that are essential to completing the user's request. When invoking a tool that takes a file path, always use the absolute file path. If the file has a scheme like untitled: or vscode-userdata:, then use a URI with the scheme. You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command. Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. @@ -122,7 +122,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap index 365cb975b6..5466373f8f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap @@ -109,7 +109,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap index c20cc329df..b6d9f9b53f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap @@ -107,7 +107,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap index 1e317a9d1d..4a8e8903db 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap @@ -122,7 +122,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap index d9b008e928..a6544774d4 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap @@ -109,7 +109,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap index df86b2bcc8..a607f7bb43 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap @@ -109,7 +109,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap index f1a4fa4ed5..1f7618119b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap @@ -109,7 +109,7 @@ The user's current OS is: Linux I am working in a workspace with the following folders: -- /workspace +- /workspace I am working in a workspace that has the following structure: ``` From 4165d5245df9529505433376cae8d08dcad308c9 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Thu, 20 Nov 2025 16:38:23 -0800 Subject: [PATCH 22/25] Simplify prompt text and update snap --- .../prompts/node/agent/anthropicPrompts.tsx | 5 +-- .../agent/fileLinkificationInstructions.tsx | 23 ++++++++------ .../prompts/node/agent/geminiPrompts.tsx | 6 +--- .../node/agent/openai/defaultOpenAIPrompt.tsx | 2 +- .../node/agent/openai/gpt51CodexPrompt.tsx | 2 +- .../prompts/node/agent/openai/gpt51Prompt.tsx | 2 +- .../node/agent/openai/gpt5CodexPrompt.tsx | 2 +- .../prompts/node/agent/openai/gpt5Prompt.tsx | 2 +- ...non_edit_tools-claude-sonnet-4.5.spec.snap | 25 ++++++++------- ..._non_edit_tools-gemini-2.0-flash.spec.snap | 31 +++++++++---------- ...ompts-all_non_edit_tools-gpt-4.1.spec.snap | 27 +++++++++------- ...on_edit_tools-gpt-5.1-codex-mini.spec.snap | 27 +++++++++------- ...all_non_edit_tools-gpt-5.1-codex.spec.snap | 27 +++++++++------- ...ompts-all_non_edit_tools-gpt-5.1.spec.snap | 27 +++++++++------- ...Prompts-all_non_edit_tools-gpt-5.spec.snap | 27 +++++++++------- ..._non_edit_tools-grok-code-fast-1.spec.snap | 31 +++++++++---------- ...mpts-all_tools-claude-sonnet-4.5.spec.snap | 25 ++++++++------- ...ompts-all_tools-gemini-2.0-flash.spec.snap | 31 +++++++++---------- .../agentPrompts-all_tools-gpt-4.1.spec.snap | 27 +++++++++------- ...pts-all_tools-gpt-5.1-codex-mini.spec.snap | 27 +++++++++------- ...tPrompts-all_tools-gpt-5.1-codex.spec.snap | 27 +++++++++------- .../agentPrompts-all_tools-gpt-5.1.spec.snap | 27 +++++++++------- .../agentPrompts-all_tools-gpt-5.spec.snap | 27 +++++++++------- ...ompts-all_tools-grok-code-fast-1.spec.snap | 31 +++++++++---------- ...mpts-cache_BPs-claude-sonnet-4.5.spec.snap | 25 ++++++++------- ...ompts-cache_BPs-gemini-2.0-flash.spec.snap | 31 +++++++++---------- .../agentPrompts-cache_BPs-gpt-4.1.spec.snap | 27 +++++++++------- ...pts-cache_BPs-gpt-5.1-codex-mini.spec.snap | 27 +++++++++------- ...tPrompts-cache_BPs-gpt-5.1-codex.spec.snap | 27 +++++++++------- .../agentPrompts-cache_BPs-gpt-5.1.spec.snap | 27 +++++++++------- .../agentPrompts-cache_BPs-gpt-5.spec.snap | 27 +++++++++------- ...ompts-cache_BPs-grok-code-fast-1.spec.snap | 31 +++++++++---------- ...Ps_multi_round-claude-sonnet-4.5.spec.snap | 25 ++++++++------- ...BPs_multi_round-gemini-2.0-flash.spec.snap | 31 +++++++++---------- ...ts-cache_BPs_multi_round-gpt-4.1.spec.snap | 27 +++++++++------- ...s_multi_round-gpt-5.1-codex-mini.spec.snap | 27 +++++++++------- ...he_BPs_multi_round-gpt-5.1-codex.spec.snap | 27 +++++++++------- ...ts-cache_BPs_multi_round-gpt-5.1.spec.snap | 27 +++++++++------- ...mpts-cache_BPs_multi_round-gpt-5.spec.snap | 27 +++++++++------- ...BPs_multi_round-grok-code-fast-1.spec.snap | 31 +++++++++---------- ...system_message-claude-sonnet-4.5.spec.snap | 25 ++++++++------- ..._system_message-gemini-2.0-flash.spec.snap | 31 +++++++++---------- ...ns_not_in_system_message-gpt-4.1.spec.snap | 27 +++++++++------- ...ystem_message-gpt-5.1-codex-mini.spec.snap | 27 +++++++++------- ..._in_system_message-gpt-5.1-codex.spec.snap | 27 +++++++++------- ...ns_not_in_system_message-gpt-5.1.spec.snap | 27 +++++++++------- ...ions_not_in_system_message-gpt-5.spec.snap | 27 +++++++++------- ..._system_message-grok-code-fast-1.spec.snap | 31 +++++++++---------- ...one_attachment-claude-sonnet-4.5.spec.snap | 25 ++++++++------- ...-one_attachment-gemini-2.0-flash.spec.snap | 31 +++++++++---------- ...ntPrompts-one_attachment-gpt-4.1.spec.snap | 27 +++++++++------- ...ne_attachment-gpt-5.1-codex-mini.spec.snap | 27 +++++++++------- ...pts-one_attachment-gpt-5.1-codex.spec.snap | 27 +++++++++------- ...ntPrompts-one_attachment-gpt-5.1.spec.snap | 27 +++++++++------- ...gentPrompts-one_attachment-gpt-5.spec.snap | 27 +++++++++------- ...-one_attachment-grok-code-fast-1.spec.snap | 31 +++++++++---------- ...ts-simple_case-claude-sonnet-4.5.spec.snap | 25 ++++++++------- ...pts-simple_case-gemini-2.0-flash.spec.snap | 31 +++++++++---------- ...agentPrompts-simple_case-gpt-4.1.spec.snap | 27 +++++++++------- ...s-simple_case-gpt-5.1-codex-mini.spec.snap | 27 +++++++++------- ...rompts-simple_case-gpt-5.1-codex.spec.snap | 27 +++++++++------- ...agentPrompts-simple_case-gpt-5.1.spec.snap | 27 +++++++++------- .../agentPrompts-simple_case-gpt-5.spec.snap | 27 +++++++++------- ...pts-simple_case-grok-code-fast-1.spec.snap | 31 +++++++++---------- ...ompts-tool_use-claude-sonnet-4.5.spec.snap | 25 ++++++++------- ...rompts-tool_use-gemini-2.0-flash.spec.snap | 31 +++++++++---------- .../agentPrompts-tool_use-gpt-4.1.spec.snap | 27 +++++++++------- ...mpts-tool_use-gpt-5.1-codex-mini.spec.snap | 27 +++++++++------- ...ntPrompts-tool_use-gpt-5.1-codex.spec.snap | 27 +++++++++------- .../agentPrompts-tool_use-gpt-5.1.spec.snap | 27 +++++++++------- .../agentPrompts-tool_use-gpt-5.spec.snap | 27 +++++++++------- ...rompts-tool_use-grok-code-fast-1.spec.snap | 31 +++++++++---------- .../prompts/node/agent/xAIPrompts.tsx | 6 +--- 73 files changed, 973 insertions(+), 853 deletions(-) diff --git a/src/extension/prompts/node/agent/anthropicPrompts.tsx b/src/extension/prompts/node/agent/anthropicPrompts.tsx index 4229434f58..8f40004677 100644 --- a/src/extension/prompts/node/agent/anthropicPrompts.tsx +++ b/src/extension/prompts/node/agent/anthropicPrompts.tsx @@ -99,10 +99,7 @@ class DefaultAnthropicAgentPrompt extends PromptElement {this.props.availableTools && } - Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks).
- - See FileLinkificationInstructions for file path link and line anchor rules and examples. - + Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section
diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx index 8c82666086..2a2dacd7c4 100644 --- a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -8,24 +8,27 @@ import { Tag } from '../base/tag'; export class FileLinkificationInstructions extends PromptElement<{}> { render() { - return - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer.
- Format examples:
+ return + ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root.
+
+ **Inline references:** Use the file path as link text within sentences:
- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line)
- - `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.`
+ - `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range)
- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file)
- - `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses)
- When you need a bullet list of references with line numbers, you can use descriptive text:
- - [Await chat view](path/to/chatQuick.ts#L142)
- - [Show widget](path/to/chatQuick.ts#L321)
+
+ **Bullet lists:** Explains what each reference is, so readers understand the context without clicking:
+ - [Await chat view](path/to/file.ts#L142)
+ - [Show widget](path/to/file.ts#L321)
+ Don't just list bare file paths like `file.ts#L142`
+
NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).`
+
Critical rules:
- - Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`.
- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not.
- Path format: Strip drive letters and workspace parent folders - use only path after workspace root
- Transform `c:\Repos\workspace\src\file.ts` → `[src/file.ts](src/file.ts)`
- Always use forward slashes `/`, never backslashes `\`
- - Do not use URIs like file://, vscode://, or https://.
+ - Do not use URIs like file://, vscode:// for file paths.
- Percent-encode spaces in target only: `[My File.md](My%20File.md)`
- Each file reference needs complete path (don't abbreviate repeated files)
- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges
diff --git a/src/extension/prompts/node/agent/geminiPrompts.tsx b/src/extension/prompts/node/agent/geminiPrompts.tsx index a89668e92b..31c48d55cf 100644 --- a/src/extension/prompts/node/agent/geminiPrompts.tsx +++ b/src/extension/prompts/node/agent/geminiPrompts.tsx @@ -102,11 +102,7 @@ export class DefaultGeminiAgentPrompt extends PromptElement} - Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below.
- - Identifiers: `Person`, `calculateTotal`, `AppConfig`.
- File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. -
+ Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section
diff --git a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx index f2bbabc7f9..95caffbb9f 100644 --- a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx @@ -103,7 +103,7 @@ export class DefaultOpenAIAgentPrompt extends PromptElement Identifiers only: `calculateTotal`, `Person`, `AppConfig`.
- File path link examples live in FileLinkificationInstructions.
+ File path link examples live in fileLinkification section below.
diff --git a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx index 43de50ef6d..5415e87d53 100644 --- a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx @@ -71,7 +71,7 @@ class Gpt51CodexPrompt extends PromptElement { - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help.
- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.
- Monospace: backticks for commands, env vars, and code identifiers; never combine with **.
- - File path + line anchor link rules are defined in `FileLinkificationInstructions` below.
+ - File path and line number formatting rules are defined in the fileLinkification section below.
- Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible.
- Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.
- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.
diff --git a/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx index 0bb3ea2e6a..3e96957fce 100644 --- a/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx @@ -223,7 +223,7 @@ class Gpt51Prompt extends PromptElement { - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``).
- Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.
- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`).
- - File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below.
+ - File path and line number formatting rules are defined in the fileLinkification section below.

**Structure**

diff --git a/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx index e22abe9924..0de9c71ffa 100644 --- a/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx @@ -76,7 +76,7 @@ class CodexStyleGpt5CodexPrompt extends PromptElement { - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.
- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short—wrap/reformat if long; avoid naming formatting styles in answers.
- Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets.
- - File path and line anchor link rules are defined in `FileLinkificationInstructions` below (do not duplicate examples).
+ - File path and line anchor link rules are defined in fileLinkification section below.
; } diff --git a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx index 47ec642d53..3be3a8cd1a 100644 --- a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx @@ -187,7 +187,7 @@ class DefaultGpt5AgentPrompt extends PromptElement { - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``).
- Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.
- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`).
- - File path and line anchor link rules are defined in `FileLinkificationInstructions` below.
+ - File path and line number formatting rules are defined in the fileLinkification section below.

Structure:
- Place related bullets together; don't mix unrelated concepts in the same section.
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap index 80cc42e833..d6b0e19371 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap @@ -78,30 +78,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap index b170d6e6a5..c45113467e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap @@ -43,35 +43,34 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. - -Identifiers: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap index fb28732f1e..3f58057dc4 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap @@ -48,35 +48,38 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in FileLinkificationInstructions. +File path link examples live in fileLinkification section below.
- -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap index 08ba72669c..a3ca5b7be0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap index 08ba72669c..a3ca5b7be0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap index 5b8bcb2729..19990e1143 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap @@ -198,7 +198,7 @@ You are producing plain text that will later be styled by the CLI. Follow these - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. **Structure** @@ -236,30 +236,33 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap index 854d0d8872..9977b4a82b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap @@ -171,7 +171,7 @@ Monospace: - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. @@ -205,30 +205,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap index ac70ce8511..fc10569ece 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap @@ -50,35 +50,34 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. - -Identifiers only: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap index 2cb057627b..616d5a31ae 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap @@ -79,30 +79,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap index 9e3ac37c3d..5ac7454911 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap @@ -45,35 +45,34 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. - -Identifiers: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap index 3e4470fdf8..259738db99 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap @@ -84,35 +84,38 @@ Important Reminder: Markdown cells cannot be executed Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in FileLinkificationInstructions. +File path link examples live in fileLinkification section below.
- -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap index f372174677..f74f3e7c0a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap index f372174677..f74f3e7c0a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap index f621ccc7e7..ada5092f8c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap @@ -233,7 +233,7 @@ You are producing plain text that will later be styled by the CLI. Follow these - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. **Structure** @@ -271,30 +271,33 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap index cf1a233bc9..11cba0591b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap @@ -207,7 +207,7 @@ Monospace: - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. @@ -241,30 +241,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap index 973f8a1915..e19267bb8a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap @@ -52,35 +52,34 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. - -Identifiers only: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap index 5466373f8f..0022b58de0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap @@ -66,30 +66,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap index 2c344eeaa1..d7d3e50e3e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap @@ -32,35 +32,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. - -Identifiers: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap index c9c03bbd5d..33ad428662 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap @@ -37,35 +37,38 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in FileLinkificationInstructions. +File path link examples live in fileLinkification section below.
- -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap index c119f8b11b..3f881c81df 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap index c119f8b11b..3f881c81df 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap index bce627c407..86f6dbe792 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap @@ -198,7 +198,7 @@ You are producing plain text that will later be styled by the CLI. Follow these - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. **Structure** @@ -236,30 +236,33 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap index 5ffa69b873..ba6231d59a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap @@ -171,7 +171,7 @@ Monospace: - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. @@ -205,30 +205,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap index aa93328517..1c33c0a29e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap @@ -39,35 +39,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. - -Identifiers only: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap index b6d9f9b53f..27eef930d8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap @@ -66,30 +66,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap index 21344d3727..70e0f88bf9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap @@ -32,35 +32,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. - -Identifiers: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap index d788a3e377..dfa2695ea8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap @@ -37,35 +37,38 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in FileLinkificationInstructions. +File path link examples live in fileLinkification section below.
- -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap index b4cdb0b3fe..072678f6f7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap index b4cdb0b3fe..072678f6f7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap index 3da1e448b7..a57637e381 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap @@ -198,7 +198,7 @@ You are producing plain text that will later be styled by the CLI. Follow these - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. **Structure** @@ -236,30 +236,33 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap index 0fe439fd3f..5488b9b5a0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap @@ -171,7 +171,7 @@ Monospace: - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. @@ -205,30 +205,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap index f8ba7de6a2..0d6d29f2ca 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap @@ -39,35 +39,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. - -Identifiers only: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap index 4a8e8903db..d4f387596f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap @@ -66,30 +66,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap index b9877da01e..01be0526ef 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap @@ -32,35 +32,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. - -Identifiers: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap index 75361a14df..1444679f19 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap @@ -37,35 +37,38 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in FileLinkificationInstructions. +File path link examples live in fileLinkification section below.
- -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap index 827d4b80a8..768b97509d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap index 827d4b80a8..768b97509d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap index 4c29bb4f8e..7047641c63 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap @@ -198,7 +198,7 @@ You are producing plain text that will later be styled by the CLI. Follow these - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. **Structure** @@ -236,30 +236,33 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap index 88ee582c71..cab4ffa243 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap @@ -171,7 +171,7 @@ Monospace: - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. @@ -205,30 +205,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + [copilot_cache_control: { type: 'ephemeral' }] diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap index 420cebfbe6..8a495d9a81 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap @@ -39,35 +39,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. - -Identifiers only: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap index a6544774d4..6586d8a6da 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap @@ -66,30 +66,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap index a08b85e47b..1b385e5d3d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap @@ -32,35 +32,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. - -Identifiers: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap index 12056ec50a..19ba0f3378 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap @@ -37,35 +37,38 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in FileLinkificationInstructions. +File path link examples live in fileLinkification section below.
- -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap index 51c295a221..e3c05ecd2e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap index 51c295a221..e3c05ecd2e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap index 8f5eab6fb6..d08cb542f7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap @@ -198,7 +198,7 @@ You are producing plain text that will later be styled by the CLI. Follow these - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. **Structure** @@ -236,30 +236,33 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap index ca4e4b8d5a..f64be1de2b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap @@ -171,7 +171,7 @@ Monospace: - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. @@ -205,30 +205,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap index 34b4217e5a..17301d6eca 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap @@ -39,35 +39,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. - -Identifiers only: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap index a607f7bb43..8657481e3e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap @@ -66,30 +66,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap index 9d23e0ddd2..14c7ecf9ea 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap @@ -32,35 +32,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. - -Identifiers: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap index 6b0c186f15..b5d60d5d58 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap @@ -37,35 +37,38 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in FileLinkificationInstructions. +File path link examples live in fileLinkification section below.
- -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap index 08ba72669c..a3ca5b7be0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap index 08ba72669c..a3ca5b7be0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap index 5b8bcb2729..19990e1143 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap @@ -198,7 +198,7 @@ You are producing plain text that will later be styled by the CLI. Follow these - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. **Structure** @@ -236,30 +236,33 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap index 854d0d8872..9977b4a82b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap @@ -171,7 +171,7 @@ Monospace: - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. @@ -205,30 +205,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap index ab6691a485..e78c3e8007 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap @@ -39,35 +39,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. - -Identifiers only: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap index 1f7618119b..74270441ff 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap @@ -66,30 +66,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - +
diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap index 8458148a46..08cbe8891d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap @@ -32,35 +32,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below. - -Identifiers: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap index fc1b73b8ac..877e29838b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap @@ -37,35 +37,38 @@ Tools can be disabled by the user. You may see tools used previously in the conv Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in FileLinkificationInstructions. +File path link examples live in fileLinkification section below.
- -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap index a7b0e40964..539c338ff9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap index a7b0e40964..539c338ff9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap @@ -48,7 +48,7 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. - Monospace: backticks for commands, env vars, and code identifiers; never combine with **. -- File path + line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -62,30 +62,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap index 7eff226675..00644f0a2a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap @@ -198,7 +198,7 @@ You are producing plain text that will later be styled by the CLI. Follow these - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. **Structure** @@ -236,30 +236,33 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap index 18c559d52e..da7be31cd3 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap @@ -171,7 +171,7 @@ Monospace: - Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``). - Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command. - Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`). -- File path and line anchor link rules are defined in `FileLinkificationInstructions` below. +- File path and line number formatting rules are defined in the fileLinkification section below. Structure: - Place related bullets together; don't mix unrelated concepts in the same section. @@ -205,30 +205,33 @@ The class `Person` is in `src/models/person.ts`. - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap index b2a1ffbf7d..74959c080b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap @@ -39,35 +39,34 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below. - -Identifiers only: `Person`, `calculateTotal`, `AppConfig`. -File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer. -Format examples: +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. + +**Inline references:** Use the file path as link text within sentences: - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` +- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) -- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses) -When you need a bullet list of references with line numbers, you can use descriptive text: -- [Await chat view](path/to/chatQuick.ts#L142) -- [Show widget](path/to/chatQuick.ts#L321) + +**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: +- [Await chat view](path/to/file.ts#L142) +- [Show widget](path/to/file.ts#L321) +Don't just list bare file paths like `file.ts#L142` + NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` + Critical rules: -- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`. - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. - Path format: Strip drive letters and workspace parent folders - use only path after workspace root - Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` - Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode://, or https://. +- Do not use URIs like file://, vscode:// for file paths. - Percent-encode spaces in target only: `[My File.md](My%20File.md)` - Each file reference needs complete path (don't abbreviate repeated files) - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges - Don't wrap links in backticks; only cite existing paths from context - + diff --git a/src/extension/prompts/node/agent/xAIPrompts.tsx b/src/extension/prompts/node/agent/xAIPrompts.tsx index db3ee86ea0..f904fb3cfb 100644 --- a/src/extension/prompts/node/agent/xAIPrompts.tsx +++ b/src/extension/prompts/node/agent/xAIPrompts.tsx @@ -106,11 +106,7 @@ class DefaultGrokCodeFastAgentPrompt extends PromptElement} - Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and specific code locations, do NOT use backticks — convert them to markdown links with line anchors as defined in `FileLinkificationInstructions` below.
- - Identifiers only: `Person`, `calculateTotal`, `AppConfig`.
- File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below. -
+ Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section
From 5784ec69a6932a2a86f2b214ccb5394fa36cba30 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Fri, 21 Nov 2025 10:29:21 -0800 Subject: [PATCH 23/25] Minor prompt readjustment --- .../prompts/node/agent/openai/defaultOpenAIPrompt.tsx | 2 +- src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx | 2 +- src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx | 1 - src/extension/prompts/node/agent/openai/gpt5Prompt.tsx | 3 ++- .../agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap | 4 ++-- ...entPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap | 4 ++-- .../agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap | 4 ++-- .../agentPrompts-all_non_edit_tools-gpt-5.spec.snap | 4 ++-- .../__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap | 4 ++-- .../agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap | 4 ++-- .../agentPrompts-all_tools-gpt-5.1-codex.spec.snap | 4 ++-- .../test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap | 4 ++-- .../__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap | 4 ++-- .../agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap | 4 ++-- .../agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap | 4 ++-- .../test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap | 4 ++-- .../agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap | 4 ++-- ...Prompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap | 4 ++-- ...agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap | 4 ++-- .../agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap | 4 ++-- ...ustom_instructions_not_in_system_message-gpt-4.1.spec.snap | 4 ++-- ...uctions_not_in_system_message-gpt-5.1-codex-mini.spec.snap | 4 ++-- ...instructions_not_in_system_message-gpt-5.1-codex.spec.snap | 4 ++-- ...-custom_instructions_not_in_system_message-gpt-5.spec.snap | 4 ++-- .../agentPrompts-one_attachment-gpt-4.1.spec.snap | 4 ++-- .../agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap | 4 ++-- .../agentPrompts-one_attachment-gpt-5.1-codex.spec.snap | 4 ++-- .../__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap | 4 ++-- .../__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap | 4 ++-- .../agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap | 4 ++-- .../agentPrompts-simple_case-gpt-5.1-codex.spec.snap | 4 ++-- .../__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap | 4 ++-- .../__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap | 4 ++-- .../agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap | 4 ++-- .../agentPrompts-tool_use-gpt-5.1-codex.spec.snap | 4 ++-- .../test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap | 4 ++-- 36 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx index 95caffbb9f..6938d20459 100644 --- a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx @@ -105,10 +105,10 @@ export class DefaultOpenAIAgentPrompt extends PromptElement File path link examples live in fileLinkification section below.
+ - ; } } diff --git a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx index 5415e87d53..f6ecfb083c 100644 --- a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx @@ -83,9 +83,9 @@ class Gpt51CodexPrompt extends PromptElement { The class `Person` is in `src/models/person.ts`. + - ; } } diff --git a/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx index 0de9c71ffa..1fbd322c06 100644 --- a/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx @@ -76,7 +76,6 @@ class CodexStyleGpt5CodexPrompt extends PromptElement { - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.
- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short—wrap/reformat if long; avoid naming formatting styles in answers.
- Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets.
- - File path and line anchor link rules are defined in fileLinkification section below.
; } diff --git a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx index 3be3a8cd1a..7dd32d70c7 100644 --- a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx @@ -219,10 +219,11 @@ class DefaultGpt5AgentPrompt extends PromptElement { The class `Person` is in `src/models/person.ts`. + - + ; } } diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap index 3f58057dc4..52cccf2344 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap @@ -51,8 +51,6 @@ Identifiers only: `calculateTotal`, `Person`, `AppConfig`. File path link examples live in fileLinkification section below. - -
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -81,6 +79,8 @@ Critical rules: +
+ This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap index a3ca5b7be0..a3865eb86f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap index a3ca5b7be0..a3865eb86f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap index 9977b4a82b..aeaf2a726b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap @@ -203,8 +203,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -233,6 +231,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap index 259738db99..151b0d6a29 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap @@ -87,8 +87,6 @@ Identifiers only: `calculateTotal`, `Person`, `AppConfig`. File path link examples live in fileLinkification section below. - -
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -117,6 +115,8 @@ Critical rules: +
+ This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap index f74f3e7c0a..a8ff341993 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap index f74f3e7c0a..a8ff341993 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap index 11cba0591b..ebdbc15097 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap @@ -239,8 +239,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -269,6 +267,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap index 33ad428662..7ed78e68a0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap @@ -40,8 +40,6 @@ Identifiers only: `calculateTotal`, `Person`, `AppConfig`. File path link examples live in fileLinkification section below. - -
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -70,6 +68,8 @@ Critical rules: +
+ This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap index 3f881c81df..ea0e93add9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap index 3f881c81df..ea0e93add9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap index ba6231d59a..3db9ba71d5 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap @@ -203,8 +203,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -233,6 +231,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap index dfa2695ea8..3ad994f089 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap @@ -40,8 +40,6 @@ Identifiers only: `calculateTotal`, `Person`, `AppConfig`. File path link examples live in fileLinkification section below. - -
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -70,6 +68,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap index 072678f6f7..1d59f8a149 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap index 072678f6f7..1d59f8a149 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap index 5488b9b5a0..ac1b8fc778 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap @@ -203,8 +203,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -233,6 +231,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap index 1444679f19..a31f32a562 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap @@ -40,8 +40,6 @@ Identifiers only: `calculateTotal`, `Person`, `AppConfig`. File path link examples live in fileLinkification section below. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -70,6 +68,8 @@ Critical rules: + + [copilot_cache_control: { type: 'ephemeral' }] ~~~ diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap index 768b97509d..5176ae3f04 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + [copilot_cache_control: { type: 'ephemeral' }] ~~~ diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap index 768b97509d..5176ae3f04 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + [copilot_cache_control: { type: 'ephemeral' }] ~~~ diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap index cab4ffa243..4651d027b0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap @@ -203,8 +203,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -233,6 +231,8 @@ Critical rules: + + [copilot_cache_control: { type: 'ephemeral' }] ~~~ diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap index 19ba0f3378..d0cbbf2903 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap @@ -40,8 +40,6 @@ Identifiers only: `calculateTotal`, `Person`, `AppConfig`. File path link examples live in fileLinkification section below. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -70,6 +68,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap index e3c05ecd2e..692b979cb4 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap index e3c05ecd2e..692b979cb4 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap index f64be1de2b..c1d0b34a44 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap @@ -203,8 +203,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -233,6 +231,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap index b5d60d5d58..f54955d593 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap @@ -40,8 +40,6 @@ Identifiers only: `calculateTotal`, `Person`, `AppConfig`. File path link examples live in fileLinkification section below. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -70,6 +68,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap index a3ca5b7be0..a3865eb86f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap index a3ca5b7be0..a3865eb86f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap index 9977b4a82b..aeaf2a726b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap @@ -203,8 +203,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -233,6 +231,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap index 877e29838b..b62813af58 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap @@ -40,8 +40,6 @@ Identifiers only: `calculateTotal`, `Person`, `AppConfig`. File path link examples live in fileLinkification section below. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -70,6 +68,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap index 539c338ff9..c0ecccb0a9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap index 539c338ff9..c0ecccb0a9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap @@ -60,8 +60,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -90,6 +88,8 @@ Critical rules: + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap index da7be31cd3..db7c29fafe 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap @@ -203,8 +203,6 @@ When referring to a filename or symbol in the user's workspace, wrap it in backt The class `Person` is in `src/models/person.ts`. - - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. @@ -233,6 +231,8 @@ Critical rules: + + This is a test custom instruction file From 92f04c8b9bec600cdce0683448ec48b8dff87309 Mon Sep 17 00:00:00 2001 From: vijay upadya Date: Sat, 22 Nov 2025 08:59:36 -0800 Subject: [PATCH 24/25] Prompt updates to make them consistent across models --- .../prompts/node/agent/anthropicPrompts.tsx | 7 +- .../agent/fileLinkificationInstructions.tsx | 52 +++++++++------ .../prompts/node/agent/geminiPrompts.tsx | 2 +- .../node/agent/openai/defaultOpenAIPrompt.tsx | 7 +- .../node/agent/openai/gpt51CodexPrompt.tsx | 7 +- .../prompts/node/agent/openai/gpt51Prompt.tsx | 2 +- .../prompts/node/agent/openai/gpt5Prompt.tsx | 6 +- ...non_edit_tools-claude-sonnet-4.5.spec.snap | 63 +++++++++--------- ..._non_edit_tools-gemini-2.0-flash.spec.snap | 58 ++++++++++------- ...ompts-all_non_edit_tools-gpt-4.1.spec.snap | 65 ++++++++++--------- ...on_edit_tools-gpt-5.1-codex-mini.spec.snap | 63 +++++++++--------- ...all_non_edit_tools-gpt-5.1-codex.spec.snap | 63 +++++++++--------- ...ompts-all_non_edit_tools-gpt-5.1.spec.snap | 62 ++++++++++-------- ...Prompts-all_non_edit_tools-gpt-5.spec.snap | 63 +++++++++--------- ..._non_edit_tools-grok-code-fast-1.spec.snap | 58 ++++++++++------- ...mpts-all_tools-claude-sonnet-4.5.spec.snap | 63 +++++++++--------- ...ompts-all_tools-gemini-2.0-flash.spec.snap | 58 ++++++++++------- .../agentPrompts-all_tools-gpt-4.1.spec.snap | 65 ++++++++++--------- ...pts-all_tools-gpt-5.1-codex-mini.spec.snap | 63 +++++++++--------- ...tPrompts-all_tools-gpt-5.1-codex.spec.snap | 63 +++++++++--------- .../agentPrompts-all_tools-gpt-5.1.spec.snap | 62 ++++++++++-------- .../agentPrompts-all_tools-gpt-5.spec.snap | 63 +++++++++--------- ...ompts-all_tools-grok-code-fast-1.spec.snap | 58 ++++++++++------- ...mpts-cache_BPs-claude-sonnet-4.5.spec.snap | 63 +++++++++--------- ...ompts-cache_BPs-gemini-2.0-flash.spec.snap | 58 ++++++++++------- .../agentPrompts-cache_BPs-gpt-4.1.spec.snap | 65 ++++++++++--------- ...pts-cache_BPs-gpt-5.1-codex-mini.spec.snap | 63 +++++++++--------- ...tPrompts-cache_BPs-gpt-5.1-codex.spec.snap | 63 +++++++++--------- .../agentPrompts-cache_BPs-gpt-5.1.spec.snap | 62 ++++++++++-------- .../agentPrompts-cache_BPs-gpt-5.spec.snap | 63 +++++++++--------- ...ompts-cache_BPs-grok-code-fast-1.spec.snap | 58 ++++++++++------- ...Ps_multi_round-claude-sonnet-4.5.spec.snap | 63 +++++++++--------- ...BPs_multi_round-gemini-2.0-flash.spec.snap | 58 ++++++++++------- ...ts-cache_BPs_multi_round-gpt-4.1.spec.snap | 65 ++++++++++--------- ...s_multi_round-gpt-5.1-codex-mini.spec.snap | 63 +++++++++--------- ...he_BPs_multi_round-gpt-5.1-codex.spec.snap | 63 +++++++++--------- ...ts-cache_BPs_multi_round-gpt-5.1.spec.snap | 62 ++++++++++-------- ...mpts-cache_BPs_multi_round-gpt-5.spec.snap | 63 +++++++++--------- ...BPs_multi_round-grok-code-fast-1.spec.snap | 58 ++++++++++------- ...system_message-claude-sonnet-4.5.spec.snap | 63 +++++++++--------- ..._system_message-gemini-2.0-flash.spec.snap | 58 ++++++++++------- ...ns_not_in_system_message-gpt-4.1.spec.snap | 65 ++++++++++--------- ...ystem_message-gpt-5.1-codex-mini.spec.snap | 63 +++++++++--------- ..._in_system_message-gpt-5.1-codex.spec.snap | 63 +++++++++--------- ...ns_not_in_system_message-gpt-5.1.spec.snap | 62 ++++++++++-------- ...ions_not_in_system_message-gpt-5.spec.snap | 63 +++++++++--------- ..._system_message-grok-code-fast-1.spec.snap | 58 ++++++++++------- ...one_attachment-claude-sonnet-4.5.spec.snap | 63 +++++++++--------- ...-one_attachment-gemini-2.0-flash.spec.snap | 58 ++++++++++------- ...ntPrompts-one_attachment-gpt-4.1.spec.snap | 65 ++++++++++--------- ...ne_attachment-gpt-5.1-codex-mini.spec.snap | 63 +++++++++--------- ...pts-one_attachment-gpt-5.1-codex.spec.snap | 63 +++++++++--------- ...ntPrompts-one_attachment-gpt-5.1.spec.snap | 62 ++++++++++-------- ...gentPrompts-one_attachment-gpt-5.spec.snap | 63 +++++++++--------- ...-one_attachment-grok-code-fast-1.spec.snap | 58 ++++++++++------- ...ts-simple_case-claude-sonnet-4.5.spec.snap | 63 +++++++++--------- ...pts-simple_case-gemini-2.0-flash.spec.snap | 58 ++++++++++------- ...agentPrompts-simple_case-gpt-4.1.spec.snap | 65 ++++++++++--------- ...s-simple_case-gpt-5.1-codex-mini.spec.snap | 63 +++++++++--------- ...rompts-simple_case-gpt-5.1-codex.spec.snap | 63 +++++++++--------- ...agentPrompts-simple_case-gpt-5.1.spec.snap | 62 ++++++++++-------- .../agentPrompts-simple_case-gpt-5.spec.snap | 63 +++++++++--------- ...pts-simple_case-grok-code-fast-1.spec.snap | 58 ++++++++++------- ...ompts-tool_use-claude-sonnet-4.5.spec.snap | 63 +++++++++--------- ...rompts-tool_use-gemini-2.0-flash.spec.snap | 58 ++++++++++------- .../agentPrompts-tool_use-gpt-4.1.spec.snap | 65 ++++++++++--------- ...mpts-tool_use-gpt-5.1-codex-mini.spec.snap | 63 +++++++++--------- ...ntPrompts-tool_use-gpt-5.1-codex.spec.snap | 63 +++++++++--------- .../agentPrompts-tool_use-gpt-5.1.spec.snap | 62 ++++++++++-------- .../agentPrompts-tool_use-gpt-5.spec.snap | 63 +++++++++--------- ...rompts-tool_use-grok-code-fast-1.spec.snap | 58 ++++++++++------- .../prompts/node/agent/xAIPrompts.tsx | 2 +- 72 files changed, 2213 insertions(+), 1832 deletions(-) diff --git a/src/extension/prompts/node/agent/anthropicPrompts.tsx b/src/extension/prompts/node/agent/anthropicPrompts.tsx index 8f40004677..7d557b8cab 100644 --- a/src/extension/prompts/node/agent/anthropicPrompts.tsx +++ b/src/extension/prompts/node/agent/anthropicPrompts.tsx @@ -191,10 +191,9 @@ class Claude45DefaultPrompt extends PromptElement { {this.props.availableTools && } - Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks).
- - File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - + Use proper Markdown formatting: + - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()`
+ - When mentioning files or line numbers, always follow the rules in fileLinkification section below:
diff --git a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx index 2a2dacd7c4..f8f6bfca07 100644 --- a/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx +++ b/src/extension/prompts/node/agent/fileLinkificationInstructions.tsx @@ -9,30 +9,42 @@ import { Tag } from '../base/tag'; export class FileLinkificationInstructions extends PromptElement<{}> { render() { return - ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root.
+ When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers.
+ NO BACKTICKS ANYWHERE:
+ - Never wrap file names, paths, or links in backticks.
+ - Never use inline-code formatting for any file reference.

- **Inline references:** Use the file path as link text within sentences:
- - `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line)
- - `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range)
- - `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file)
+ + REQUIRED FORMATS:
+ - File: [path/file.ts](path/file.ts)
+ - Line: [file.ts](file.ts#L10)
+ - Range: [file.ts](file.ts#L10-L12)

- **Bullet lists:** Explains what each reference is, so readers understand the context without clicking:
- - [Await chat view](path/to/file.ts#L142)
- - [Show widget](path/to/file.ts#L321)
- Don't just list bare file paths like `file.ts#L142`
+ + PATH RULES:
+ - Without line numbers: Display text must match the target path.
+ - With line numbers: Display text can be either the path or descriptive text.
+ - Use '/' only; strip drive letters and external folders.
+ - Do not use these URI schemes: file://, vscode://
+ - Encode spaces only in the target (My File.md → My%20File.md).
+ - Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20.
+ - Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10

- NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).`
+ + USAGE EXAMPLES:
+ - With path as display: The handler is in [src/handler.ts](src/handler.ts#L10).
+ - With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup.
+ - Bullet list: [Init widget](src/widget.ts#L321)
+ - File only: See [src/config.ts](src/config.ts) for settings.
+
+ + FORBIDDEN (NEVER OUTPUT):
+ - Inline code: `file.ts`, `src/file.ts`, `L86`.
+ - Plain text file names: file.ts, chatService.ts.
+ - References without links when mentioning specific file locations.
+ - Specific line citations without links ("Line 86", "at line 86", "on line 25").
+ - Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20)

- Critical rules:
- - Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not.
- - Path format: Strip drive letters and workspace parent folders - use only path after workspace root
- - Transform `c:\Repos\workspace\src\file.ts` → `[src/file.ts](src/file.ts)`
- - Always use forward slashes `/`, never backslashes `\`
- - Do not use URIs like file://, vscode:// for file paths.
- - Percent-encode spaces in target only: `[My File.md](My%20File.md)`
- - Each file reference needs complete path (don't abbreviate repeated files)
- - Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges
- - Don't wrap links in backticks; only cite existing paths from context
; } } diff --git a/src/extension/prompts/node/agent/geminiPrompts.tsx b/src/extension/prompts/node/agent/geminiPrompts.tsx index 31c48d55cf..04f545dc61 100644 --- a/src/extension/prompts/node/agent/geminiPrompts.tsx +++ b/src/extension/prompts/node/agent/geminiPrompts.tsx @@ -102,7 +102,7 @@ export class DefaultGeminiAgentPrompt extends PromptElement} - Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section
+ Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below
diff --git a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx index 6938d20459..7254f74721 100644 --- a/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx @@ -100,11 +100,8 @@ export class DefaultOpenAIAgentPrompt extends PromptElement} - Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here.
- - Identifiers only: `calculateTotal`, `Person`, `AppConfig`.
- File path link examples live in fileLinkification section below.
-
+ - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()`
+ - When mentioning files or line numbers, always follow the rules in fileLinkification section below:
diff --git a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx index f6ecfb083c..935e994707 100644 --- a/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx @@ -79,10 +79,9 @@ class Gpt51CodexPrompt extends PromptElement { - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. - When referring to a filename or symbol in the user's workspace, wrap it in backticks.
- - The class `Person` is in `src/models/person.ts`. - + Use proper Markdown formatting: + - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()`
+ - When mentioning files or line numbers, always follow the rules in fileLinkification section below:
diff --git a/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx index 3e96957fce..bc2125a841 100644 --- a/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt51Prompt.tsx @@ -260,9 +260,9 @@ class Gpt51Prompt extends PromptElement { Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable.

For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. + - ; } } diff --git a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx index 7dd32d70c7..0d04b8d285 100644 --- a/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx +++ b/src/extension/prompts/node/agent/openai/gpt5Prompt.tsx @@ -215,10 +215,8 @@ class DefaultGpt5AgentPrompt extends PromptElement {
For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting.

- When referring to a filename or symbol in the user's workspace, wrap it in backticks.
- - The class `Person` is in `src/models/person.ts`. - + - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()`
+ - When mentioning files or line numbers, always follow the rules in fileLinkification section below: diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap index d6b0e19371..0c76541aa1 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap @@ -74,35 +74,40 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). - -File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap index c45113467e..17d607ff7a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap @@ -43,32 +43,40 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap index 52cccf2344..504b022813 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-4.1.spec.snap @@ -45,37 +45,40 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. - -Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in fileLinkification section below. - - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap index a3865eb86f..ad26653f3c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex-mini.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap index a3865eb86f..ad26653f3c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1-codex.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap index 19990e1143..7b57c21406 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.1.spec.snap @@ -234,36 +234,44 @@ You are producing plain text that will later be styled by the CLI. Follow these Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable. -For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap index aeaf2a726b..80142f6756 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gpt-5.spec.snap @@ -199,35 +199,40 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap index fc10569ece..7b51f397e9 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-grok-code-fast-1.spec.snap @@ -50,32 +50,40 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap index 616d5a31ae..5a34ce8892 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-sonnet-4.5.spec.snap @@ -75,35 +75,40 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). - -File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap index 5ac7454911..147e265dfe 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gemini-2.0-flash.spec.snap @@ -45,32 +45,40 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap index 151b0d6a29..51dc7a9017 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-4.1.spec.snap @@ -81,37 +81,40 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. - -Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in fileLinkification section below. - - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap index a8ff341993..356cf75c11 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex-mini.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap index a8ff341993..356cf75c11 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1-codex.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap index ada5092f8c..00556d9472 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.1.spec.snap @@ -269,36 +269,44 @@ You are producing plain text that will later be styled by the CLI. Follow these Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable. -For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap index ebdbc15097..fa2ad013a4 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-gpt-5.spec.snap @@ -235,35 +235,40 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap index e19267bb8a..b21fe5e352 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-grok-code-fast-1.spec.snap @@ -52,32 +52,40 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap index 0022b58de0..bfeabb1360 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-sonnet-4.5.spec.snap @@ -62,35 +62,40 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). - -File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap index d7d3e50e3e..5c8585e066 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gemini-2.0-flash.spec.snap @@ -32,32 +32,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap index 7ed78e68a0..2a86517443 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-4.1.spec.snap @@ -34,37 +34,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. - -Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in fileLinkification section below. - - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap index ea0e93add9..61f5b5897b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex-mini.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap index ea0e93add9..61f5b5897b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1-codex.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap index 86f6dbe792..3eec1f4e13 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.1.spec.snap @@ -234,36 +234,44 @@ You are producing plain text that will later be styled by the CLI. Follow these Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable. -For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap index 3db9ba71d5..76b978fd06 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-gpt-5.spec.snap @@ -199,35 +199,40 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap index 1c33c0a29e..c0810ac9ce 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-grok-code-fast-1.spec.snap @@ -39,32 +39,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap index 27eef930d8..f506e4a01e 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-sonnet-4.5.spec.snap @@ -62,35 +62,40 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). - -File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap index 70e0f88bf9..8888f6b8cd 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gemini-2.0-flash.spec.snap @@ -32,32 +32,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap index 3ad994f089..228013a417 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-4.1.spec.snap @@ -34,37 +34,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. - -Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in fileLinkification section below. - - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap index 1d59f8a149..852dc2aed8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex-mini.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap index 1d59f8a149..852dc2aed8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1-codex.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap index a57637e381..a53717341c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.1.spec.snap @@ -234,36 +234,44 @@ You are producing plain text that will later be styled by the CLI. Follow these Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable. -For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap index ac1b8fc778..bc4dff0516 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-gpt-5.spec.snap @@ -199,35 +199,40 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap index 0d6d29f2ca..a1884362f8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-grok-code-fast-1.spec.snap @@ -39,32 +39,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap index d4f387596f..c767e552da 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-sonnet-4.5.spec.snap @@ -62,35 +62,40 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). - -File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap index 01be0526ef..b82e96ed20 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gemini-2.0-flash.spec.snap @@ -32,32 +32,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap index a31f32a562..afc1fba700 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-4.1.spec.snap @@ -34,37 +34,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. - -Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in fileLinkification section below. - - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap index 5176ae3f04..487e376bf6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex-mini.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap index 5176ae3f04..487e376bf6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1-codex.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap index 7047641c63..ec01198136 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.1.spec.snap @@ -234,36 +234,44 @@ You are producing plain text that will later be styled by the CLI. Follow these Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable. -For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + [copilot_cache_control: { type: 'ephemeral' }] ~~~ diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap index 4651d027b0..d8f6f36651 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-gpt-5.spec.snap @@ -199,35 +199,40 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap index 8a495d9a81..e7251712cd 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-grok-code-fast-1.spec.snap @@ -39,32 +39,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap index 6586d8a6da..7131ec62c0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-sonnet-4.5.spec.snap @@ -62,35 +62,40 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). - -File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap index 1b385e5d3d..ea0d9547d6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gemini-2.0-flash.spec.snap @@ -32,32 +32,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap index d0cbbf2903..b8884331b1 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-4.1.spec.snap @@ -34,37 +34,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. - -Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in fileLinkification section below. - - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap index 692b979cb4..f8f284fb0f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex-mini.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap index 692b979cb4..f8f284fb0f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1-codex.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap index d08cb542f7..59b95e2df0 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.1.spec.snap @@ -234,36 +234,44 @@ You are producing plain text that will later be styled by the CLI. Follow these Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable. -For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap index c1d0b34a44..63e85f1d8d 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-gpt-5.spec.snap @@ -199,35 +199,40 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap index 17301d6eca..8e7dc5e39a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-grok-code-fast-1.spec.snap @@ -39,32 +39,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap index 8657481e3e..fb3f1eea24 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-sonnet-4.5.spec.snap @@ -62,35 +62,40 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). - -File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap index 14c7ecf9ea..adac85b479 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gemini-2.0-flash.spec.snap @@ -32,32 +32,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap index f54955d593..370faa6458 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-4.1.spec.snap @@ -34,37 +34,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. - -Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in fileLinkification section below. - - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap index a3865eb86f..ad26653f3c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex-mini.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap index a3865eb86f..ad26653f3c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1-codex.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap index 19990e1143..7b57c21406 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.1.spec.snap @@ -234,36 +234,44 @@ You are producing plain text that will later be styled by the CLI. Follow these Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable. -For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap index aeaf2a726b..80142f6756 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-gpt-5.spec.snap @@ -199,35 +199,40 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap index e78c3e8007..0f407aa8a7 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-grok-code-fast-1.spec.snap @@ -39,32 +39,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap index 74270441ff..ba8d44f14b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-sonnet-4.5.spec.snap @@ -62,35 +62,40 @@ Do NOT use emojis unless explicitly requested by the user. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks). - -File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap index 08cbe8891d..452ad19480 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gemini-2.0-flash.spec.snap @@ -32,32 +32,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap index b62813af58..83ff2646f3 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-4.1.spec.snap @@ -34,37 +34,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here. - -Identifiers only: `calculateTotal`, `Person`, `AppConfig`. -File path link examples live in fileLinkification section below. - - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap index c0ecccb0a9..52149a5642 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex-mini.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap index c0ecccb0a9..52149a5642 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1-codex.spec.snap @@ -56,35 +56,40 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap index 00644f0a2a..c172e17598 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.1.spec.snap @@ -234,36 +234,44 @@ You are producing plain text that will later be styled by the CLI. Follow these Generally, ensure your final answers adapt their shape and depth to the request. For example, answers to code explanations should have a precise, structured explanation with code references that answer the question directly. For tasks with a simple implementation, lead with the outcome and supplement only with what's needed for clarity. Larger changes can be presented as a logical walkthrough of your approach, grouping related steps, explaining rationale where it adds value, and highlighting next actions to accelerate the user. Your answers should provide the right level of detail while being easily scannable. -For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + This is a test custom instruction file diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap index db7c29fafe..7f3814984a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-gpt-5.spec.snap @@ -199,35 +199,40 @@ Generally, ensure your final answers adapt their shape and depth to the request. For casual greetings, acknowledgements, or other one-off conversational messages that are not delivering substantive information or structured results, respond naturally without section headers or bullet formatting. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - - -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +- Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap index 74959c080b..9aa06131f2 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-grok-code-fast-1.spec.snap @@ -39,32 +39,40 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below -ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root. - -**Inline references:** Use the file path as link text within sentences: -- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line) -- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range) -- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file) - -**Bullet lists:** Explains what each reference is, so readers understand the context without clicking: -- [Await chat view](path/to/file.ts#L142) -- [Show widget](path/to/file.ts#L321) -Don't just list bare file paths like `file.ts#L142` - -NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).` - -Critical rules: -- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not. -- Path format: Strip drive letters and workspace parent folders - use only path after workspace root -- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)` -- Always use forward slashes `/`, never backslashes `/` -- Do not use URIs like file://, vscode:// for file paths. -- Percent-encode spaces in target only: `[My File.md](My%20File.md)` -- Each file reference needs complete path (don't abbreviate repeated files) -- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges -- Don't wrap links in backticks; only cite existing paths from context +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + diff --git a/src/extension/prompts/node/agent/xAIPrompts.tsx b/src/extension/prompts/node/agent/xAIPrompts.tsx index f904fb3cfb..72b4be5e73 100644 --- a/src/extension/prompts/node/agent/xAIPrompts.tsx +++ b/src/extension/prompts/node/agent/xAIPrompts.tsx @@ -106,7 +106,7 @@ class DefaultGrokCodeFastAgentPrompt extends PromptElement} - Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section
+ Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section below
From 461a9617aa92d9ed34697f0928ed19999113e27e Mon Sep 17 00:00:00 2001 From: Matt Bierner <12821956+mjbvz@users.noreply.github.com> Date: Wed, 26 Nov 2025 17:44:33 -0800 Subject: [PATCH 25/25] Update snapshots --- ...ts-all_non_edit_tools-arctic-fox.spec.snap | 43 ++++++++++++++++--- ...l_non_edit_tools-claude-opus-4.5.spec.snap | 42 +++++++++++++++--- ...gentPrompts-all_tools-arctic-fox.spec.snap | 43 ++++++++++++++++--- ...rompts-all_tools-claude-opus-4.5.spec.snap | 42 +++++++++++++++--- ...gentPrompts-cache_BPs-arctic-fox.spec.snap | 43 ++++++++++++++++--- ...rompts-cache_BPs-claude-opus-4.5.spec.snap | 42 +++++++++++++++--- ...cache_BPs_multi_round-arctic-fox.spec.snap | 43 ++++++++++++++++--- ..._BPs_multi_round-claude-opus-4.5.spec.snap | 42 +++++++++++++++--- ...not_in_system_message-arctic-fox.spec.snap | 43 ++++++++++++++++--- ...n_system_message-claude-opus-4.5.spec.snap | 42 +++++++++++++++--- ...rompts-one_attachment-arctic-fox.spec.snap | 43 ++++++++++++++++--- ...s-one_attachment-claude-opus-4.5.spec.snap | 42 +++++++++++++++--- ...ntPrompts-simple_case-arctic-fox.spec.snap | 43 ++++++++++++++++--- ...mpts-simple_case-claude-opus-4.5.spec.snap | 42 +++++++++++++++--- ...agentPrompts-tool_use-arctic-fox.spec.snap | 43 ++++++++++++++++--- ...Prompts-tool_use-claude-opus-4.5.spec.snap | 42 +++++++++++++++--- 16 files changed, 592 insertions(+), 88 deletions(-) diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-arctic-fox.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-arctic-fox.spec.snap index 94325df1bd..ad26653f3c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-arctic-fox.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-arctic-fox.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -55,10 +56,42 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-opus-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-opus-4.5.spec.snap index 574bbf5531..6030b8f8f2 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-opus-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-opus-4.5.spec.snap @@ -43,12 +43,42 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed
-Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. - +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-arctic-fox.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-arctic-fox.spec.snap index e8d2e765bf..356cf75c11 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-arctic-fox.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-arctic-fox.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -55,10 +56,42 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-opus-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-opus-4.5.spec.snap index cad2f991cb..09a3bf4084 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-opus-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_tools-claude-opus-4.5.spec.snap @@ -45,12 +45,42 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce Important Reminder: Markdown cells cannot be executed -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. - +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-arctic-fox.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-arctic-fox.spec.snap index 2c228b4ca4..61f5b5897b 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-arctic-fox.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-arctic-fox.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -55,10 +56,42 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-opus-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-opus-4.5.spec.snap index 4ec7629e69..3cf6b805bd 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-opus-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs-claude-opus-4.5.spec.snap @@ -32,12 +32,42 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. - +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-arctic-fox.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-arctic-fox.spec.snap index 93561efc31..852dc2aed8 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-arctic-fox.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-arctic-fox.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -55,10 +56,42 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-opus-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-opus-4.5.spec.snap index b7dbb91c9d..6025817217 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-opus-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-cache_BPs_multi_round-claude-opus-4.5.spec.snap @@ -32,12 +32,42 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. - +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-arctic-fox.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-arctic-fox.spec.snap index b64d0ae9d9..487e376bf6 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-arctic-fox.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-arctic-fox.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -55,10 +56,42 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-opus-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-opus-4.5.spec.snap index 7ed42f9d69..0ff84618ba 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-opus-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-custom_instructions_not_in_system_message-claude-opus-4.5.spec.snap @@ -32,12 +32,42 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. - +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-arctic-fox.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-arctic-fox.spec.snap index 2501dd8e21..f8f284fb0f 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-arctic-fox.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-arctic-fox.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -55,10 +56,42 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-opus-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-opus-4.5.spec.snap index 6ab2c80146..059b63117a 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-opus-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-one_attachment-claude-opus-4.5.spec.snap @@ -32,12 +32,42 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. - +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-arctic-fox.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-arctic-fox.spec.snap index 94325df1bd..ad26653f3c 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-arctic-fox.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-arctic-fox.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -55,10 +56,42 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-opus-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-opus-4.5.spec.snap index cac85bd5ec..f1319bc347 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-opus-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-simple_case-claude-opus-4.5.spec.snap @@ -32,12 +32,42 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. - +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-arctic-fox.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-arctic-fox.spec.snap index b5ef16d4d2..52149a5642 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-arctic-fox.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-arctic-fox.spec.snap @@ -47,7 +47,8 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Markdown text. Use structure only when it helps scanability. - Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help. - Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent. -- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **. +- Monospace: backticks for commands, env vars, and code identifiers; never combine with **. +- File path and line number formatting rules are defined in the fileLinkification section below. - Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible. - Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task. - Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording. @@ -55,10 +56,42 @@ You are producing text that will be rendered as markdown by the VS Code UI. Foll - Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets. -When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. - +Use proper Markdown formatting: - Wrap symbol names (classes, methods, variables) in backticks: `MyClass`, `handleClick()` +- When mentioning files or line numbers, always follow the rules in fileLinkification section below: +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + + diff --git a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-opus-4.5.spec.snap b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-opus-4.5.spec.snap index 527ec5edf2..9ee564ced4 100644 --- a/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-opus-4.5.spec.snap +++ b/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-tool_use-claude-opus-4.5.spec.snap @@ -32,12 +32,42 @@ You don't currently have any tools available for running terminal commands. If t Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you. -Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks. - -The class `Person` is in `src/models/person.ts`. -The function `calculateTotal` is defined in `lib/utils/math.ts`. -You can find the configuration in `config/app.config.json`. - +Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section + +When mentioning files or line numbers, always convert them to markdown links using workspace-relative paths and 1-based line numbers. +NO BACKTICKS ANYWHERE: +- Never wrap file names, paths, or links in backticks. +- Never use inline-code formatting for any file reference. + +REQUIRED FORMATS: +- File: [path/file.ts](path/file.ts) +- Line: [file.ts](file.ts#L10) +- Range: [file.ts](file.ts#L10-L12) + +PATH RULES: +- Without line numbers: Display text must match the target path. +- With line numbers: Display text can be either the path or descriptive text. +- Use '/' only; strip drive letters and external folders. +- Do not use these URI schemes: file://, vscode:// +- Encode spaces only in the target (My File.md → My%20File.md). +- Non-contiguous lines require separate links. NEVER use comma-separated line references like #L10-L12, L20. +- Valid formats: [file.ts](file.ts#L10) or [file.ts#L10] only. Invalid: ([file.ts#L10]) or [file.ts](file.ts)#L10 + +USAGE EXAMPLES: +- With path as display: The handler is in [src/handler.ts](src/handler.ts#L10). +- With descriptive text: The [widget initialization](src/widget.ts#L321) runs on startup. +- Bullet list: [Init widget](src/widget.ts#L321) +- File only: See [src/config.ts](src/config.ts) for settings. + +FORBIDDEN (NEVER OUTPUT): +- Inline code: `file.ts`, `src/file.ts`, `L86`. +- Plain text file names: file.ts, chatService.ts. +- References without links when mentioning specific file locations. +- Specific line citations without links ("Line 86", "at line 86", "on line 25"). +- Combining multiple line references in one link: [file.ts#L10-L12, L20](file.ts#L10-L12, L20) + + +