Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: upgrade desktop agent-browser to v0.20.1 and default native mode (#12985)

Inneibffdbf8ad4d8
diff --git a/apps/desktop/scripts/download-agent-browser.mjs b/apps/desktop/scripts/download-agent-browser.mjs
index 03432a40e45..9ca7780c135 100644
--- a/apps/desktop/scripts/download-agent-browser.mjs
+++ b/apps/desktop/scripts/download-agent-browser.mjs
@@ -5,7 +5,7 @@ import path from 'node:path';
import { pipeline } from 'node:stream/promises';
import { fileURLToPath } from 'node:url';
-const VERSION = '0.17.0';
+const VERSION = '0.20.1';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const binDir = path.join(__dirname, '..', 'resources', 'bin');
diff --git a/apps/desktop/src/main/core/App.ts b/apps/desktop/src/main/core/App.ts
index 21e040ff1eb..e87a2f9b550 100644
--- a/apps/desktop/src/main/core/App.ts
+++ b/apps/desktop/src/main/core/App.ts
@@ -93,9 +93,6 @@ export class App {
const pathSep = process.platform === 'win32' ? ';' : ':';
process.env.PATH = `${process.env.PATH}${pathSep}${binDir}`;
- // Use native mode (pure Rust/CDP) so agent-browser works without Node.js
- process.env.AGENT_BROWSER_NATIVE = '1';
-
logger.debug('Initializing App');
// Initialize store manager
this.storeManager = new StoreManager(this);
diff --git a/packages/builtin-skills/src/agent-browser/content.ts b/packages/builtin-skills/src/agent-browser/content.ts
index 11d960c6fb0..2fd6a0c7db5 100644
--- a/packages/builtin-skills/src/agent-browser/content.ts
+++ b/packages/builtin-skills/src/agent-browser/content.ts
@@ -6,7 +6,7 @@ You can automate websites and Electron desktop apps with the agent-browser CLI.
# Prerequisites
-The \`agent-browser\` CLI is bundled with the desktop app and runs in native mode (no Node.js required). It automatically detects system Chrome/Chromium. If no browser is found, install Google Chrome.
+The \`agent-browser\` CLI is bundled with the desktop app (v0.20.1) and runs in native mode by default. It automatically detects system Chrome/Chromium. If no browser is found, install Google Chrome.
# Core Workflow (Snapshot-Ref Pattern)
diff --git a/packages/builtin-skills/src/agent-browser/index.ts b/packages/builtin-skills/src/agent-browser/index.ts
index 428be1020b9..2283b8210cc 100644
--- a/packages/builtin-skills/src/agent-browser/index.ts
+++ b/packages/builtin-skills/src/agent-browser/index.ts
@@ -8,7 +8,7 @@ export const AgentBrowserSkill: BuiltinSkill = {
avatar: `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48ZyBmaWxsPSJub25lIj48cGF0aCBmaWxsPSIjOGZiZmZhIiBkPSJNMjQgNDYuNWMtNy40MDEgMC0xMi41OTMtLjI3OC0xNS44NjQtLjU0NGMtMy4yODgtLjI2Ny01LjgyNS0yLjgwNC02LjA5Mi02LjA5MkMxLjc3OCAzNi41OTMgMS41IDMxLjQwMSAxLjUgMjRzLjI3OC0xMi41OTMuNTQ0LTE1Ljg2NGMuMjY3LTMuMjg4IDIuODA0LTUuODI1IDYuMDkyLTYuMDkyQzExLjQwNyAxLjc3OCAxNi41OTkgMS41IDI0IDEuNXMxMi41OTMuMjc4IDE1Ljg2NC41NDRjMy4yODguMjY3IDUuODI1IDIuODA0IDYuMDkyIDYuMDkyYy4yNjYgMy4yNzEuNTQ0IDguNDYzLjU0NCAxNS44NjRzLS4yNzggMTIuNTkzLS41NDQgMTUuODY0Yy0uMjY3IDMuMjg4LTIuODA0IDUuODI1LTYuMDkyIDYuMDkyYy0zLjI3MS4yNjYtOC40NjMuNTQ0LTE1Ljg2NC41NDQiLz48cGF0aCBmaWxsPSIjMjg1OWM1IiBkPSJNNDYuMjYyIDEzSDEuNzM3Yy4wOTItMS45NC4yLTMuNTU2LjMwNy00Ljg2NGMuMjY3LTMuMjg4IDIuODAzLTUuODI1IDYuMDkxLTYuMDkyQzExLjQwNyAxLjc3OCAxNi41OTggMS41IDI0IDEuNWM3LjQwMSAwIDEyLjU5Mi4yNzggMTUuODY0LjU0NGMzLjI4OC4yNjcgNS44MjUgMi44MDQgNi4wOTIgNi4wOTJjLjEwNiAxLjMwOC4yMTQgMi45MjMuMzA2IDQuODY0Ii8+PHBhdGggZmlsbD0iIzhmYmZmYSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOCA3LjVBMS41IDEuNSAwIDAgMSA5LjUgNmgyYTEuNSAxLjUgMCAwIDEgMCAzaC0yQTEuNSAxLjUgMCAwIDEgOCA3LjVNMTcuNSA2YTEuNSAxLjUgMCAwIDAgMCAzaDJhMS41IDEuNSAwIDAgMCAwLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48cGF0aCBmaWxsPSIjMjg1OWM1IiBkPSJNMTMuMTIxIDM4LjIzNGMyLjQ4OS0xLjI2NiA1LjExMS0yLjY3OCA3LjI3NS00LjU3MmMuOTY3LS44NDYgMi4xMDQtMi4wNjcgMi4xMDQtMy42NjNzLTEuMTM3LTIuODE3LTIuMTA0LTMuNjYyYy0yLjE2NC0xLjg5NC00Ljc4Ny0zLjMwNy03LjI3NS00LjU3M2EyLjQ5NiAyLjQ5NiAwIDAgMC0zLjM1NyAxLjExN2EyLjUwNSAyLjUwNSAwIDAgMCAxLjExNSAzLjM1MmwuMjQ4LjEyN2MyLjA1NCAxLjA0NSA0LjIxOCAyLjE0NyA1Ljg3NiAzLjY0Yy0xLjY1OCAxLjQ5Mi0zLjgyMSAyLjU5My01Ljg3NSAzLjYzOWwtLjI1LjEyN2EyLjUwNSAyLjUwNSAwIDAgMC0xLjExNCAzLjM1MWEyLjQ5NiAyLjQ5NiAwIDAgMCAzLjM1NyAxLjExN00yNiAzMy41YTIuNSAyLjUgMCAwIDAgMCA1aDEwYTIuNSAyLjUgMCAwIDAgMC01eiIvPjwvZz48L3N2Zz4=`,
content: systemPrompt,
description:
- 'Browser automation CLI for AI agents. Use when tasks involve website or Electron interaction such as navigation, form filling, clicking, screenshot capture, scraping data, login flows, and end-to-end app testing.',
+ 'Browser automation CLI for AI agents (agent-browser v0.20.1). Use when tasks involve website or Electron interaction such as navigation, form filling, clicking, screenshot capture, scraping data, login flows, and end-to-end app testing.',
identifier: AgentBrowserIdentifier,
name: 'Agent Browser',
source: 'builtin',
diff --git a/src/helpers/skillFilters.test.ts b/src/helpers/skillFilters.test.ts
index c4b1e3704e3..c1e62670bc8 100644
--- a/src/helpers/skillFilters.test.ts
+++ b/src/helpers/skillFilters.test.ts
@@ -13,24 +13,20 @@ describe('skillFilters', () => {
});
it('should enable agent-browser on desktop (non-Windows) environment', () => {
- expect(
- shouldEnableBuiltinSkill('lobe-agent-browser', { isDesktop: true, isWindows: false }),
- ).toBe(true);
+ expect(shouldEnableBuiltinSkill('lobe-agent-browser', { isDesktop: true })).toBe(true);
});
- it('should disable agent-browser on desktop Windows', () => {
- expect(
- shouldEnableBuiltinSkill('lobe-agent-browser', { isDesktop: true, isWindows: true }),
- ).toBe(false);
+ it('should enable agent-browser on desktop Windows', () => {
+ expect(shouldEnableBuiltinSkill('lobe-agent-browser', { isDesktop: true })).toBe(true);
});
- it('should preserve Windows detection for partial context overrides', async () => {
+ it('should not be affected by Windows platform detection when desktop is enabled', async () => {
vi.stubGlobal('process', { ...process, platform: 'win32' });
vi.resetModules();
const { shouldEnableBuiltinSkill } = await import('./skillFilters');
- expect(shouldEnableBuiltinSkill('lobe-agent-browser', { isDesktop: true })).toBe(false);
+ expect(shouldEnableBuiltinSkill('lobe-agent-browser', { isDesktop: true })).toBe(true);
});
it('should keep non-desktop-only skills enabled', () => {
diff --git a/src/helpers/skillFilters.ts b/src/helpers/skillFilters.ts
index 9ccb8255747..fd1b6c5a411 100644
--- a/src/helpers/skillFilters.ts
+++ b/src/helpers/skillFilters.ts
@@ -4,34 +4,18 @@ import { type BuiltinSkill } from '@lobechat/types';
export interface BuiltinSkillFilterContext {
isDesktop: boolean;
- isWindows?: boolean;
}
const DESKTOP_ONLY_BUILTIN_SKILLS = new Set([AgentBrowserIdentifier]);
-/** Agent Browser is hidden on Windows (not yet fully supported) */
-const WINDOWS_HIDDEN_BUILTIN_SKILLS = new Set([AgentBrowserIdentifier]);
-
-const getIsWindows = (): boolean => {
- if (typeof process !== 'undefined' && process.platform) {
- return process.platform === 'win32';
- }
- if (typeof window !== 'undefined' && window.lobeEnv?.platform) {
- return window.lobeEnv.platform === 'win32';
- }
- return false;
-};
-
const DEFAULT_CONTEXT: BuiltinSkillFilterContext = {
isDesktop,
- isWindows: getIsWindows(),
};
const resolveBuiltinSkillFilterContext = (
context: BuiltinSkillFilterContext = DEFAULT_CONTEXT,
): BuiltinSkillFilterContext => ({
isDesktop: context.isDesktop ?? DEFAULT_CONTEXT.isDesktop,
- isWindows: context.isWindows ?? DEFAULT_CONTEXT.isWindows,
});
export const shouldEnableBuiltinSkill = (
@@ -42,7 +26,6 @@ export const shouldEnableBuiltinSkill = (
if (DESKTOP_ONLY_BUILTIN_SKILLS.has(skillId)) {
if (!resolvedContext.isDesktop) return false;
- if (WINDOWS_HIDDEN_BUILTIN_SKILLS.has(skillId) && resolvedContext.isWindows) return false;
return true;
}
diff --git a/src/helpers/toolAvailability.ts b/src/helpers/toolAvailability.ts
index 47b9b5a7484..f2da694c161 100644
--- a/src/helpers/toolAvailability.ts
+++ b/src/helpers/toolAvailability.ts
@@ -15,7 +15,6 @@ export interface ToolAvailabilityInstalledPlugin {
export interface ToolAvailabilityContext {
installedPlugins?: ToolAvailabilityInstalledPlugin[];
isDesktop?: boolean;
- isWindows?: boolean;
}
export const isBuiltinToolAvailableInCurrentEnv = (id: string) => shouldEnableTool(id);
@@ -24,13 +23,12 @@ export const isBuiltinSkillAvailableInCurrentEnv = (
id: string,
context: Omit<ToolAvailabilityContext, 'installedPlugins'> = {},
) => {
- if (context.isDesktop === undefined && context.isWindows === undefined) {
+ if (context.isDesktop === undefined) {
return shouldEnableBuiltinSkill(id);
}
return shouldEnableBuiltinSkill(id, {
isDesktop: context.isDesktop ?? isDesktop,
- isWindows: context.isWindows,
});
};