mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat: Implement Plan Mode for Safe Code Planning (#658)
This commit is contained in:
@@ -883,6 +883,16 @@ function toToolCallContent(toolResult: ToolResult): acp.ToolCallContent | null {
|
||||
type: 'content',
|
||||
content: { type: 'text', text: todoText },
|
||||
};
|
||||
} else if (
|
||||
'type' in toolResult.returnDisplay &&
|
||||
toolResult.returnDisplay.type === 'plan_summary'
|
||||
) {
|
||||
const planDisplay = toolResult.returnDisplay;
|
||||
const planText = `${planDisplay.message}\n\n${planDisplay.plan}`;
|
||||
return {
|
||||
type: 'content',
|
||||
content: { type: 'text', text: planText },
|
||||
};
|
||||
} else if ('fileDiff' in toolResult.returnDisplay) {
|
||||
// Handle FileDiff
|
||||
return {
|
||||
@@ -954,6 +964,15 @@ function toPermissionOptions(
|
||||
},
|
||||
...basicPermissionOptions,
|
||||
];
|
||||
case 'plan':
|
||||
return [
|
||||
{
|
||||
optionId: ToolConfirmationOutcome.ProceedAlways,
|
||||
name: `Always Allow Plans`,
|
||||
kind: 'allow_always',
|
||||
},
|
||||
...basicPermissionOptions,
|
||||
];
|
||||
default: {
|
||||
const unreachable: never = confirmation;
|
||||
throw new Error(`Unexpected: ${unreachable}`);
|
||||
|
||||
Reference in New Issue
Block a user