src/vs/platform/agentHost/common/reasoningEffort.ts
58 LOC · 58 covered · 0 uncovered · 4 ranges · 822 concepts · 2 introducers · 402 tests
File neighbourhood
The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.
Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file
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 related-file, concept, and source links on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.
/*---------------------------------------------------------------------------------------------
reasoningEffort.ts ×2
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { localize } from '../../../nls.js';
/**
* Union of every reasoning-effort / thinking-level value surfaced by any
* agent-host provider. Individual providers expose a subset:
* - Codex: `'minimal' | 'low' | 'medium' | 'high'`
* - Copilot / Claude: `'low' | 'medium' | 'high' | 'xhigh' | 'max'`
*
* The label/description helpers below are the single source of truth for
* the localized picker strings so every provider renders the same value
* consistently.
*/
export type ReasoningEffortLevel = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
/**
* Localized, title-cased picker label for a reasoning-effort value.
* Falls back to capitalizing an unrecognized value so a newly-introduced
* effort tier never surfaces raw (e.g. lowercase `'max'`).
*/
export function getReasoningEffortLabel(level: string): string {
case 'none': return localize('reasoningEffort.none', "None");
case 'minimal': return localize('reasoningEffort.minimal', "Minimal");
case 'low': return localize('reasoningEffort.low', "Low");
case 'medium': return localize('reasoningEffort.medium', "Medium");
case 'high': return localize('reasoningEffort.high', "High");
case 'xhigh': return localize('reasoningEffort.xhigh', "Extra High");
case 'max': return localize('reasoningEffort.max', "Max");
default: return level.charAt(0).toUpperCase() + level.slice(1);
}
}
/**
* Localized description for a reasoning-effort value, shown beneath the
* label in the picker. Returns `undefined` for an unrecognized value so
* callers can omit the description rather than show an empty string.
*
* Wording mirrors the canonical extension helper `getReasoningEffortDescription`
* in `extensions/copilot/src/extension/conversation/common/languageModelAccess.ts`
* so every provider surfaces the same descriptions.
*/
export function getReasoningEffortDescription(level: string): string | undefined {
case 'none': return localize('reasoningEffort.noneDescription', "No reasoning applied");
case 'minimal': return localize('reasoningEffort.minimalDescription', "Minimal reasoning for fastest responses");
case 'low': return localize('reasoningEffort.lowDescription', "Faster responses with less reasoning");
case 'medium': return localize('reasoningEffort.mediumDescription', "Balanced reasoning and speed");
case 'high': return localize('reasoningEffort.highDescription', "Greater reasoning depth but slower");
case 'xhigh': return localize('reasoningEffort.xhighDescription', "Highest reasoning depth but slowest");
case 'max': return localize('reasoningEffort.maxDescription', "Absolute maximum capability with no constraints");
default: return undefined;
}
}