mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: address PR feedback and fix unit test failures
This commit is contained in:
parent
c9b6ffd022
commit
782caa6748
5 changed files with 11 additions and 7 deletions
|
|
@ -816,7 +816,7 @@ export class NativeToolCallParser {
|
|||
break
|
||||
|
||||
case "ask_followup_question":
|
||||
if (args.questions !== undefined && args.follow_up !== undefined) {
|
||||
if (args.questions !== undefined || args.follow_up !== undefined) {
|
||||
nativeArgs = {
|
||||
questions: Array.isArray(args.questions) ? args.questions : undefined,
|
||||
follow_up: args.follow_up,
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ describe("presentAssistantMessage - Image Handling in Native Tool Calling", () =
|
|||
closeBrowser: vi.fn().mockResolvedValue(undefined),
|
||||
},
|
||||
recordToolUsage: vi.fn(),
|
||||
recordToolError: vi.fn(),
|
||||
sayAndCreateMissingParamError: vi.fn().mockResolvedValue("mock error message"),
|
||||
toolRepetitionDetector: {
|
||||
check: vi.fn().mockReturnValue({ allowExecution: true }),
|
||||
},
|
||||
|
|
@ -85,8 +87,8 @@ describe("presentAssistantMessage - Image Handling in Native Tool Calling", () =
|
|||
type: "tool_use",
|
||||
id: toolCallId, // ID indicates native tool calling
|
||||
name: "ask_followup_question",
|
||||
params: { question: "What do you see?" },
|
||||
nativeArgs: { question: "What do you see?", follow_up: [] },
|
||||
params: { questions: ["What do you see?"] },
|
||||
nativeArgs: { questions: ["What do you see?"], follow_up: [] },
|
||||
},
|
||||
]
|
||||
|
||||
|
|
@ -138,8 +140,8 @@ describe("presentAssistantMessage - Image Handling in Native Tool Calling", () =
|
|||
type: "tool_use",
|
||||
id: toolCallId,
|
||||
name: "ask_followup_question",
|
||||
params: { question: "What is your name?" },
|
||||
nativeArgs: { question: "What is your name?", follow_up: [] },
|
||||
params: { questions: ["What is your name?"] },
|
||||
nativeArgs: { questions: ["What is your name?"], follow_up: [] },
|
||||
},
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export class AskFollowupQuestionTool extends BaseTool<"ask_followup_question"> {
|
|||
// Transform follow_up suggestions to the format expected by task.ask
|
||||
const followup_json = {
|
||||
questions,
|
||||
suggest: follow_up.map((s) => ({ answer: s.text, mode: s.mode })),
|
||||
suggest: follow_up?.map((s) => ({ answer: s.text, mode: s.mode })) || [],
|
||||
}
|
||||
|
||||
task.consecutiveMistakeCount = 0
|
||||
|
|
|
|||
|
|
@ -2107,6 +2107,7 @@ export class ClineProvider
|
|||
featureRoomoteControlEnabled,
|
||||
isBrowserSessionActive,
|
||||
lockApiConfigAcrossModes,
|
||||
showQuestionsOneByOne,
|
||||
} = await this.getState()
|
||||
|
||||
let cloudOrganizations: CloudOrganizationMembership[] = []
|
||||
|
|
@ -2468,6 +2469,7 @@ export class ClineProvider
|
|||
reasoningBlockCollapsed: stateValues.reasoningBlockCollapsed ?? true,
|
||||
enterBehavior: stateValues.enterBehavior ?? "send",
|
||||
taskHeaderHighlightEnabled: stateValues.taskHeaderHighlightEnabled ?? false,
|
||||
showQuestionsOneByOne: stateValues.showQuestionsOneByOne ?? false,
|
||||
cloudUserInfo,
|
||||
cloudIsAuthenticated,
|
||||
sharingEnabled,
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ export type NativeToolArgs = {
|
|||
new_task: { mode: string; message: string; todos?: string }
|
||||
ask_followup_question: {
|
||||
questions: FollowUpQuestion[]
|
||||
follow_up: Array<{ text: string; mode?: string }>
|
||||
follow_up?: Array<{ text: string; mode?: string }>
|
||||
}
|
||||
browser_action: BrowserActionParams
|
||||
codebase_search: { query: string; path?: string }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue