mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Misc updates
This commit is contained in:
parent
8d73ad713b
commit
7028670ada
2 changed files with 13 additions and 16 deletions
|
|
@ -1504,7 +1504,7 @@ export class Cline {
|
|||
}
|
||||
|
||||
this.consecutiveMistakeCount = 0
|
||||
const didApprove = await askApproval("browser_action_launch", url)
|
||||
const didApprove = this.alwaysAllowBrowser || await askApproval("browser_action_launch", url)
|
||||
if (!didApprove) {
|
||||
break
|
||||
}
|
||||
|
|
@ -1567,7 +1567,6 @@ export class Cline {
|
|||
break
|
||||
}
|
||||
}
|
||||
|
||||
switch (action) {
|
||||
case "launch":
|
||||
case "click":
|
||||
|
|
@ -1595,7 +1594,7 @@ export class Cline {
|
|||
break
|
||||
}
|
||||
} catch (error) {
|
||||
await this.browserSession.closeBrowser()
|
||||
await this.browserSession.closeBrowser() // if any error occurs, the browser session is terminated
|
||||
await handleError("executing browser action", error)
|
||||
break
|
||||
}
|
||||
|
|
@ -1763,11 +1762,7 @@ export class Cline {
|
|||
|
||||
const { response, text, images } = await this.ask("completion_result", "", false)
|
||||
if (response === "yesButtonClicked") {
|
||||
// Only close browser if not in interactive mode
|
||||
if (!this.browserSession.isInInteractiveMode) {
|
||||
await this.browserSession.closeBrowser()
|
||||
}
|
||||
pushToolResult("")
|
||||
pushToolResult("") // signals to recursive loop to stop (for now this never happens since yesButtonClicked will trigger a new task)
|
||||
break
|
||||
}
|
||||
await this.say("user_feedback", text ?? "", images)
|
||||
|
|
@ -1794,7 +1789,7 @@ export class Cline {
|
|||
break
|
||||
}
|
||||
} catch (error) {
|
||||
await handleError("completing task", error)
|
||||
await handleError("inspecting site", error)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ export class BrowserSession {
|
|||
"--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
|
||||
],
|
||||
defaultViewport: {
|
||||
width: 900,
|
||||
height: 600
|
||||
width: 1440,
|
||||
height: 900
|
||||
},
|
||||
headless: false, // Always use non-headless mode
|
||||
})
|
||||
|
|
@ -65,6 +65,12 @@ export class BrowserSession {
|
|||
}
|
||||
|
||||
this.page = await this.browser?.newPage()
|
||||
await this.page?.setViewport({
|
||||
width: 1440,
|
||||
height: 900,
|
||||
deviceScaleFactor: 1,
|
||||
isMobile: false
|
||||
});
|
||||
|
||||
return {
|
||||
screenshot: "",
|
||||
|
|
@ -182,7 +188,7 @@ export class BrowserSession {
|
|||
}
|
||||
|
||||
private async waitTillHTMLStable(page: Page, timeout = 5_000) {
|
||||
const checkDurationMsecs = 500
|
||||
const checkDurationMsecs = 500 // 1000
|
||||
const maxChecks = timeout / checkDurationMsecs
|
||||
let lastHTMLSize = 0
|
||||
let checkCounts = 1
|
||||
|
|
@ -273,8 +279,4 @@ export class BrowserSession {
|
|||
await delay(300)
|
||||
})
|
||||
}
|
||||
|
||||
get isInInteractiveMode(): boolean {
|
||||
return this.isInteractive
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue