docs(ego-browser): document task space reassignment and screenshot coordinate scaling - #257
Open
liuhedev wants to merge 1 commit into
Open
Conversation
…ordinate scaling Two operational gotchas discovered in real-world multi-session usage: - A task space can vanish or get reassigned without warning when another process shares the same browser instance, causing a later useOrCreateTaskSpace(id) call to throw "task space not found". Documents the recovery pattern: treat it as a cold start, not a retryable error. - captureScreenshot() images can be scaled down from the real viewport, so clicking at coordinates measured directly off the screenshot lands off-target. Documents checking image dimensions against pageInfo()'s pw/ph and the getBoundingClientRect() alternative.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two operational caveats to
skills/ego-browser/SKILL.md:useOrCreateTaskSpace(id)call to throwtask space not found: <id>. Documents the recovery pattern — treat it as a cold start, re-navigate, and re-verify state rather than assuming prior context still holds.captureScreenshot()images can be scaled down from the real viewport (e.g. a page rendered smaller than its actual pixel size), so clicking at coordinates measured directly off the screenshot image lands off-target. Documents checking image dimensions againstpageInfo()'spw/phand multiplying accordingly, plus thegetBoundingClientRect()alternative that skips the conversion entirely.Why
Both were hit during a real multi-hour agent session doing DataArts Studio console operations (navigating, clicking, running scripts across many heredoc rounds). The task space was silently replaced mid-session (likely because another concurrent ego-browser session shared the same browser instance), and several clicks landed on the wrong element because coordinates were read directly off a screenshot without accounting for its scale factor relative to the real viewport. Neither gotcha was documented, so the agent spent significant time debugging both from scratch. Documenting them should save that debugging time for future sessions.
How to verify
Documentation-only change to
skills/ego-browser/SKILL.md, no code/runtime changes. Read the two new paragraphs in context (Task spaces section, and Caveats section) to confirm they fit the surrounding tone and don't duplicate existing guidance.Impact
useOrCreateTaskSpace,captureScreenshot,click, etc.) — no runtime behavior changes.SKILL.zh.mdexists yet in this repo, so no i18n sync needed.npm test/npm run typecheck/npm run validate:site-skillsare unaffected by this change.