Refresh BYOB browser inventory
Some checks are pending
Build And Publish Docker Images / plan (push) Waiting to run
Build And Publish Docker Images / build (push) Blocked by required conditions

Poll connected A0 CLI host-browser metadata while Browser Settings is open so newly authorized endpoints appear without saving or reopening.

Extend Browser Settings labels and remote-debugging guidance for Brave, Opera, Vivaldi, and Chromium-family host browsers with regression coverage.
This commit is contained in:
Alessandro 2026-07-04 19:22:57 +02:00
parent 7298a88fda
commit 7168f0984e
8 changed files with 34 additions and 4 deletions

View file

@ -25,6 +25,7 @@
- Keep WebUI Browser tabs scoped to the active chat context by default; aggregate tabs from other AgentContext runtimes only when the Browser settings tab scope is `shared`.
- Keep narrow WebUI Browser controls usable by grouping navigation with Annotate/settings above a full-width address bar.
- For Bring Your Own Browser with an existing host profile, `host_browser_selection` may target automatic CLI selection, a browser family/id, or an explicit CDP endpoint and must be forwarded to the connector runtime as `browser_selection`.
- Browser Settings must refresh connected A0 CLI host-browser inventory while the settings view is open so newly authorized endpoints appear without saving or reopening.
- Browser URL-intent handling must only claim web URL schemes and leave custom Agent Zero schemes to their owning surfaces.
- Prefer DOM/CDP browser actions with refs, selectors, frame-chain refs, and screenshots over viewport coordinate input. Coordinates remain a visual fallback.
- Do not hardcode user-specific browser paths or secrets.

View file

@ -83,7 +83,8 @@ _REQUIRED_API_NAMES_RE = re.compile(
re.S,
)
_HOST_BROWSER_REMOTE_DEBUGGING_HELP = (
'For an already-open Chrome-family browser, open `chrome://inspect/#remote-debugging`, '
"For an already-open Chromium-family browser, open its inspect page, such as "
"`chrome://inspect/#remote-debugging` or `opera://inspect/#remote-debugging`, "
'enable "Allow remote debugging for this browser instance", run `/browser host on`, '
"and retry."
)
@ -519,7 +520,10 @@ class ConnectorBrowserRuntime:
if not message:
message = "Host browser operation failed"
normalized = message.lower()
if "chrome://inspect/#remote-debugging" in normalized:
if (
"chrome://inspect/#remote-debugging" in normalized
or "opera://inspect/#remote-debugging" in normalized
):
return _append_docker_browser_recovery(message)
if any(token in normalized for token in _REMOTE_DEBUGGING_ERROR_TOKENS):
return _append_docker_browser_recovery(

View file

@ -3,7 +3,7 @@ Rendered browser automation for pages that need interaction, JavaScript, forms,
Prefer `search_engine` or `document_query` for plain text research. The tool must not open a Browser surface automatically. Use the tool headlessly unless the user opens the Browser surface or asks for the optional visible WebUI viewer.
When the user asks for "my browser", "host browser", "local browser", local Chrome, or opening a URL in their host browser, use this `browser` tool. Do not substitute `computer_use_remote`, `code_execution_remote`, `xdg-open`, `sensible-browser`, or Python `webbrowser.open`. If setup fails and mentions remote debugging, tell the user to open `chrome://inspect/#remote-debugging`, enable "Allow remote debugging for this browser instance", run `/browser host on`, and retry.
When the user asks for "my browser", "host browser", "local browser", a local Chromium browser, or opening a URL in their host browser, use this `browser` tool. Do not substitute `computer_use_remote`, `code_execution_remote`, `xdg-open`, `sensible-browser`, or Python `webbrowser.open`. If setup fails and mentions remote debugging, tell the user to open the browser inspect page, such as `chrome://inspect/#remote-debugging` or `opera://inspect/#remote-debugging`, enable "Allow remote debugging for this browser instance", run `/browser host on`, and retry.
For rendered browsing workflows, multi-step interaction, screenshots, downloads, uploads, forms, or host/container mode decisions, first load `browser-automation` with `skills_tool:load`, then call this tool using the loaded instructions. For fragile forms, `browser-automation` links to `browser-form-workflows`; load it when selects, checkboxes, radios, uploads, contenteditable fields, validation, or submission state are central.

View file

@ -10,6 +10,7 @@ const HOST_PROFILE_MODES = new Set(["existing", "agent"]);
const DEFAULT_MAX_OPEN_TABS = 32;
const MIN_MAX_OPEN_TABS = 1;
const HARD_MAX_OPEN_TABS = 50;
const HOST_BROWSER_STATUS_REFRESH_MS = 3000;
function normalizePathList(value) {
const source = Array.isArray(value)
@ -91,6 +92,9 @@ function hostBrowserFamilyLabel(value) {
chromium: "Chromium",
edge: "Edge",
"edge-dev": "Edge Dev",
brave: "Brave",
opera: "Opera",
vivaldi: "Vivaldi",
};
const label = labels[base] || "Host browser";
if (remoteDebugging) return `${label} (allowed)`;
@ -116,13 +120,16 @@ export const store = createStore("browserConfig", {
extensionDeleteLoadingPath: "",
hostBrowserStatus: null,
hostBrowserStatusLoading: false,
hostBrowserStatusRefreshTimer: null,
async init(config) {
this.bindConfig(config);
await Promise.all([this.loadExtensionsList(), this.loadHostBrowserStatus()]);
this.startHostBrowserStatusRefresh();
},
cleanup() {
this.stopHostBrowserStatusRefresh();
this.config = null;
this.extensionsList = [];
this.extensionsError = "";
@ -132,6 +139,20 @@ export const store = createStore("browserConfig", {
this.hostBrowserStatusLoading = false;
},
startHostBrowserStatusRefresh() {
this.stopHostBrowserStatusRefresh();
this.hostBrowserStatusRefreshTimer = window.setInterval(
() => this.loadHostBrowserStatus(),
HOST_BROWSER_STATUS_REFRESH_MS,
);
},
stopHostBrowserStatusRefresh() {
if (!this.hostBrowserStatusRefreshTimer) return;
window.clearInterval(this.hostBrowserStatusRefreshTimer);
this.hostBrowserStatusRefreshTimer = null;
},
bindConfig(config) {
const safeConfig = ensureConfig(config);
if (!safeConfig) return;

View file

@ -37,7 +37,7 @@
class="browser-config-field-help"
x-show="$store.browserConfig.config.runtime_backend === 'host_required'"
>
Uses Chrome, Edge, or Chromium on the A0 CLI host. Keep A0 CLI connected; the browser opens when the agent first needs it. For an already-open browser, use chrome://inspect/#remote-debugging and enable "Allow remote debugging for this browser instance".
Uses Chrome, Edge, Brave, Opera, Vivaldi, or Chromium on the A0 CLI host. Keep A0 CLI connected; the browser opens when the agent first needs it. For an already-open browser, use its inspect page, such as chrome://inspect/#remote-debugging or opera://inspect/#remote-debugging, and enable "Allow remote debugging for this browser instance".
</span>
</label>

View file

@ -624,6 +624,7 @@ def test_host_browser_requests_route_to_browser_tool_not_desktop_or_shell_fallba
assert "code_execution_remote" in browser_prompt
assert "Python `webbrowser.open`" in browser_prompt
assert "chrome://inspect/#remote-debugging" in browser_prompt
assert "opera://inspect/#remote-debugging" in browser_prompt
assert "Do not start `computer_use_remote` for web-page navigation" in computer_skill
assert (
"Do not fall back to `code_execution_remote`, `xdg-open`, `sensible-browser`, "

View file

@ -995,10 +995,12 @@ def test_browser_tool_does_not_auto_open_canvas_policy_is_documented():
assert "`browser-automation` links to `browser-form-workflows`" in prompt
assert "does not automatically load screenshots" in prompt
assert "chrome://inspect/#remote-debugging" in prompt
assert "opera://inspect/#remote-debugging" in prompt
assert tokens.approximate_tokens(prompt) <= 650
assert "already open" in config
assert "already-open Browser surface" in config_html
assert "chrome://inspect/#remote-debugging" in config_html
assert "opera://inspect/#remote-debugging" in config_html
def test_browser_skills_are_plugin_owned_and_progressively_linked():

View file

@ -308,6 +308,7 @@ def test_connector_runtime_adds_remote_debugging_help_to_cdp_errors():
)
assert "chrome://inspect/#remote-debugging" in message
assert "opera://inspect/#remote-debugging" in message
assert "Allow remote debugging for this browser instance" in message
assert "/browser host on" in message
assert "Internal Docker browser" in message