Skip to content

The fastest browser for AI agents to run browser automation, built for sharing your logged-in browser state with your AI agents, like Codex or Claude Code, without disturbing you. Zero cost, zero config.

docs(ego-browser): let finish share the last script of a reply

Zhuowei Wang545df15646d8
diff --git a/package/ego-browser/skill-body/SKILL.md b/package/ego-browser/skill-body/SKILL.md
index 112d628..e302137 100644
--- a/package/ego-browser/skill-body/SKILL.md
+++ b/package/ego-browser/skill-body/SKILL.md
@@ -515,13 +515,11 @@ you finished with kept Pages, neither `taskSpace()` nor `takeOverTaskSpace()`
can resume it. After the claim, adopt each tab you kept and use the label
`adopt()` returns.
-End each reply's browser work with one `finish()` in a separate last script,
-run after earlier output has shown that the request is done, and wait for it
-before you report. A space finished too early must not take more work in this
-reply:
+End each reply's browser work with one `finish()`, called after its last
+browser step; it can run in the same script as that step. Wait for it before
+you report:
```js
-const task = await taskSpace(7); // the taskSpaceId printed earlier in this reply
// Default: close the space, including tabs you kept in an earlier reply.
await task.finish({ keep: [] });
diff --git a/plugins/ego/tests/claude-plugin-mode-isolation.test.mjs b/plugins/ego/tests/claude-plugin-mode-isolation.test.mjs
index bc6dbf0..300fd21 100644
--- a/plugins/ego/tests/claude-plugin-mode-isolation.test.mjs
+++ b/plugins/ego/tests/claude-plugin-mode-isolation.test.mjs
@@ -67,9 +67,14 @@ function assertTaskSpaceSafety(skill, label) {
);
assert.match(
skill,
- /End each reply's browser work with one `finish\(\)` in a separate last script,[\s\S]*?wait for it\s+before you report/i,
+ /End each reply's browser work with one `finish\(\)`[\s\S]*?Wait for it before\s+you report/i,
`${label} must wait for cleanup before reporting completion`,
);
+ assert.doesNotMatch(
+ skill,
+ /separate last script/i,
+ `${label} must not spend an extra script on finish()`,
+ );
assert.match(
skill,
/does not verify the resulting application state/i,