Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: preserve audit browser bridge guidance
[._.]/ Adam Eivy5471bc6f656e
diff --git a/server/services/agentPromptBuilder.js b/server/services/agentPromptBuilder.jsindex c9e507cafa..d5cb1d4ddc 100644--- a/server/services/agentPromptBuilder.js+++ b/server/services/agentPromptBuilder.js@@ -96,8 +96,9 @@ const UI_AUDIT_TASK_TYPE_SET = new Set(UI_AUDIT_TASK_TYPES);export const UI_AUDIT_RUNTIME_RULE = `## UI Audit Runtime (PortOS local system)This is an unattended run, but it is not browserless when the target has a web UI. PortOS provides a managed Chromium browser for CoS agents over Chrome DevTools Protocol (CDP). The agent-facing browser bridge is separate from that managed browser: an empty array returned by agent.browsers.list() ([]), getForUrl() returning "No browser is available", or an otherwise unusable agent-browser binding is a provider-bridge failure, not evidence that PortOS's managed Chromium or CDP endpoint is unavailable. Do not skip live UI verification because the provider bridge is empty, unusable, or no human is present.-- A browser bridge is usable for this audit only if it can attach to the dedicated PortOS tab described below without creating a page or bringing the browser window to the front. Otherwise use the configured CDP endpoint from the local shell, including when the provider bridge is empty or unusable.+- Use Playwright/browser tools only with a working browser bridge that can attach to the dedicated PortOS tab described below without creating a page or bringing the browser window to the front. Otherwise use the configured CDP endpoint from the local shell, including when the provider bridge is empty or unusable.- When the agent browser bridge is empty or unusable, query the configured PortOS browser health endpoint (usually http://127.0.0.1:5557/health, or its configured healthPort) and the CDP /json/version or /json/list endpoints before stopping. The richer /api/browser/health check may require the instance password; a 401 from that API route is an authentication response, not evidence that PortOS's managed browser is unavailable. A healthy PortOS health/CDP response overrides the provider's "No browser is available" response.+- Check browser status/configuration when needed; the CDP endpoint is local and configurable, with shipped default 127.0.0.1:5556.- All UI audits share one persistent, dedicated PortOS browser tab. At the start, inspect normal type: "page" targets from /json/list and read window.name over each page's webSocketDebuggerUrl. Reuse only the target marked window.name === "portos-ui-quality-audit"; never guess ownership from a URL, title, or which tab is active, and never navigate, activate, or close any other page. If no marked target exists, create exactly one background target by sending Target.createTarget with {url: "about:blank", background: true} to the browser-level webSocketDebuggerUrl from /json/version, then find its page target by the returned targetId. Do not use PUT /json/new, browser.newPage(), context.newPage(), a new browser context/window, or an "open in new tab" action for this audit. If background target creation fails, do not fall back to a foreground tab; report the specific CDP failure and stop the live UI portion.- Navigate that one dedicated target in place with Page.navigate and inspect it with Runtime.evaluate on its page socket. Reuse the same target for every route and control; never create a page per view. Do not send Page or Runtime commands to the browser-level socket from /json/version, and do not call Page.bringToFront or use UI actions that select/focus a tab. After navigation, set window.name = "portos-ui-quality-audit" again if a cross-site navigation cleared it. At the end, set window.name to that marker and document.title to "PortOS UI Audit", then leave the tab open for the next audit. Use Page, Runtime, Log, and Network domains on the dedicated page socket for live evidence.- Treat the target as a running local system: discover its actual UI/API URL and ports from the app configuration, PortOS app/process state, and health endpoints, then inspect scoped server logs when diagnosing console or request failures. Do not guess a URL or treat source-only speculation as a UI finding.