ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
--- applyTo: 'src/extension/prompts/node/agent/**' description: Model-specific prompt authoring and registry guidelines ---
Guidelines for creating, registering, and testing model-specific prompts via the PromptRegistry system.
The PromptRegistry in promptRegistry.ts maps AI models to their optimal prompt structures. Each model provider has a resolver class implementing IAgentPrompt that returns prompt customizations for that provider's models.
When PromptRegistry.resolveAllCustomizations() is called: 1. Phase 1 — `matchesModel()`: Iterates registered resolvers in order, calling matchesModel(). First true wins. 2. Phase 2 — `familyPrefixes`: If no matchesModel matched, checks endpoint.family.startsWith(prefix). First match wins. 3. Phase 3 — provider fallback: If neither phase matched, checks predicates registered through registerFallbackPrompt(resolver, matchesModel). First match wins. 4. Defaults: If no resolver matches, defaults are used for all customizations.
Registration order matters within each phase. Register broad provider defaults through registerFallbackPrompt, not matchesModel or familyPrefixes, so they never shadow a model-specific resolver or a family-prefix registration.
Unrecognized GPT families and endpoints identified as OpenAI use the latest approved GPT prompt bundle. The single promotion point is the LatestOpenAIPromptResolver import in openai/latestOpenAIPrompt.ts, currently GPT-5.6. It reuses the entire resolver, including reminders, identity, safety, tool-reference hints, and user-query tag defaults, without copying prompt text.
defaultOpenAIPrompt.tsx take precedence. Version matchers must distinguish gpt-5.1 and its hyphenated variants from gpt-5.10.latestOpenAIPrompt.ts and the expected default in test/openAIPrompts.spec.ts. Run its routing/rendering tests and the existing agent prompt snapshots. Keep older specialized resolvers unchanged.The IAgentPrompt interface provides these customization methods:
| Method | Returns | Purpose | |--------|---------|--------| | resolveSystemPrompt(endpoint) | SystemPrompt | Main system prompt class | | resolveReminderInstructions?(endpoint) | ReminderInstructionsConstructor | Reminder instructions appended to user messages | | resolveToolReferencesHint?(endpoint) | ToolReferencesHintConstructor | Tool usage hints | | resolveCopilotIdentityRules?(endpoint) | CopilotIdentityRulesConstructor | Identity/role rules | | resolveSafetyRules?(endpoint) | SafetyRulesConstructor | Safety rules | | resolveUserQueryTagName?(endpoint) | string | Tag name wrapping user queries |
All methods are optional except resolveSystemPrompt. Unimplemented methods fall back to defaults (DefaultReminderInstructions, DefaultToolReferencesHint, etc.).
Resolvers are created via instantiationService.createInstance(), so they support full constructor DI. Inject IConfigurationService, IExperimentationService, etc. to read experiment flags or config values:
class MyProviderPromptResolver implements IAgentPrompt {
static readonly familyPrefixes = ['my-model'];
constructor(
@IConfigurationService private readonly configurationService: IConfigurationService,
@IExperimentationService private readonly experimentationService: IExperimentationService,
) { }
private getVariant(): string {
return this.configurationService.getExperimentBasedConfig(
ConfigKey.MyPromptVariant, this.experimentationService);
}
resolveSystemPrompt(endpoint: IChatEndpoint): SystemPrompt | undefined {
if (this.getVariant() === 'optimized') {
return MyOptimizedPrompt;
}
if (endpoint.model?.includes('v4')) {
return MyV4Prompt;
}
return MyDefaultPrompt;
}
resolveReminderInstructions(endpoint: IChatEndpoint): ReminderInstructionsConstructor | undefined {
if (this.getVariant() === 'optimized') {
return MyOptimizedReminderInstructions;
}
return MyDefaultReminderInstructions;
}
resolveCopilotIdentityRules(endpoint: IChatEndpoint): CopilotIdentityRulesConstructor | undefined {
return MyCopilotIdentityRules;
}
resolveSafetyRules(endpoint: IChatEndpoint): SafetyRulesConstructor | undefined {
return MySafetyRules;
}
}See AnthropicPromptResolver in anthropicPrompts.tsx for a production example using config and experiment flags across multiple resolve methods.
Copy DefaultAgentPrompt from defaultAgentInstructions.tsx:
export class MyProviderAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
async render(state: void, sizing: PromptSizing) {
const tools = detectToolCapabilities(this.props.availableTools);
return <InstructionMessage>
{/* Your customizations here */}
</InstructionMessage>;
}
}A resolver can match models by hash (via matchesModel) and/or by family prefix:
class MyProviderPromptResolver implements IAgentPrompt {
static readonly familyPrefixes = ['my-model', 'provider-name'];
// Optional: hash-based matching for models that can't be identified by prefix
static async matchesModel(endpoint: IChatEndpoint): Promise<boolean> {
return isMyModel(endpoint);
}
resolveSystemPrompt(endpoint: IChatEndpoint): SystemPrompt | undefined {
return MyProviderAgentPrompt;
}
resolveReminderInstructions(endpoint: IChatEndpoint): ReminderInstructionsConstructor | undefined {
return MyProviderReminderInstructions;
}
}A single resolver can return different prompts for different models within the same family using conditional logic inside resolveSystemPrompt.
Register at the bottom of the file:
PromptRegistry.registerPrompt(MyProviderPromptResolver);Then add the import in allAgentPrompts.ts.
Add your model family to the list at the top of test/agentPrompt.spec.tsx. This renders the prompt for your model with different input scenarios and validates against snapshots.
detectToolCapabilities).Run the model through test scenarios and check these categories before adding customizations:
1. Tool Usage Patterns
replace_string_in_file, apply_patch, insert_edit_into_file) instead of code blocksread_file, semantic_search, grep_search, file_search) to gather contextrun_in_terminal) instead of bash commandsmanage_todo_list) for complex tasks2. Response Format
3. Workflow Execution
Only add these if the model consistently fails the behavior. Target the specific issue with 1-2 sentences:
// Fix: Model shows code blocks instead of using edit tools
{tools[ToolName.ReplaceStringInFile] && <>
NEVER print out a code block with file changes unless the user asked for it.
Use the appropriate edit tool (replace_string_in_file, apply_patch, or insert_into_file).
</>}
// Fix: Model calls terminal tool in parallel
{tools[ToolName.CoreRunInTerminal] && <>
Don't call the run_in_terminal tool multiple times in parallel.
Instead, run one command and wait for the output before running the next command.
</>}
// Fix: Model doesn't use TODO tool for planning
{tools[ToolName.CoreManageTodoList] && <>
For complex multi-step tasks, use the manage_todo_list tool to track your progress
and provide visibility to the user.
</>}
// Fix: Model front-loads thinking and only summarizes at the end
Provide brief progress updates every 3-5 tool calls to keep the user informed of your progress.<br />
After completing parallel tool calls, provide a brief status update before proceeding to the next step.<br />