feat: disable ScriptExecutionTool for MultiPageAgent

This commit is contained in:
Simon
2026-06-11 20:16:09 +08:00
parent 9ed0a09194
commit 768b07e28c
2 changed files with 3 additions and 5 deletions

View File

@@ -50,6 +50,8 @@ export class MultiPageAgent extends PageAgentCore {
super({
...config,
// Disabled: AbortSignal cannot cross contexts
experimentalScriptExecutionTool: false,
pageController: pageController as any,
customTools: customTools,
customSystemPrompt: systemPrompt,

View File

@@ -133,11 +133,7 @@ export class RemotePageController {
return this.remoteCallDomAction('scroll_horizontally', args)
}
async executeJavascript(script: string, _signal?: AbortSignal): Promise<DomActionReturn> {
// `AbortSignal` is not structured-cloneable across the messaging boundary.
// The remote script runs without it
return this.remoteCallDomAction('execute_javascript', [script])
}
// `execute_javascript` is intentionally not implemented: AbortSignal cannot cross context
/** @note Managed by content script via storage polling. */
async showMask(): Promise<void> {}