computeAutomaticInstructions.ts ×7

Frontier kind: Code frontier

unlabeled · c_1969d1bf8ac1

13 tests · 67947 LOC · 327 files · introduces 0 tests · 29 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges29 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
6600 ranges67947 lines · 327 files · Browse complete extent
All tests (intent)
13 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.

1 file ranked by introduced lines: 29 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts 29 introduced LOC · 7 ranges

Open complete file

355 const entries: string[] = [];
356 if (fileReadTool) {
358 > const searchNestedAgentMd = this._configurationService.getValue(PromptsConfig.USE_NESTED_AGENT_MD);
359 > const agentsMdPromise = searchNestedAgentMd ? this._promptsService.listNestedAgentMDs(token) : Promise.resolve([]);
360 >
361 > entries.push('<instructions>');
362 > entries.push('Here is a list of instruction files that contain rules for working with this codebase.');
363 > entries.push('These files are important for understanding the codebase structure, conventions, and best practices.');
364 > entries.push('When an instruction file applies to your task (based on its description or applyTo pattern), follow the rules specified in it.');
365 > entries.push(`If the file content is not already included in the context, use the ${fileReadTool.variable} tool to read it before proceeding. Use the exact value from the <file> element as-is with the tool; do not add or remove prefixes or otherwise modify it.`);
366 > entries.push('Only load instruction files when they are relevant to the current task. Do not eagerly load all instructions upfront.');
367 > entries.push('When modifying or creating files, check for instructions whose applyTo pattern matches the file path and follow them.');
368 > let hasContent = false;
369 > for (const instruction of instructionFiles) {
370 if (!matchesSessionType(instruction.sessionTypes, currentSessionType)) {
371 continue;
382 hasContent = true;
383 }
385 > const agentsMdFiles = await agentsMdPromise;
386 > for (const { uri } of agentsMdFiles) {
387 const folderName = this._labelService.getUriLabel(dirname(uri), { relative: true });
388 const description = folderName.trim().length === 0 ? localize('instruction.file.description.agentsmd.root', 'Instructions for the workspace') : localize('instruction.file.description.agentsmd.folder', 'Instructions for folder \'{0}\'', folderName);
394
395 }
397 > if (!hasContent) {
398 entries.length = 0; // clear entries
400 entries.push('</instructions>', '', ''); // add trailing newline
401 }
403 > const agentSkills = await this._promptsService.findAgentSkills(token);
404 > // Filter out skills with disableModelInvocation=true (they can only be triggered manually via /name)
405 > // Also filter by session type in consumers outside the prompts service
406 > // Also filter out the troubleshoot skill when agent debug log file logging setting is disabled
407 > const isFileLoggingEnabled = this._configurationService.getValue<boolean>(AGENT_DEBUG_LOG_FILE_LOGGING_ENABLED_SETTING);
408 > const modelInvocableSkills = agentSkills?.filter(skill => {
409 if (!skill.description) {
410 debugInfo.debugDetails.push({ category: 'skipped', name: skill.name, uri: skill.uri, reason: localize('debugDetail.skillNoDescription', 'no description for model invocation') });
424 }
425 return true;
427 > if (modelInvocableSkills && modelInvocableSkills.length > 0) {
428 // Log per-skill telemetry for each skill loaded into context
429 this._logSkillLoadedTelemetry(modelInvocableSkills);
508 entries.push('</skills>', '', ''); // add trailing newline
509 }
511 if (runSubagentTool) {
512 const canUseAgent = (() => {