mirror of
https://github.com/7836246/cursor2api.git
synced 2026-09-03 07:20:02 +08:00
fix: 防止模型在没有任务时死循环执行 echo ready
- 明确指示如果只要回复或者等待任务时,必须使用 AskFollowupQuestion 或 attempt_completion 这样的交互工具,而不是真的去跑 bash 命令。
This commit is contained in:
@@ -76,7 +76,9 @@ Please output your desired action in EXACTLY this markdown format:
|
||||
Here are the valid ACTION_NAMEs and parameters you can choose from:
|
||||
${toolList}
|
||||
|
||||
Remember, you MUST provide at least one \`\`\`json action ... \`\`\` block in every response.`;
|
||||
CRITICAL RULES:
|
||||
1. You MUST provide at least one \`\`\`json action ... \`\`\` block in every response.
|
||||
2. If you are waiting for me to give you a task, or you want to ask me a question, DO NOT run meaningless terminal commands (like "echo ready"). Instead, use the appropriate communication tool (such as AskFollowupQuestion, ask_followup_question, or attempt_completion).`;
|
||||
}
|
||||
|
||||
// ==================== 请求转换 ====================
|
||||
@@ -138,7 +140,7 @@ export function convertToCursorRequest(req: AnthropicRequest): CursorChatRequest
|
||||
|
||||
// 在每条用户消息末尾追加格式提醒
|
||||
if (hasTools && msg.role === 'user') {
|
||||
text += '\n\n[Reminder: Please output a ```json action block for the action you want to take.]';
|
||||
text += '\n\n[Reminder: Please output a ```json action block for the action you want to take. If you have no task or want to respond, use AskFollowupQuestion or ask_followup_question or attempt_completion, DO NOT use Bash/execute_command]';
|
||||
}
|
||||
|
||||
messages.push({
|
||||
|
||||
Reference in New Issue
Block a user