mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-08 03:07:53 +00:00
Make the question follow-up suggestions optional (#1857)
Make the question follow-up optional
This commit is contained in:
parent
4580ad3c7c
commit
f9d2b4db97
2 changed files with 27 additions and 28 deletions
5
.changeset/chilled-jobs-taste.md
Normal file
5
.changeset/chilled-jobs-taste.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"roo-cline": patch
|
||||
---
|
||||
|
||||
Make the question follow-up optional
|
||||
|
|
@ -2883,46 +2883,40 @@ export class Cline extends EventEmitter<ClineEvents> {
|
|||
break
|
||||
}
|
||||
|
||||
if (!follow_up) {
|
||||
this.consecutiveMistakeCount++
|
||||
pushToolResult(
|
||||
await this.sayAndCreateMissingParamError("ask_followup_question", "follow_up"),
|
||||
)
|
||||
break
|
||||
}
|
||||
|
||||
let normalizedSuggest = null
|
||||
|
||||
type Suggest = {
|
||||
answer: string
|
||||
}
|
||||
|
||||
let parsedSuggest: {
|
||||
suggest: Suggest[] | Suggest
|
||||
let follow_up_json = {
|
||||
question,
|
||||
suggest: [] as Suggest[],
|
||||
}
|
||||
|
||||
try {
|
||||
parsedSuggest = parseXml(follow_up, ["suggest"]) as {
|
||||
if (follow_up) {
|
||||
let parsedSuggest: {
|
||||
suggest: Suggest[] | Suggest
|
||||
}
|
||||
} catch (error) {
|
||||
this.consecutiveMistakeCount++
|
||||
await this.say("error", `Failed to parse operations: ${error.message}`)
|
||||
pushToolResult(formatResponse.toolError("Invalid operations xml format"))
|
||||
break
|
||||
|
||||
try {
|
||||
parsedSuggest = parseXml(follow_up, ["suggest"]) as {
|
||||
suggest: Suggest[] | Suggest
|
||||
}
|
||||
} catch (error) {
|
||||
this.consecutiveMistakeCount++
|
||||
await this.say("error", `Failed to parse operations: ${error.message}`)
|
||||
pushToolResult(formatResponse.toolError("Invalid operations xml format"))
|
||||
break
|
||||
}
|
||||
|
||||
const normalizedSuggest = Array.isArray(parsedSuggest?.suggest)
|
||||
? parsedSuggest.suggest
|
||||
: [parsedSuggest?.suggest].filter((sug): sug is Suggest => sug !== undefined)
|
||||
|
||||
follow_up_json.suggest = normalizedSuggest
|
||||
}
|
||||
|
||||
this.consecutiveMistakeCount = 0
|
||||
|
||||
normalizedSuggest = Array.isArray(parsedSuggest?.suggest)
|
||||
? parsedSuggest.suggest
|
||||
: [parsedSuggest?.suggest].filter((sug): sug is Suggest => sug !== undefined)
|
||||
|
||||
const follow_up_json = {
|
||||
question,
|
||||
suggest: normalizedSuggest,
|
||||
}
|
||||
|
||||
const { text, images } = await this.ask(
|
||||
"followup",
|
||||
JSON.stringify(follow_up_json),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue