Skip to content

feat(agent-task): read-only product_site with product_page_view tool - #2643

Merged
chubes4 merged 2 commits into
mainfrom
feat/issue-2639-product-site
Dec 5, 2026
Merged

chubes4 merged 2 commits into
mainfrom
feat/issue-2639-product-site

Conversation

@chubes4

@chubes4 chubes4 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #2639.

Agent tasks can now look at a running product site instead of inferring its UI from source. Docs Agent is the first consumer (Automattic/docs-agent#197).

Change

  • New optional product_site request field (blueprint, plugins, start_url, optional login_role, wp), exposed on the run-agent-task reusable workflow. When it's set, the CLI boots that site before the agent turn and tears it down in a finally.
  • New product_page_view({ path }) tool, declared only when product_site is set. It returns the page title, bounded visible text, a heading outline and the interactive elements (links, buttons, field labels), and stages a PNG screenshot under product-site/screenshots in the uploaded artifacts.
  • The sandbox reaches the viewer only through the PHP host-tool bridge.
  • Read-only: browser routing allows same-origin GET and HEAD only. Form posts, REST writes and other origins are aborted in the browser. The only credential is an optional caller-declared logged-in role.
  • Without product_site, runs are unchanged.

Verification (rebased on v0.36.3)

  • tests/product-site-page-view.test.ts boots a real WordPress with a fixture plugin: the page view returns the plugin's real text and a screenshot, and a page that auto-submits a form and fires a REST POST leaves the site unchanged. All 4 cases pass.
  • tests/product-site-workflow.test.ts, tests/run-agent-task-reusable-workflow-interface.test.ts, tests/agent-task-reusable-workflow.test.ts, scripts/php-product-site-executor-smoke.php and npm run build all pass.

AI disclosure: Claude Opus (Anthropic) wrote this in a Homeboy Cook (all 3 gates green). Franklin (Claude in the Pi coding agent, directed by @chubes4) reviewed it, rebased it after main moved, re-ran the tests and published it.

@chubes4
chubes4 merged commit 697ecb0 into main Dec 5, 2026
4 of 5 checks passed
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.

Agent tasks: read-only view of a running product site (product_site + product_page_view)

1 participant