promptRegistry.ts ×10

Frontier kind: Code frontier

unlabeled · c_badf8f26cef3

50 tests · 7250 LOC · 41 files · introduces 0 tests · 22 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges22 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
596 ranges7250 lines · 41 files · Browse complete extent
All tests (intent)
50 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 22 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/prompts/promptRegistry.ts 19 introduced LOC · 10 ranges

Open complete file

151 */
152 resolveSystemMessageConfig(model: ModelSelection | undefined, context: IAgentHostPromptContext): SystemMessageConfig {
153 > const config = this._withUniversalSections(this._resolveModelConfig(model, context), context); promptRegistry.ts
154 > const withWorkspacelessScratch = this._withWorkspacelessScratch(config, context);
155 > return appendSystemMessageContent(withWorkspacelessScratch, COPILOT_AGENT_HOST_FILE_LINK_INSTRUCTIONS);
156 > }
157
158 /**
166 */
167 private _resolveModelConfig(model: ModelSelection | undefined, context: IAgentHostPromptContext): SystemMessageConfig {
168 > if (!model) { promptRegistry.ts
169 return COPILOT_AGENT_HOST_SYSTEM_MESSAGE;
170 }
175 const contributor = new ctor();
176 const fullPrompt = contributor.resolveFullSystemPrompt?.(model, context);
177 > if (fullPrompt !== undefined) { promptRegistry.ts
178 return fullSystemPrompt(fullPrompt);
179 }
180 const sections = contributor.resolveSectionOverrides?.(model, context);
181 > // An empty overrides object is treated as "no override" so we keep the promptRegistry.ts
182 > // default identity customization rather than emitting a
183 > // `{ mode: 'customize', sections: {} }` that drops it.
184 > if (sections && Object.keys(sections).length > 0) {
185 return sectionOverrides(sections);
186 }
187 return COPILOT_AGENT_HOST_SYSTEM_MESSAGE;
189
190 /**
206 */
207 private _withUniversalSections(config: SystemMessageConfig, context: IAgentHostPromptContext): SystemMessageConfig {
208 > if (config.mode !== 'customize') { promptRegistry.ts
209 return config;
210 }
211 > const toolInstructions = resolveToolInstructionsOverride(name => context.hasClientTool(name), config.sections?.tool_instructions, toolSearchInstructionLines(context.toolSearchActive)); promptRegistry.ts
212 > if (!toolInstructions) {
213 return config;
214 }
215 return { ...config, sections: { ...config.sections, tool_instructions: toolInstructions } };
217
218 /**
227 */
228 private _withWorkspacelessScratch(config: SystemMessageConfig, context: IAgentHostPromptContext): SystemMessageConfig {
229 > if (!context.workspaceless || config.mode !== 'customize') { promptRegistry.ts
230 return config;
231 }
232 > const content = config.content ? `${config.content}\n\n${COPILOT_AGENT_HOST_WORKSPACELESS_INSTRUCTIONS}` : COPILOT_AGENT_HOST_WORKSPACELESS_INSTRUCTIONS; promptRegistry.ts
233 > return { ...config, content };
234 > }
235 }
236
src/vs/platform/agentHost/node/copilot/prompts/systemMessage.ts 3 introduced LOC · 2 ranges

Open complete file

85 /** Appends universal content without changing a full-prompt replacement. */
86 export function appendSystemMessageContent(config: SystemMessageConfig, content: string): SystemMessageConfig {
87 > if (config.mode === 'replace') { systemMessage.ts
88 return config;
89 }
90 const existing = config.content;
91 > return { ...config, content: existing ? `${existing}\n\n${content}` : content }; systemMessage.ts
92 > }
93
94 /**