Skip to content

Refactor and Cleanup Webagent#267

Merged
philipph-askui merged 3 commits intomainfrom
feat/webagent
Apr 30, 2026
Merged

Refactor and Cleanup Webagent#267
philipph-askui merged 3 commits intomainfrom
feat/webagent

Conversation

@philipph-askui
Copy link
Copy Markdown
Contributor

  • Add missing Playwright tool wrappers (screenshot, mouse move/click/scroll/hold/release, type, keyboard tap/press/release)
  • Add PlaywrightBaseTool base and Playwright ToolTag to mirroring the existing ComputerBaseTool / AndroidBaseTool with automatic agentOs Injection pattern
  • Add PlaywrightAgentOsFacade for coordinate scaling similar to how it is done for Android
    resolution

@philipph-askui philipph-askui marked this pull request as ready for review April 24, 2026 06:58
Comment on lines +52 to +54
if not isinstance(agent_os, AgentOs):
raise AgentOsTypeError(
expected_type=AgentOs,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not isinstance(agent_os, AgentOs):
raise AgentOsTypeError(
expected_type=AgentOs,
if not isinstance(agent_os, PlaywrightAgentOs):
raise AgentOsTypeError(
expected_type=PlaywrightAgentOs,

instance to set.

Raises:
TypeError: If the agent OS is not an `AgentOs` instance.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TypeError: If the agent OS is not an `AgentOs` instance.
TypeError: If the agent OS is not an `PlaywrightAgentOs` instance.

return Image.open(io.BytesIO(screenshot_bytes))
screenshot_bytes = self._page.screenshot(scale="css")
screenshot = Image.open(io.BytesIO(screenshot_bytes))
if report:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if report:

x (int): The horizontal coordinate (in pixels) to move to.
y (int): The vertical coordinate (in pixels) to move to.
_duration (int): Unused parameter as it is not applicable here.
duration (int, optional): Ignored — Playwright moves the mouse
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it used ?

@philipph-askui philipph-askui merged commit 54ac8a6 into main Apr 30, 2026
1 check passed
@philipph-askui philipph-askui deleted the feat/webagent branch April 30, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants