mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-09 22:31:08 +00:00
approve with feedback for write_to_file/replace_in_file
This commit is contained in:
parent
96540ddf1e
commit
f096d73813
1 changed files with 15 additions and 17 deletions
|
|
@ -1547,28 +1547,13 @@ export class Cline {
|
|||
// Rejection WITH feedback
|
||||
await this.say("user_feedback", text, images)
|
||||
pushToolResult(formatResponse.toolResult(formatResponse.toolDeniedWithFeedback(text), images))
|
||||
// this.userMessageContent.push({
|
||||
// type: "text",
|
||||
// text: `${toolDescription()}`,
|
||||
// })
|
||||
// this.toolResults.push({
|
||||
// type: "tool_result",
|
||||
// tool_use_id: toolUseId,
|
||||
// content: this.formatToolResponseWithImages(
|
||||
// await this.formatToolDeniedFeedback(text),
|
||||
// images
|
||||
// ),
|
||||
// })
|
||||
|
||||
this.didRejectTool = true
|
||||
return false
|
||||
}
|
||||
// Rejection WITHOUT explicit feedback
|
||||
pushToolResult(formatResponse.toolDenied())
|
||||
// this.toolResults.push({
|
||||
// type: "tool_result",
|
||||
// tool_use_id: toolUseId,
|
||||
// content: await this.formatToolDenied(),
|
||||
// })
|
||||
|
||||
this.didRejectTool = true // Prevent further tool uses in this message
|
||||
return false
|
||||
}
|
||||
|
|
@ -1819,11 +1804,14 @@ export class Cline {
|
|||
let didApprove = true
|
||||
const { response, text, images } = await this.ask("tool", completeMessage, false)
|
||||
if (response !== "yesButtonClicked") {
|
||||
// User did NOT approve (rejected)
|
||||
|
||||
// TODO: add similar context for other tool denial responses, to emphasize ie that a command was not run
|
||||
const fileDeniedNote = fileExists
|
||||
? "The file was not updated, and maintains its original contents."
|
||||
: "The file was not created."
|
||||
if (response === "messageResponse") {
|
||||
// Rejection WITH feedback
|
||||
await this.say("user_feedback", text, images)
|
||||
pushToolResult(
|
||||
formatResponse.toolResult(
|
||||
|
|
@ -1838,6 +1826,16 @@ export class Cline {
|
|||
this.didRejectTool = true
|
||||
didApprove = false
|
||||
}
|
||||
} else {
|
||||
// User approved
|
||||
|
||||
// Handle yesButtonClicked with text (Acceptance WITH feedback)
|
||||
if (text) {
|
||||
await this.say("user_feedback", text, images)
|
||||
pushToolResult(
|
||||
formatResponse.toolResult(formatResponse.toolApprovedWithFeedback(text), images),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (!didApprove) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue