diff --git a/web-app/src/lib/__tests__/completion.test.ts b/web-app/src/lib/__tests__/completion.test.ts index e8bd84b86..f0524347f 100644 --- a/web-app/src/lib/__tests__/completion.test.ts +++ b/web-app/src/lib/__tests__/completion.test.ts @@ -673,7 +673,6 @@ describe('completion.ts', () => { [], // tools undefined, // updateStreamingUI undefined, // maxToolSteps - undefined, // currentStepCount true // isProactiveMode - Correctly set to true ) @@ -733,7 +732,6 @@ describe('completion.ts', () => { [], // tools undefined, // updateStreamingUI undefined, // maxToolSteps - undefined, // currentStepCount false // isProactiveMode - Correctly set to false ) @@ -788,7 +786,6 @@ describe('completion.ts', () => { [], // tools undefined, // updateStreamingUI undefined, // maxToolSteps - undefined, // currentStepCount true // isProactiveMode - Still set to true, but the non-browser tool should skip the proactive step ) diff --git a/web-app/src/lib/completion.ts b/web-app/src/lib/completion.ts index 9e6be6776..8a8eb9cd9 100644 --- a/web-app/src/lib/completion.ts +++ b/web-app/src/lib/completion.ts @@ -534,8 +534,8 @@ const filterOldProactiveScreenshots = (builder: CompletionMessagesBuilder) => { * @param tools * @param updateStreamingUI * @param maxToolSteps - * @param currentStepCount - Internal counter for recursive calls (do not set manually) * @param isProactiveMode + * @param currentStepCount - Internal counter for recursive calls (do not set manually) */ export const postMessageProcessing = async ( calls: ChatCompletionMessageToolCall[], @@ -554,8 +554,8 @@ export const postMessageProcessing = async ( tools: MCPTool[] = [], updateStreamingUI?: (content: ThreadMessage) => void, maxToolSteps: number = 20, - currentStepCount: number = 0, - isProactiveMode: boolean = false + isProactiveMode: boolean = false, + currentStepCount: number = 0 ): Promise => { // Initialize/get the current total thinking time from metadata // This value is passed from sendMessage (initial completion time) or previous recursive call @@ -877,8 +877,8 @@ export const postMessageProcessing = async ( tools, updateStreamingUI, maxToolSteps, + isProactiveMode, nextStepCount, // Pass the incremented step count - isProactiveMode ) } }