refactor(browser-tools): require explicit tab targets

Remove hidden active-browser targeting so automation requests carry workspace in the envelope and browserId in tab command args.
This commit is contained in:
Mohamed Boudra
2026-07-02 19:53:40 +02:00
parent d9615c1e98
commit 71ce96b60f
22 changed files with 1108 additions and 4227 deletions
@@ -73,7 +73,7 @@ function browserNewTabRequest(): BrowserAutomationExecuteRequest {
workspaceId: "wks_workspace_a",
command: {
command: "new_tab",
args: { workspaceId: "wks_workspace_a", url: "https://example.com" },
args: { url: "https://example.com" },
},
};
}
@@ -128,7 +128,6 @@ describe("mountBrowserAutomationHandler", () => {
test("creates a focused workspace browser tab for browser_new_tab", async () => {
const client = new FakeDaemonClient();
const setWorkspaceActiveBrowser = vi.fn(async () => undefined);
const setAgentActiveBrowser = vi.fn(async () => undefined);
const registerWorkspaceBrowser = vi.fn(async () => undefined);
const ensureResidentBrowserWebview = vi.fn();
const executeAutomationCommand = vi.fn(async () => currentListTabsPayload());
@@ -150,7 +149,6 @@ describe("mountBrowserAutomationHandler", () => {
executeAutomationCommand,
registerWorkspaceBrowser,
setWorkspaceActiveBrowser,
setAgentActiveBrowser,
},
}) satisfies DesktopHostBridge,
ensureResidentBrowserWebview,
@@ -180,10 +178,6 @@ describe("mountBrowserAutomationHandler", () => {
browserId,
workspaceId: "wks_workspace_a",
});
expect(setAgentActiveBrowser).toHaveBeenCalledWith({
agentId: "agent-1",
browserId,
});
expect(setWorkspaceActiveBrowser).toHaveBeenCalledWith({
browserId,
workspaceId: "wks_workspace_a",