π€― 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
π fix(agent): safer browser lifecycle & runCommand install prompts (#16888)
YuTengjinge15d14d3f222
diff --git a/packages/builtin-skills/src/agent-browser/content.ts b/packages/builtin-skills/src/agent-browser/content.tsindex 20757b4e313..de6df0d0d0f 100644--- a/packages/builtin-skills/src/agent-browser/content.ts+++ b/packages/builtin-skills/src/agent-browser/content.ts@@ -18,7 +18,9 @@ Refs become **stale on every page change** (click that navigates, form submit, dIf a page opens to an empty body or a verification/challenge screen, treat it as a block, not a slow load β go straight to the real-Chrome step below.-When the task is done, run \`agent-browser close\` and quit any Chrome you launched for CDP β browsers opened for the task otherwise stay on the user's machine.+If a page requires signing in (a login form, an account/password wall, or an OTP/verification step you have no credentials for), don't guess credentials or engineer a way around the gate. Open it in a visible browser β the real-Chrome CDP window below is one β ask the user to sign in themselves in that window, and continue once they confirm.++When the task is done β every time, as the final step and without waiting to be asked β run \`agent-browser close\` and quit any Chrome you launched for CDP. A browser you opened for the task otherwise keeps running on the user's machine. See the teardown rule below for how to quit the CDP Chrome without touching the user's own browser.## Blocked or dynamic pages β go straight to real Chrome@@ -37,6 +39,8 @@ An empty body, a verification/challenge screen, or a page that is mostly obfusca**Commit to real Chrome; don't thrash.** Once step 1 comes back empty, do not sleep, reload, re-screenshot, switch to \`--headed\` (same automation browser β not an escalation), or reopen the session. And do NOT hand-roll the bypass yourself β no reversing the challenge JS, no computing clearance cookies with curl/python/node. Those are slow, per-site, and break on the next algorithm change; real Chrome is the general answer, so go there and see it through.+**To stop the CDP Chrome, target the automation instance only β never kill by name.** Prefer \`agent-browser --cdp 9222 close\`. If a process lingers and you must force-kill it, match only its dedicated user-data-dir marker: \`pkill -f "user-data-dir=$HOME/.agent-browser-cdp"\`. Do NOT match on \`--remote-debugging-port=9222\` alone β 9222 is the standard CDP port and may belong to a Chrome the user themselves opened for debugging. NEVER \`pkill -f "Google Chrome"\` or \`killall "Google Chrome"\` β that pattern also matches the user's own everyday Chrome and will close all their windows and tabs. The same rule applies when a CDP connect fails and you need to relaunch: kill only the marked instance, never the user's Chrome.+A JS-challenge cookie (\`cf_clearance\`, \`*_jsl_clearance*\`, \`acw_tc\`, β¦) next to an empty/challenge body confirms the block. The same cookie next to real content means the challenge already passed β keep the session and read the page. Dump large page output to a file first, then \`grep\`/\`head\` it.## Discovering everything elsediff --git a/packages/builtin-tool-local-system/src/systemRole.desktop.ts b/packages/builtin-tool-local-system/src/systemRole.desktop.tsindex c6eaf4611be..bf53bae6b3e 100644--- a/packages/builtin-tool-local-system/src/systemRole.desktop.ts+++ b/packages/builtin-tool-local-system/src/systemRole.desktop.ts@@ -79,6 +79,7 @@ You have access to a set of tools to interact with the user's local file system:- 'description' (Optional but recommended): A clear, concise description of what the command does (5-10 words, in active voice). **IMPORTANT: Always use the same language as the user's input.** If the user speaks Chinese, write the description in Chinese; if English, use English, etc.- 'run_in_background' (Optional): Set to true to return immediately after starting the terminal session. The result includes a 'shell_id' for later observation or termination.The command runs in cmd.exe on Windows or /bin/sh on macOS/Linux. The returned output reflects the tool's wait window, not necessarily the full command lifetime.+ - Installing software: do NOT proactively install software on the user's system. Prefer tools that are already installed, or a no-install alternative. If a task genuinely needs a system-level or global install (e.g. \`brew install\`, \`apt\`/\`dnf install\`, \`npm i -g\`, \`pipx\`, a global \`pip install\`), ask the user first and explain why, rather than running the install on your own. Routine project-local dependency installs (e.g. \`npm\`/\`pnpm install\` inside a project, \`pip install\` inside an active virtualenv) are fine β run them as normal.- Result semantics:- 'success' indicates whether the tool call itself succeeded.- 'shell_id' identifies the terminal session for later observation/termination.diff --git a/packages/builtin-tool-local-system/src/systemRole.ts b/packages/builtin-tool-local-system/src/systemRole.tsindex eb05a9f4082..850c05aa0f2 100644--- a/packages/builtin-tool-local-system/src/systemRole.ts+++ b/packages/builtin-tool-local-system/src/systemRole.ts@@ -68,6 +68,7 @@ You have access to a set of tools to interact with the user's local file system:- 'description' (Optional but recommended): A clear, concise description of what the command does (5-10 words, in active voice). **IMPORTANT: Always use the same language as the user's input.** If the user speaks Chinese, write the description in Chinese; if English, use English, etc.- 'run_in_background' (Optional): Set to true to return immediately after starting the terminal session. The result includes a 'shell_id' for later observation or termination.The command runs in cmd.exe on Windows or /bin/sh on macOS/Linux. The returned output reflects the tool's wait window, not necessarily the full command lifetime.+ - Installing software: do NOT proactively install software on the user's system. Prefer tools that are already installed, or a no-install alternative. If a task genuinely needs a system-level or global install (e.g. \`brew install\`, \`apt\`/\`dnf install\`, \`npm i -g\`, \`pipx\`, a global \`pip install\`), ask the user first and explain why, rather than running the install on your own. Routine project-local dependency installs (e.g. \`npm\`/\`pnpm install\` inside a project, \`pip install\` inside an active virtualenv) are fine β run them as normal.- Result semantics:- 'success' indicates whether the tool call itself succeeded.- 'shell_id' identifies the terminal session for later observation/termination.