Add browser workflow reliability primitives and guardrails

This commit is contained in:
William Valentin
2026-02-26 14:06:46 -08:00
parent 3cc9e16ef5
commit 7c904ef0fd
7 changed files with 1185 additions and 272 deletions
+23 -2
View File
@@ -67,7 +67,20 @@ export function initTools(deps: ToolsDeps): ToolsResult {
}
// Initialize browser manager and register browser tools (if enabled)
const browserToolNames = ['browser.navigate', 'browser.screenshot', 'browser.click', 'browser.type', 'browser.content', 'browser.eval', 'browser.evaluate'];
const browserToolNames = [
'browser.navigate',
'browser.screenshot',
'browser.click',
'browser.type',
'browser.content',
'browser.wait_for',
'browser.assert',
'browser.extract',
'browser.checkpoint.save',
'browser.checkpoint.resume',
'browser.eval',
'browser.evaluate',
];
let browserManager: BrowserManager | undefined;
if (config.browser?.enabled) {
const manager = new BrowserManager({
@@ -79,7 +92,15 @@ export function initTools(deps: ToolsDeps): ToolsResult {
});
browserManager = manager;
for (const tool of createBrowserTools(manager)) {
for (const tool of createBrowserTools(manager, {
allowedDomains: config.browser.allowed_domains,
highRiskDomains: config.browser.high_risk_domains,
requireHighRiskConfirmation: config.browser.require_confirmation_for_high_risk,
maxWorkflowSteps: config.browser.max_workflow_steps,
defaultRetryAttempts: config.browser.default_retry_attempts,
maxRetryAttempts: config.browser.max_retry_attempts,
retryDelayMs: config.browser.retry_delay_ms,
})) {
toolRegistry.register(tool);
}
console.log(`Browser tools enabled (headless=${config.browser.headless})`);