Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
TypeScript adeagent-ideai-agentsautomationbotclaude-codecodexghosttygrok-bothermes-agentmobile-appmuseopenclawopencodeorchestrationpiruntimeterminalworktreesyc-backed
fix(browser): keep snapshot refs on server browsers that use an external Chromium (#36276)
Kelvin Amoababafbf406c97d
diff --git a/src/main/orcad/external-chromium-browser-session.test.ts b/src/main/orcad/external-chromium-browser-session.test.tsindex 300874fb7de..e8ccf981c8c 100644--- a/src/main/orcad/external-chromium-browser-session.test.ts+++ b/src/main/orcad/external-chromium-browser-session.test.ts@@ -167,6 +167,32 @@ describe('orcad external-chromium agent-browser environment', () => {expect(issued).not.toContain('open')})+ it('selects a tab only when it is not already active, keeping the snapshot refs', async () => {+ runProcessMock.mockImplementation(() => {+ const tabs = [+ { active: true, tabId: 't1', title: 'a', url: 'about:blank' },+ { active: false, tabId: 't2', title: 'b', url: 'about:blank' }+ ]+ return Promise.resolve({+ code: 0,+ signal: null,+ stdout: JSON.stringify({ success: true, data: { tabs } }),+ stderr: '',+ timedOut: false+ })+ })+ const session = new ExternalChromiumBrowserSession(+ '/opt/orca/agent-browser',+ { executablePath: BASE.executablePath, provider: 'chromium' },+ '/state'+ )++ await session.selectPage('t1')+ expect(commands()).toEqual([['tab']])+ await session.selectPage('t2')+ expect(commands()).toEqual([['tab'], ['tab'], ['tab', 't2']])+ })+it('reclaims a session that answers nothing, then opens', async () => {let listed = 0runProcessMock.mockImplementation((spec: Spec) => {diff --git a/src/main/orcad/external-chromium-browser-session.ts b/src/main/orcad/external-chromium-browser-session.tsindex 0df599dc033..02522c03966 100644--- a/src/main/orcad/external-chromium-browser-session.ts+++ b/src/main/orcad/external-chromium-browser-session.ts@@ -138,6 +138,10 @@ export class ExternalChromiumBrowserSession {}async selectPage(agentPageId: string): Promise<void> {+ // Selecting any tab, even the active one, discards the refs of the last snapshot.+ if ((await this.readTabs()).some((tab) => tab.tabId === agentPageId && tab.active)) {+ return+ }await this.run(['tab', agentPageId])}