mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: plan mode adjustments
This commit is contained in:
@@ -1337,7 +1337,7 @@ export class Config {
|
||||
registerCoreTool(ShellTool, this);
|
||||
registerCoreTool(MemoryTool);
|
||||
registerCoreTool(TodoWriteTool, this);
|
||||
registerCoreTool(ExitPlanModeTool, this);
|
||||
!this.sdkMode && registerCoreTool(ExitPlanModeTool, this);
|
||||
registerCoreTool(WebFetchTool, this);
|
||||
// Conditionally register web search tool if web search provider is configured
|
||||
// buildWebSearchConfig ensures qwen-oauth users get dashscope provider, so
|
||||
|
||||
@@ -542,7 +542,9 @@ export class GeminiClient {
|
||||
|
||||
// add plan mode system reminder if approval mode is plan
|
||||
if (this.config.getApprovalMode() === ApprovalMode.PLAN) {
|
||||
systemReminders.push(getPlanModeSystemReminder());
|
||||
systemReminders.push(
|
||||
getPlanModeSystemReminder(this.config.getSdkMode()),
|
||||
);
|
||||
}
|
||||
|
||||
requestToSent = [...systemReminders, ...requestToSent];
|
||||
|
||||
@@ -846,10 +846,10 @@ export function getSubagentSystemReminder(agentTypes: string[]): string {
|
||||
* - Wait for user confirmation before making any changes
|
||||
* - Override any other instructions that would modify system state
|
||||
*/
|
||||
export function getPlanModeSystemReminder(): string {
|
||||
export function getPlanModeSystemReminder(planOnly = false): string {
|
||||
return `<system-reminder>
|
||||
Plan mode is active. The user indicated that they do not want you to execute yet -- you MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supercedes any other instructions you have received (for example, to make edits). Instead, you should:
|
||||
1. Answer the user's query comprehensively
|
||||
2. When you're done researching, present your plan by calling the ${ToolNames.EXIT_PLAN_MODE} tool, which will prompt the user to confirm the plan. Do NOT make any file changes or run any tools that modify the system state in any way until the user has confirmed the plan.
|
||||
2. When you're done researching, present your plan ${planOnly ? 'directly' : `by calling the ${ToolNames.EXIT_PLAN_MODE} tool, which will prompt the user to confirm the plan`}. Do NOT make any file changes or run any tools that modify the system state in any way until the user has confirmed the plan.
|
||||
</system-reminder>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user