Skip to content

Commit c6c49ec

Browse files
authored
Rename plan_mode_response to plan_mode_respond (RooCodeInc#2498)
* Rename plan_mode_response to plan_mode_respond * Create good-carrots-tie.md
1 parent 8c4b642 commit c6c49ec

File tree

7 files changed

+26
-21
lines changed

7 files changed

+26
-21
lines changed

.changeset/good-carrots-tie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
Fix bug where Cline would use plan_mode_response bug without response parameter

src/core/Cline.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ export class Cline {
10381038
: ""
10391039
}` +
10401040
(responseText
1041-
? `\n\n${this.chatSettings?.mode === "plan" ? "New message to respond to with plan_mode_response tool (be sure to provide your response in the <response> parameter)" : "New instructions for task continuation"}:\n<user_message>\n${responseText}\n</user_message>`
1041+
? `\n\n${this.chatSettings?.mode === "plan" ? "New message to respond to with plan_mode_respond tool (be sure to provide your response in the <response> parameter)" : "New instructions for task continuation"}:\n<user_message>\n${responseText}\n</user_message>`
10421042
: this.chatSettings.mode === "plan"
10431043
? "(The user did not provide a new message. Consider asking them how they'd like you to proceed, or to switch to Act mode to continue with the task.)"
10441044
: ""),
@@ -1572,7 +1572,7 @@ export class Cline {
15721572
return `[${block.name} for '${block.params.server_name}']`
15731573
case "ask_followup_question":
15741574
return `[${block.name} for '${block.params.question}']`
1575-
case "plan_mode_response":
1575+
case "plan_mode_respond":
15761576
return `[${block.name}]`
15771577
case "attempt_completion":
15781578
return `[${block.name}]`
@@ -2802,7 +2802,7 @@ export class Cline {
28022802
break
28032803
}
28042804
}
2805-
case "plan_mode_response": {
2805+
case "plan_mode_respond": {
28062806
const response: string | undefined = block.params.response
28072807
const optionsRaw: string | undefined = block.params.options
28082808
const sharedMessage = {
@@ -2811,12 +2811,12 @@ export class Cline {
28112811
} satisfies ClinePlanModeResponse
28122812
try {
28132813
if (block.partial) {
2814-
await this.ask("plan_mode_response", JSON.stringify(sharedMessage), block.partial).catch(() => {})
2814+
await this.ask("plan_mode_respond", JSON.stringify(sharedMessage), block.partial).catch(() => {})
28152815
break
28162816
} else {
28172817
if (!response) {
28182818
this.consecutiveMistakeCount++
2819-
pushToolResult(await this.sayAndCreateMissingParamError("plan_mode_response", "response"))
2819+
pushToolResult(await this.sayAndCreateMissingParamError("plan_mode_respond", "response"))
28202820
//
28212821
break
28222822
}
@@ -2830,7 +2830,7 @@ export class Cline {
28302830
// }
28312831

28322832
this.isAwaitingPlanResponse = true
2833-
let { text, images } = await this.ask("plan_mode_response", JSON.stringify(sharedMessage), false)
2833+
let { text, images } = await this.ask("plan_mode_respond", JSON.stringify(sharedMessage), false)
28342834
this.isAwaitingPlanResponse = false
28352835

28362836
// webview invoke sendMessage will send this marker in order to put webview into the proper state (responding to an ask) and as a flag to extension that the user switched to ACT mode.
@@ -2842,7 +2842,7 @@ export class Cline {
28422842
if (optionsRaw && text && parsePartialArrayString(optionsRaw).includes(text)) {
28432843
// Valid option selected, don't show user message in UI
28442844
// Update last followup message with selected option
2845-
const lastPlanMessage = findLast(this.clineMessages, (m) => m.ask === "plan_mode_response")
2845+
const lastPlanMessage = findLast(this.clineMessages, (m) => m.ask === "plan_mode_respond")
28462846
if (lastPlanMessage) {
28472847
lastPlanMessage.text = JSON.stringify({
28482848
...sharedMessage,
@@ -3740,7 +3740,7 @@ export class Cline {
37403740
if (this.chatSettings.mode === "plan") {
37413741
details += "\nPLAN MODE"
37423742
details +=
3743-
"\nIn this mode you should focus on information gathering, asking questions, and architecting a solution. Once you have a plan, use the plan_mode_response tool to engage in a conversational back and forth with the user. Do not use the plan_mode_response tool until you've gathered all the information you need e.g. with read_file or ask_followup_question."
3743+
"\nIn this mode you should focus on information gathering, asking questions, and architecting a solution. Once you have a plan, use the plan_mode_respond tool to engage in a conversational back and forth with the user. Do not use the plan_mode_respond tool until you've gathered all the information you need e.g. with read_file or ask_followup_question."
37443744
details +=
37453745
'\n(Remember: If it seems the user wants you to use tools only available in Act Mode, you should ask the user to "toggle to Act mode" (use those words) - they will have to manually do this themselves with the Plan/Act toggle button below. You do not have the ability to switch to Act Mode yourself, and must wait for the user to do it themselves once they are satisfied with the plan. You also cannot present an option to toggle to Act mode, as this will be something you need to direct the user to do manually themselves.)'
37463746
} else {

src/core/assistant-message/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const toolUseNames = [
2020
"use_mcp_tool",
2121
"access_mcp_resource",
2222
"ask_followup_question",
23-
"plan_mode_response",
23+
"plan_mode_respond",
2424
"attempt_completion",
2525
] as const
2626

src/core/prompts/system.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,18 @@ Your final result description here
239239
<command>Command to demonstrate result (optional)</command>
240240
</attempt_completion>
241241
242-
## plan_mode_response
242+
## plan_mode_respond
243243
Description: Respond to the user's inquiry in an effort to plan a solution to the user's task. This tool should be used when you need to provide a response to a question or statement from the user about how you plan to accomplish the task. This tool is only available in PLAN MODE. The environment_details will specify the current mode, if it is not PLAN MODE then you should not use this tool. Depending on the user's message, you may ask questions to get clarification about the user's request, architect a solution to the task, and to brainstorm ideas with the user. For example, if the user's task is to create a website, you may start by asking some clarifying questions, then present a detailed plan for how you will accomplish the task given the context, and perhaps engage in a back and forth to finalize the details before the user switches you to ACT MODE to implement the solution.
244244
Parameters:
245245
- response: (required) The response to provide to the user. Do not try to use tools in this parameter, this is simply a chat response.
246246
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible choice or path forward in the planning process. This can help guide the discussion and make it easier for the user to provide input on key decisions. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. Do NOT present an option to toggle to Act mode, as this will be something you need to direct the user to do manually themselves.
247247
Usage:
248-
<plan_mode_response>
248+
<plan_mode_respond>
249249
<response>Your response here</response>
250250
<options>
251251
Array of options here (optional), e.g. ["Option 1", "Option 2", "Option 3"]
252252
</options>
253-
</plan_mode_response>
253+
</plan_mode_respond>
254254
255255
# Tool Use Examples
256256
@@ -881,11 +881,11 @@ ACT MODE V.S. PLAN MODE
881881
882882
In each user message, the environment_details will specify the current mode. There are two modes:
883883
884-
- ACT MODE: In this mode, you have access to all tools EXCEPT the plan_mode_response tool.
884+
- ACT MODE: In this mode, you have access to all tools EXCEPT the plan_mode_respond tool.
885885
- In ACT MODE, you use tools to accomplish the user's task. Once you've completed the user's task, you use the attempt_completion tool to present the result of the task to the user.
886-
- PLAN MODE: In this special mode, you have access to the plan_mode_response tool.
886+
- PLAN MODE: In this special mode, you have access to the plan_mode_respond tool.
887887
- In PLAN MODE, the goal is to gather information and get context to create a detailed plan for accomplishing the task, which the user will review and approve before they switch you to ACT MODE to implement the solution.
888-
- In PLAN MODE, when you need to converse with the user or present a plan, you should use the plan_mode_response tool to deliver your response directly, rather than using <thinking> tags to analyze when to respond. Do not talk about using plan_mode_response - just use it directly to share your thoughts and provide helpful answers.
888+
- In PLAN MODE, when you need to converse with the user or present a plan, you should use the plan_mode_respond tool to deliver your response directly, rather than using <thinking> tags to analyze when to respond. Do not talk about using plan_mode_respond - just use it directly to share your thoughts and provide helpful answers.
889889
890890
## What is PLAN MODE?
891891

src/shared/ExtensionMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export interface ClineMessage {
130130

131131
export type ClineAsk =
132132
| "followup"
133-
| "plan_mode_response"
133+
| "plan_mode_respond"
134134
| "command"
135135
| "command_output"
136136
| "completion_result"

webview-ui/src/components/chat/ChatRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi
12101210
</div>
12111211
</>
12121212
)
1213-
case "plan_mode_response": {
1213+
case "plan_mode_respond": {
12141214
let response: string | undefined
12151215
let options: string[] | undefined
12161216
let selected: string | undefined
@@ -1229,7 +1229,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi
12291229
<OptionsButtons
12301230
options={options}
12311231
selected={selected}
1232-
isActive={isLast && lastModifiedMessage?.ask === "plan_mode_response"}
1232+
isActive={isLast && lastModifiedMessage?.ask === "plan_mode_respond"}
12331233
/>
12341234
</div>
12351235
)

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
119119
// setPrimaryButtonText(undefined)
120120
// setSecondaryButtonText(undefined)
121121
break
122-
case "plan_mode_response":
122+
case "plan_mode_respond":
123123
setTextAreaDisabled(isPartial)
124-
setClineAsk("plan_mode_response")
124+
setClineAsk("plan_mode_respond")
125125
setEnableButtons(false)
126126
// setPrimaryButtonText(undefined)
127127
// setSecondaryButtonText(undefined)
@@ -285,7 +285,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
285285
} else if (clineAsk) {
286286
switch (clineAsk) {
287287
case "followup":
288-
case "plan_mode_response":
288+
case "plan_mode_respond":
289289
case "tool":
290290
case "browser_action_launch":
291291
case "command": // user can provide feedback to a tool or command use

0 commit comments

Comments
 (0)