Repository navigation
AI Workspace: answer site questions and link to the right admin screen - #1315
Conversation
Part of #1287 (PR B, U6). In a live run of #1314 the assistant proposed a new tagline and site title without being able to read the current ones. ai/get-site-info returns the site's name, tagline, home URL, language, timezone, date and time formats, active theme and whether it is a block theme, plus the WordPress and PHP versions for users with manage_options. It never returns the admin email, database details or the plugin list. - A read ability like the content reads: any logged-in user, annotated read-only and not open-world, listed over MCP. It joins the workspace's curated tool list, since policy admission is off by default. - core/get-site-info joins NEVER_ADMITTED next to the environment and settings readers, because it returns the admin email. - Ports the field choices from #1214's Read_Site, without its posts, pages and plugins sections. Co-authored-by: Vrishabhsk <vrishabhsk@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #1287 (PR B, U7). The assistant can now answer "where do I hide my site from Google?" with a link to Settings -> Reading, through ai/find-admin-screens. - The ability matches the request against a curated map of 33 core admin screens on the server (titles plus keywords), with no nested model call, and returns up to five, best first. - It returns only screens the current user can open, as admin_url() links on the site's own host. A filtered entry whose path has a scheme, a leading slash or "..", is dropped. - Sites and plugins can add or remove entries with wpai_admin_screens. - The Site Editor is offered only on block themes and the Customizer only on classic ones. - A read ability like the others: any logged-in user, read-only, listed over MCP, on the workspace's curated tool list. #1250's palette ability (a nested model call over the palette's own commands) stays separate; it comes with the Command Palette slice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #1287 (PR B). Each was reproduced before fixing. - ai/get-site-info failed when called with no input ("input is not of type object"), which is how a model or MCP client calls an ability that takes none. The input schema now defaults to an empty object. - The site name and tagline came back HTML-escaped ("Tom & Jerry's"). They are now decoded, as the site identity card does. - The WordPress and PHP versions are gated on view_site_health_checks, core's Site Health capability, rather than manage_options. On multisite that keeps them to super admins, as core does. - The screen finder's stemmer turned "setting" into "sett" but "settings" into "setting", so a singular query missed plural keywords. The -ing rule is gone; every word in the map now stems the same way twice. - Tests for the block-theme branch: the Site Editor on block themes, the Customizer on classic ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
The classic-theme screen-finder test switched to Twenty Twenty-One, which the CI environment doesn't install, so it failed there while passing locally. It now registers a minimal classic theme under tests/Integration/fixtures/themes and restores the theme directories afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/agent-approval-writes #1315 +/- ##
================================================================
+ Coverage 86.54% 86.60% +0.06%
- Complexity 6190 6246 +56
================================================================
Files 220 222 +2
Lines 22321 22581 +260
================================================================
+ Hits 19318 19557 +239
- Misses 3003 3024 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
On multisite only a super admin can open Plugins or see Site Health, as in core, so the administrator fixture in both test classes is now granted super admin there and revoked afterwards. The filter test used that administrator as the user without the custom capability; a super admin has every capability, so it uses the subscriber instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
admin-screens.php is a data map that Find_Admin_Screens loads. Its test class @Covers that class, so PHPUnit drops the map's lines and Codecov reported the file at 0% (214 of the PR's 221 missing lines), though every entry runs on each call. It is now excluded, as the vendored code is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Vrishabhsk. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
A tool step with no retrieval summary was labelled "Looked up site content", which was accurate when every tool read content. Finding an admin screen or reading site info isn't that, so the fallback now reads "Checked the site (1 step)". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… list
The input schema declared `'properties' => array()`, which reaches the
model as `"properties": []`. OpenAI refuses the request ("[] is not of
type 'object'"), and because the workspace offers this ability on every
turn, every message failed. Anthropic accepts the list, which is why
the earlier live checks passed.
The key is dropped. `additionalProperties: false` still refuses any
input, and the empty default still lets it run with none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pplied on approval (#1314) ## What? Related: #1287 The AI Workspace can now change things that already exist, not only create drafts and templates. The assistant can propose a new title, excerpt or content for a post, or a new site title or tagline. Nothing changes until you approve, and the card shows each current value next to the proposed one. You can edit a value before approving it. This is the first of the stacked PRs that build #1287's single agent on top of `feat/ai-workspace` (#1004). It ports #1214's write actions. The next PRs add site info and screen finding, then the Command Palette entry, then audit and privacy hooks, then the docs pass for the name. ## Why? #1287's first version needs the agent to finish tasks like "change my tagline to fit what I write about" instead of telling the person how. Before this, the workspace's approval flow could only create new posts. Its single-approval guarantee rested on a per-post token, which doesn't exist when you're editing something that's already there. ## How? **Writes are proposal types, not abilities.** `ai/propose-post-changes` and `ai/propose-site-identity` only store a proposal. The write happens when the person approves it in the card. #1214 registered `ai/site-agent-update-post` and `ai/site-agent-update-setting` as abilities instead. In this plugin every `ai/*` ability is offered over MCP by default, so those would have been callable by any MCP client with no approval step. #1214's validation rules are ported into the two new writers. **The approval flow is now safe for editing existing content:** - **One approval:** approving takes a lock with a single `INSERT IGNORE` into the options table, the pattern core's `WP_Upgrader::create_lock()` uses. `add_option()` won't do here: it writes with `ON DUPLICATE KEY UPDATE`, which lets a second claim with a different value succeed. - **Partial results kept:** each item's result is saved as soon as it's written. An approval still running after five minutes reads as failed and keeps its partial results. - **Expired and deleted:** an expired proposal is reported as expired, not "not found". A proposal whose chat was deleted can't be approved. - **Checked at approval:** a field that changed since it was proposed is left alone and reported as changed. One already at the new value is reported as unchanged. A post someone else is editing is reported as locked. - **Edits re-checked:** an edited value runs through the same server-side rules as the assistant's value, and it can change only the value, never which post, field or option is targeted. **Content stays intact:** - **Plain titles:** a title with any markup is refused. Core skips title kses for admins with `unfiltered_html`, so this check is the only one. - **No silent stripping:** a content change is refused when kses would strip something from the post's current content, such as an iframe or an embed saved by an admin. Ordinary block markup like images and separators is fine. - **One field at a time:** writing one field leaves the post's other text columns exactly as stored. - **Block markup kept:** `ai/read-content-bodies` gains `raw: true`. It returns the stored markup, only for posts the user can edit, so a content change can keep the post's blocks. **The card hides nothing that would publish.** Content is parsed in an inert `DOMParser` document and drawn through the transcript's existing renderer. Self-closing blocks (`core/rss`, `core/latest-posts`), media, embeds and form controls show in place as plain text, so a person sees everything they're approving. Nothing is fetched or run, and links are live only on the site's own host. **Workspace-only abilities are off MCP.** `ai/propose-*` and `ai/ask-user` now declare `meta.mcp.public` as false. Before, MCP clients were offered tools that always refused outside a workspace turn. An override on the MCP Access screen still wins. **Filters:** - `wpai_workspace_write_proposals_enabled` (default true) turns these two proposal types off. That's #1287's "allow writes" question: on by default, with no settings toggle. - `wpai_workspace_proposal_kinds` is the list of proposal types. The tool list, the turn-ending rules and the system instruction are now all built from it. Code from #1214 is credited to @Vrishabhsk with Co-authored-by on the two writer commits. ### Use of AI Tools AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: planning, implementing the changes and tests, and code review. I've reviewed the changes, understand them and can explain them under review. They have all been tested locally. ## Testing Instructions 1. Enable AI Workspace under Settings → AI and connect a provider. 2. In Tools → AI Workspace, ask "Make my tagline fit what I write about". - The card shows the current tagline beside the proposed one. - Edit the proposed tagline, then apply. Settings → General shows your edited tagline. 3. Ask for a new title for one of your published posts. The card says the change is live as soon as you approve it. 4. Open the same chat in a second tab and approve in the first. The second tab shows the outcome, not an Apply button. **Tests run** (all passing): - **PHPUnit, full suite:** 3306 tests on WordPress latest, on both single site and multisite, at 4f6931b. Before the first round of review fixes, the full suite also passed on trunk (7.2-beta4), at 3286 tests. - **PHPUnit, new tests:** - `Proposal_StoreTest`: lock, failed window, expiry grace, edits, kind registry, write gate, and client/server ability parity. Includes `test_a_lock_row_written_outside_the_cache_blocks_the_claim`, which failed against the old `add_option()` lock. - `Post_Field_ProposalTest`, including `test_a_title_changed_since_the_proposal_is_stale`, `test_two_fields_of_one_post_both_write`, `test_a_post_locked_by_another_user_is_locked`, `test_content_with_an_iframe_is_refused_but_other_fields_work`, `test_content_with_an_image_block_accepts_a_change`, `test_content_with_a_separator_block_accepts_a_change`, `test_content_kses_would_strip_from_is_refused`, `test_an_edit_cannot_retarget_the_item`, `test_a_duplicate_field_of_one_post_is_refused`, `test_a_model_supplied_snapshot_is_ignored` and `test_a_title_with_a_backslash_survives_the_write`. - `Site_Identity_ProposalTest`: 16 tests. - `Proposal_ControllerTest`: `test_approval_while_another_request_holds_the_lock_writes_nothing`, `test_an_interrupted_write_keeps_partial_results_and_reads_as_failed`, `test_approving_after_the_chat_was_deleted_is_refused` and `test_get_returns_the_stored_results_once_approved`. - `MCP_AdapterTest`: `test_plugin_ability_declared_hidden_stays_hidden`, `test_workspace_only_abilities_are_hidden_from_mcp`, `test_override_exposes_a_plugin_ability_declared_hidden` and `test_workspace_only_ability_refuses_outside_a_turn`. - `Read_Content_BodiesTest`: `test_raw_returns_stored_markup_to_an_editor_of_the_post`, `test_raw_is_withheld_from_a_user_who_can_only_read_the_post` and `test_raw_is_off_by_default`. - **e2e (Chromium):** all `tests/e2e/specs/experiments/ai-workspace*` specs, 135 passed at 4f6931b. They were run with this branch merged into #1315, because this PR's own test site holds the live-check data. - New `ai-workspace-update-proposals.spec.ts` (8 tests): current next to new, plus editing; the server's message on an invalid edit; a second page after approving; approving in a second page while the first is still writing; a stale field; deselecting one of three changes; a reopened discarded proposal; the tagline. - New `ai-workspace-html.spec.ts` for the content renderer. It covers every element shown as plain text instead of rendered, and the notice naming blocks whose settings a content change alters. - From the second review round: "an approval whose answer is lost after it wrote shows what was applied" and "discarding a change another page already applied shows what was applied". - **Test-first:** tests written before their change failed before it. - **Other checks:** PHPStan finds no errors. phpcs is clean on the changed plugin PHP. tsc, lint-js and the build are clean. - **Live check with a real provider** (on a separate test site, not the demo one), one 19-turn chat: 7 proposals and 9 changes approved, all reported as updated, none stale, locked or failed. - The site title and tagline were both changed. - A published post's title and the excerpts of the three latest posts were updated. - The same post's content was rewritten four times: separators, headings and lists added, sections filled in, the intro changed, and Ctrl to Ctrl/Cmd. After each rewrite the post was still valid block markup, with every block parsed and 6 revisions kept. Rewrites after the first one added separators were still accepted. - When asked to fill in sections it had no facts for, the assistant asked which ones to use rather than inventing them. - **Second live check** (2026-11-07, Anthropic `claude-sonnet-5`, at 4f6931b, through the workspace REST routes as an administrator): one turn and one approval per write kind, with the posts and options read straight from the database before and after. - A post title, an excerpt approved with the person's edited value in place of the model's, block content with a paragraph added, and the site title and tagline together. Each was reported as updated. - After each turn the database was unchanged. Approving changed only the field proposed (plus `post_modified`), and the edited excerpt was written as edited. - The block content kept its existing blocks byte for byte, and the new paragraph was a `wp:paragraph` block. - A second approval of the same proposal returned the stored results and wrote nothing. - **Found in that run and fixed in 36820b2:** an applied card no longer showed what the field now held. It now shows "Now: …". The tool-steps summary also said "1 steps". - **PHPUnit added in the second review round**, each failing before its fix: `test_a_stale_lock_replaced_before_the_delete_is_not_deleted`, `test_a_writer_that_throws_part_way_leaves_the_proposal_failed`, `test_discarding_while_an_approval_holds_the_lock_is_refused`, `test_an_executed_proposal_read_after_expiry_shows_its_outcome`, `test_approving_with_nothing_selected_is_refused_for_any_kind`, `test_a_post_another_hook_updates_during_the_write_keeps_its_own_columns` and `test_content_proposed_after_the_post_changed_since_it_was_read_is_refused`. **Code review, two rounds:** - **Round one** (run `20261106-154448-0faae422`): 8 reviewers and an independent validator. A bug in how the reviewer prompts were built cut off the PR's intent and the location of its diff, so each reviewer worked out the scope on its own. Its findings were checked against the code and are fixed in 25748bd: - content changes were refused for posts with image or separator blocks; - the card dropped markup that would publish; - content could only be read as stripped text; - a proposal could name the same field twice; - missing tests and a docs line. - **Round two** (run `20261106-212611-pra2rerun`): the same 8 reviewers on the full diff at 36820b2, with the intent and diff in every prompt. Each finding was reproduced or traced in the code before being fixed, rather than going through the separate validator. Fixed in 476784a to 4f6931b: - after a lost or 5xx approval response, the card said nothing was changed without checking (three reviewers found this). It now reads the proposal back and shows what was applied; - a writer that threw left the proposal executing and the lock held. It now settles as failed, keeps the partial results and tells the model; - a discard didn't take the approval lock, and could land during an approval; - two requests reclaiming a dead lock could both get it; - an applied proposal opened after its expiry showed as expired instead of showing what was applied; - discarding in a second window after the first applied said nothing was changed; - the "select at least one item to create" message was shown on update cards; - the column pin leaked into other posts written by hooks during the save; - a change to a wrapping block's settings, such as a Query Loop's arguments, was invisible in the card. The card now names those blocks; - an edit made to a post between the assistant reading it and proposing a change could be overwritten. A content change based on an older read is now refused; - one interrupted-approval path re-ticked items the person had unticked. The cross-model pass didn't run, because no model CLI from another provider is installed. ## Unapplied review findings - [ ] P2: `includes/Experiments/AI_Workspace/Propose_Post_Changes.php`: the four propose abilities repeat the same setup code (turn check, meta block, proposal envelope). A shared base would remove it. Deferred: it follows the existing pattern, and it's a refactor outside this PR's scope. - [ ] P2: `Propose_Post_Changes` and `Propose_Site_Identity` each check for a duplicate target themselves. The kind could own a target key, and the store could refuse duplicates once. Deferred: same refactor scope as above. - [ ] P2: `src/experiments/ai-workspace/utils/proposal-card.ts`: the client works out which proposal types are updates (`UPDATE_KINDS`, `SITE_FIELDS`) on its own. The server could send `is_update` and the target instead. Deferred: it changes the contract between client and server. - [x] Residual risk (fixed in 22d5d2c): `decline_proposal()` doesn't take the approval lock, so a discard can interleave with an approval that has claimed the lock but not yet saved. - [x] Residual risk (fixed in 3c4cd75): `keep_other_columns()` pins the `*_save_pre` filters for the whole `wp_update_post()` call. A `save_post` hook that writes a different post would receive this post's columns. - [ ] Residual risk: approving while the same user has the post open in the block editor passes their own post lock. A later autosave from that tab could revert the change. ## Screenshots or screencast **Post changes: each current value beside the proposed one**  **Editing a proposed value before approving**  **A tagline proposal**  **After approval: the post is updated**  **After approval: the new tagline is live**  **A field changed since the proposal is left alone and reported**  ## Changelog Entry > Added - AI Workspace can propose changes to a post's title, excerpt or content, and to the site title and tagline, applied only after approval, with current and new values shown side by side. **Post-deploy monitoring:** no additional operational monitoring is required. This is an experiment behind the AI Workspace toggle, off by default, and every write needs explicit approval. --- [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- wp-playground-preview:start --> <a href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1314-de66f8c8c5056c5bac61514daa130d6d890c275d.zip%22%7D%7D%5D%7D" target="_blank" rel="noopener noreferrer"> <img src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg" alt="Open WordPress Playground Preview" width="220" height="57" /> </a> <!-- wp-playground-preview:end --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Vrishabhsk <vrishabhsk@gmail.com>
## What? Related: #1287, #1250 The Command Palette joins the AI Workspace: - **AI suggestions when a search finds nothing.** Type "hide my site from google" into the palette (Cmd/Ctrl+K). If the palette has no match of its own, it asks the model which of its commands fit and shows up to three, such as Settings → Reading. - **"Ask AI" for bigger questions.** For people who can use the AI Workspace, the palette also offers "Ask AI: <your search>". Choosing it opens the AI Workspace with that text in the composer, ready to send. This is the third stacked PR for #1287, on top of #1315 and #1314. ## Why? #1287 asks for one agent surface, with the palette's "Ask AI" (#1250) folded in rather than shipped as a separate experiment. Before this, a plain-language palette search with no match just showed "No results found", and there was no route from the palette into a conversation. ## How? **AI suggestions** port #1250's ability and loader, credited to @JDeepD with Co-authored-by. - When the palette has settled with no results, its search is at least 3 characters, and the person has stopped typing for 450 ms, the loader sends the search and the palette's own command list (names, labels and keywords) to `ai/command-palette-ai-search`. The model picks up to three command IDs. IDs that weren't sent are dropped, on the server and again in the browser. Failures stay silent, and the palette shows its own empty state. - "Settled" means core's own post and page search has finished too. The loader waits for the palette's empty state, which core shows only once its search loaders are done, so an AI request never races a slow post search. - The payload is cut to the ability's limits (500 commands, and caps on label and keyword length), so a large site doesn't fail validation. A search longer than the ability accepts gets no AI request, but still gets the Ask AI row. - Editors and above get suggestions (`edit_posts`); subscribers don't. - #1250's separate experiment and toggle are gone. The loader is enqueued by the AI Workspace experiment, on screens that load the Command Palette. - The ability is hidden from MCP (`meta.mcp.public = false`), and the workspace's tool policy refuses it as an agent tool. It's annotated non-destructive and idempotent, but not read-only: core's REST run route accepts only GET for read-only abilities, and the palette's command list is too long for a URL. **Ask AI** is offered only to workspace users (`manage_options`, the AI Workspace screen's capability). - It appears under the same conditions as the suggestions, after them, and it stays when the AI request fails. - Choosing it opens the AI Workspace with a `wpai-prompt` query arg. The text is seeded into the composer as plain text, cut to 500 characters, and never sent automatically. The arg is removed from the URL after load, so a reload doesn't seed it again. - A notice above the composer says the message came from a link and should be checked before sending. Anyone can send an admin a link like that. - `get_seed()` gains a prompt field. A prompt seed takes precedence over a post seed. Adds `@wordpress/commands` 1.57.0 as a dependency. ### Use of AI Tools AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: porting #1250, implementing the changes and tests, and code review. I've reviewed the changes, understand them and can explain them under review. They have all been tested locally. ## Testing Instructions 1. Enable AI Workspace and connect a provider. 2. Press Cmd/Ctrl+K and type "hide my site from google". After a moment, Settings → Reading appears selected, and Enter opens it. 3. Type "which of my posts are missing featured images" and choose "Ask AI: …". The AI Workspace opens with that text in the composer, unsent, with a notice above it. 4. As an editor, repeat step 2: you get suggestions but no Ask AI row. 5. Search for one of your post titles. The palette shows the post, and no AI request is made. **Tests run** (all passing): - **PHPUnit, full suite:** 3376 tests, single site and multisite, on WordPress latest. - **`Command_Palette_AI_SearchTest`** (ported from #1250, extended): including `test_ability_is_hidden_from_mcp_and_refused_as_an_agent_tool`, `test_execute_callback_drops_an_id_that_was_not_sent`, `test_execute_callback_drops_invalid_ids_and_caps_results`, `test_permission_callback_for_subscriber` and `test_choose_commands_falls_back_without_structured_output`. - **`Command_PaletteTest`:** `test_palette_search_has_no_experiment_of_its_own`, `test_loader_is_enqueued_with_the_command_palette_for_an_editor`, `test_loader_is_not_enqueued_for_a_subscriber`, `test_loader_offers_ask_ai_to_a_workspace_user`, `test_loader_does_not_offer_ask_ai_to_an_editor` and `test_loader_is_not_enqueued_when_the_experiment_is_disabled`. - **`Admin_PageTest`:** `test_prompt_seed_carries_the_query`, `test_prompt_seed_is_cut_to_the_cap`, `test_prompt_seed_is_plain_text`, `test_empty_or_whitespace_prompt_gives_no_seed`, `test_non_string_prompt_gives_no_seed`, `test_prompt_seed_takes_precedence_over_a_post_seed` and `test_post_seed_has_an_empty_prompt`. - **e2e (Chromium):** all `ai-workspace*` specs plus the palette spec, 157 passed. - `command-palette-ai-search.spec.js`: finds the right screen when the palette has no results; no suggestions when no screen fits; no AI search when the palette has results; a one or two character search makes no request; only the last search is sent and answered when the search changes; an answer naming a command the palette didn't send is dropped; waits for slow post results before searching with AI; a search longer than the ability accepts shows only Ask AI; the palette's own empty state when the request fails; an editor gets suggestions; a subscriber gets none; no AI row and no request when the experiment is disabled. - `ai-workspace-palette-handoff.spec.ts`: Ask AI opens the workspace with the query in the composer, unsent; after a reload the composer is empty and the URL has no prompt; Ask AI comes after the suggestions; an editor sees suggestions but no Ask AI row; a 2,000-character query is cut to the cap; a prompt from a link shows a notice until it's edited; opening the workspace directly shows no notice; a query with markup arrives as plain text; an empty or whitespace query shows no Ask AI row; when the AI request fails, a workspace user sees only Ask AI. - The timing tests were also run three times each, 21 of 21 passing. - **Test-first:** every new PHPUnit test, and 6 of the 8 first Ask AI e2e tests, failed before their change. - **Other checks:** PHPStan finds no errors, phpcs is clean on the changed plugin PHP, and tsc, lint-js and the build are clean. Style lint reports two errors in `ai-workspace/index.scss` that are already on the base branch. - **Not run yet:** a live check against a real provider, and the PHPUnit suite on WordPress trunk. **Code review:** six reviewers ran on this PR's own diff: correctness, security, adversarial, frontend races, testing and maintainability. Each finding was checked in the code before being fixed. Fixed in a4a84fb and a0d7830: - the AI request could fire before core's post and page search finished, showing AI rows next to real results (two reviewers found this); - "Searching with AI…" could stay on screen after an early exit or a changed search; - a cached answer could show for a search that now has real results; - the command list wasn't cut to the ability's limits, so a large site would fail validation, silently; - a composer filled in from a link had no notice; - test gaps: short searches, a changed search, an unsent command name, a slow post search. ## Known limits - Choosing an AI suggestion records it among the palette's recent commands, where it doesn't resolve, so it can take one of the five recent slots. - A cached answer can name a command that was unregistered after a context change. Selecting it runs the original callback. - Suggestions come from the palette's own command list, as in #1250, not from #1315's admin-screen map. ## Screenshots **A palette search with no match gets an AI suggestion**  **Searching with AI**  **Ask AI opens the workspace with the query in the composer, unsent**  **An editor gets suggestions but no Ask AI row**  ## Changelog Entry > Added - The Command Palette suggests admin screens with AI when a search finds nothing, and offers "Ask AI" to continue the question in the AI Workspace. **Post-deploy monitoring:** no additional operational monitoring is required. This is an experiment behind the AI Workspace toggle, off by default. --- [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- wp-playground-preview:start --> <a href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1316-3b897cb8a6b06ce6e099c27b86176305ebc64e54.zip%22%7D%7D%5D%7D" target="_blank" rel="noopener noreferrer"> <img src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg" alt="Open WordPress Playground Preview" width="220" height="57" /> </a> <!-- wp-playground-preview:end --> --------- Co-authored-by: Jaydeep Das <jaydeep.das@rtcamp.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ase, Wapuu busy states (#1317) ## What? Related: #1287 The AI Workspace gains an audit trail, personal-data export and erase, and Wapuu busy states: - **One audit trail.** Every agent event is one `agent` row in the AI Request Log and one call of a new `wpai_agent_event` action. Events are tool calls (including withheld ones), each item an approval writes, and each step in a proposal's life: created, edited, declined, expired, failed, or refused because its chat was deleted. The action fires even when AI Request Logging is off. - **Chats are personal data.** Tools → Export Personal Data includes the person's saved chats, and Tools → Erase Personal Data deletes them. This works with the experiment off. - **Wapuu.** While a turn runs, the transcript shows a working Wapuu instead of a spinner, then a celebrating one for a moment when the turn finishes, or an oops one next to an error. This is the fourth stacked PR for #1287, on top of #1316, #1315 and #1314. ## Why? #1287 asks that a site owner can see everything the agent did, was asked and was refused, in one place, and that audit plugins can hook it. Before this, workspace rows were mixed in with every other `ability` row, proposal events weren't logged at all, and nothing fired with logging off. Saved chats are personal data that core's export and erase tools didn't know about. And Jeff posted a Wapuu set on #1287 so a long turn looks busy rather than stuck. ## How? **`Agent_Audit`** is the one place agent events are recorded. - It fires `wpai_agent_event( $operation, $status, $context, $error )`, then writes the row through `log_ai_request()` with the new `agent` type. - The two existing log calls, for tool calls in `Turn_Runner` and for written items in `Proposal_Writes`, now go through it. Proposal events are recorded in `Proposal_Store` and `Proposal_Controller`: - created, when a proposal is stored; - edited, when an approval carries edits, naming the edited items; - declined; - expired, once, when an expired proposal is next read, since it's deleted then; - failed, when a write throws or is interrupted for longer than the approval lock; - refused, when an approval comes after its chat was deleted. - Context names the conversation, the proposal and its item keys, the post and field, or the option. It never carries post content or option values. - The hook covers agent turns and approvals only. A direct MCP call to an ability doesn't fire it. Docs say so. - The log screen gains the `denied` status, ported from #1214, and agent rows are labelled "Agent". Rows logged before this keep the `ability` type. - #1214's `wp_after_execute_ability` listener isn't ported: `Turn_Runner` already logs each call, so it would log them twice. **`Conversation_Privacy`** registers an "AI chats" exporter and eraser. - They're hooked from `Main`, next to the chat ownership filter, so they work while the experiment is off. - The export has one item per chat: name, created and updated dates, whether it's archived, and each turn's message and reply. Tool results are left out. It pages at 20 chats. - The eraser deletes all the person's chats. - Chat IDs are read straight from the posts table, as the user-deletion cleanup already does, so archived chats are found even while their status isn't registered. That reader is now shared, as `Conversation_Store::chat_ids()`. - A proposal from an erased chat can't be approved, because an approval is refused once its chat is gone. **Wapuu** sprites replace the transcript's spinner. - **Sprites:** `working` while a turn runs, `celebrating` for 1.8 seconds after one finishes, and `oops` next to an error. They come from the set @jeffpaul posted on #1287. - **Accessibility:** each sprite is an `<img alt="">`. The existing "Responding…" text and error text stay as the status. - **Reduced motion:** an SVG inside an `<img>` doesn't reliably follow the page's setting. So with reduced motion on, the component switches each sprite's animations off in its markup, which gives the same still pose. - **Scope:** only busy, done and error states ship. Per-tool sprites need streaming to know which tool is running. - **Credit:** the sprites are derived from Kazuko Kaneuchi's original Wapuu, GPL-2.0-or-later, and credited in `CREDITS.md`. ### Use of AI Tools AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: implementing the changes and tests, and code review. I've reviewed the changes, understand them and can explain them under review. They have all been tested locally. ## Testing Instructions 1. Enable AI Workspace and AI Request Logging, and connect a provider. 2. Send a message. A Wapuu shows beside "Responding…", then a celebrating Wapuu for a moment when the reply arrives. 3. Ask for a new tagline. Edit the proposed value and approve it. Ask for a draft and discard it. 4. Open Tools → AI Request Logs and filter by type `agent`. The tool calls, `proposal_created`, `proposal_edited` and `proposal_declined` rows are there, none of them with the tagline's text. 5. Tools → Export Personal Data for your own email: the download has an "AI chats" section with your chats. Erase personal data for a test user who has chats: their chats are gone. 6. With reduced motion turned on in your OS, the Wapuu is still. **Tests run** (all passing): - **PHPUnit, full suite:** 3398 tests, single site and multisite, on WordPress latest. - **`Agent_AuditTest`:** `test_agent_is_a_log_type`, `test_an_event_writes_one_row_and_fires_the_hook`, `test_the_hook_fires_with_logging_off`, `test_a_proposal_event_names_the_proposal_and_its_items_only` and `test_a_proposal_without_a_kind_is_recorded_as_drafts`. - **`Proposal_ControllerTest`:** `test_each_proposal_event_is_recorded_once_in_order`, `test_events_fire_the_hook_with_logging_off`, `test_an_expired_proposal_is_recorded_once`, `test_an_expired_proposal_read_through_the_store_is_recorded_once`, `test_an_interrupted_write_is_recorded_failed_once`, `test_a_writer_that_throws_is_recorded_failed` and `test_an_approval_for_a_deleted_chat_is_recorded_denied`. - **`Turn_ControllerTest`:** `test_a_turn_records_a_withheld_call_and_a_proposal_in_order`, and `test_every_tool_call_writes_exactly_one_log_row` updated for the `agent` type. - **`Post_Field_ProposalTest`:** `test_a_content_update_records_the_field_not_the_content`. - **`AI_Request_Log_ControllerTest`:** `test_get_logs_filters_agent_rows_by_type_and_denied_status`. - **`Conversation_PrivacyTest`:** `test_the_exporter_and_eraser_are_registered_without_the_experiment`, `test_export_returns_every_chat_with_its_prompts_and_replies`, `test_export_with_the_experiment_off_includes_archived_chats`, `test_export_pages_at_twenty_chats`, `test_erase_removes_the_persons_chats_only`, `test_a_proposal_in_an_erased_chat_cannot_be_approved` and `test_an_unknown_email_exports_and_erases_nothing`. - **e2e (Chromium):** all `ai-workspace*` specs, the palette spec and the request-log spec, 168 passed in one run on a fresh site. That includes the new "AI Workspace Wapuu" tests in `ai-workspace.spec.js`: a running turn shows the busy Wapuu beside "Responding…"; with reduced motion the busy Wapuu is a still frame; a failed turn shows the error Wapuu with the error; a finished turn shows the done Wapuu briefly. Each Wapuu test also ran three more times, 12 of 12 passing. - **Test-first:** the audit tests failed before `Agent_Audit` existed. The privacy tests were written before `Conversation_Privacy` but first run after it, so they have no recorded red run. - **Other checks:** PHPStan finds no errors, phpcs is clean on the changed plugin PHP, and tsc, lint-js and the build are clean. Style lint reports errors in `ai-request-logs/index.scss` and `ai-workspace/index.scss` that are already on the base branch. - **Live check:** core's exporter and eraser lists include "AI chats" on a running site, and the screenshots below come from one. - **Not run yet:** a live check against a real provider, and the PHPUnit suite on WordPress trunk. **Code review:** seven reviewers ran on this PR's own diff (correctness, security, adversarial, testing, maintainability, frontend races and API contract), plus an independent validator. The verdict was "Ready to merge" with no actionable findings. The one candidate, that the status filter rejects `skipped`, was rejected because it's already on the base branch. Applied afterwards in eef886a: agent rows were labelled "Text" on the log screen, a docblock still said these rows use the `ability` type, and the store's expiry path had no test. **One test from #1316 hardened** (1060833): its short palette search for "q" matched "AI Request Logs" whenever AI Request Logging was on, which the request-log spec leaves on when both run in one session. It now searches for "~". ## Screenshots **A running turn**  **A finished turn**  **A failed turn**  **Agent events in the AI Request Log**  **AI chats in a personal-data export**  ## Known limits - After an erase, a pending proposal from an erased chat can still be read by its owner, though not approved, until it expires (about 90 minutes). - "Recorded once" for an expired or interrupted proposal holds for requests that run one after another. Two requests reading the same proposal at the same instant can each record it. - A `wpai_agent_event` listener that throws during an approval write marks the proposal failed, as any WordPress hook would. The hook isn't wrapped. - The log screen's status filter doesn't accept `skipped`, which item rows have used since before this PR. - Workspace rows written after this are `agent`, not `ability`, so a view filtered to `ability` no longer shows them. ## Changelog Entry > Added - AI Workspace records every agent tool call and proposal event in the AI Request Log under an `agent` type, with a `wpai_agent_event` hook that fires even when logging is off; saved chats are included in personal-data export and erase; and a Wapuu shows while a turn runs, finishes or fails. **Post-deploy monitoring:** no additional operational monitoring is required. This is an experiment behind the AI Workspace toggle, off by default. The exporter and eraser run only when an administrator processes a personal-data request. --- [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- wp-playground-preview:start --> <a href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1317-77686452fbd3e34a0cb582c18648d7667c78a603.zip%22%7D%7D%5D%7D" target="_blank" rel="noopener noreferrer"> <img src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg" alt="Open WordPress Playground Preview" width="220" height="57" /> </a> <!-- wp-playground-preview:end --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## What? Related: #1287 The docs pass for the #1287 stack. AI Workspace keeps its name and is documented as the plugin's one agent. The experiment doc, `readme.txt`, `README.md`, the changelog and the settings card now describe what #1314 to #1317 added. No code paths change. This is the fifth and last stacked PR for #1287, on top of #1317, #1316, #1315 and #1314. ## Why? #1287 folds two planned experiments into AI Workspace: Site Agent (#1214) and Command Palette AI Search (#1250). A reader of the docs, readme or changelog should learn that from them. Before this, the settings card and readme still described a workspace that only creates drafts and templates. The changelog had nothing for the write, palette, audit, privacy or Wapuu changes, `README.md` had no AI Workspace entry at all, and "Site Agent" was still listed under Coming Soon. ## How? - **`docs/experiments/ai-workspace.md`** - The summary and key features cover changes to existing content, site answers and screen links, the chats panel, the Wapuu, the audit log and personal-data export. - A new "One agent" section says what Site Agent and Command Palette AI Search proposed and where each now lives. It also says that the name, menu, URL and every identifier, including the experiment ID `ai-workspace`, are unchanged. - The entry-points list names every ability the experiment registers, and `Conversation_Privacy`. - A stale limitation is removed. It said chats have no history screen, but the chats panel ships. - **`readme.txt` and `CHANGELOG.md`** - Added: changes to existing content, the palette's AI search and Ask AI, the `agent` log rows, chats in export and erase, and the Wapuu. - Developer: `wpai_agent_event`, the two new proposal filters, the MCP visibility change, `raw: true`, and the `ability` to `agent` log type change. - `CHANGELOG.md` also gains the two ability lines #1315 added only to `readme.txt`. - **`README.md`:** adds the missing AI Workspace entry. - **Both readme files:** "Site Agent" leaves Coming Soon. - **Settings card:** the AI Workspace description says it answers site questions, proposes changes to posts and the site title and tagline, and adds AI to the command palette. The name stays "AI Workspace". Nothing on #1287 has settled on another name. ### Use of AI Tools AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: writing the documentation and changelog entries, checking them against the code, and code review. I've reviewed the changes, understand them and can explain them under review. They have all been tested locally. ## Testing Instructions 1. Open Settings → AI. The AI Workspace card reads as in the screenshot below. 2. Read `docs/experiments/ai-workspace.md` → "One agent", and the Unreleased changelog in `readme.txt` and `CHANGELOG.md`. **Tests run** (all passing): - **PHPUnit, full suite:** 3398 tests, single site and multisite, on WordPress latest. Only the settings-card string is code, and no test asserts it. - **Other checks:** phpcs and `php -l` are clean on `AI_Workspace.php`. - **Name check:** a grep for "Site Agent" and "Wordspace" across `includes/`, `src/` and the built assets finds nothing user-visible. - **Claims checked against the code:** - the abilities `AI_Workspace::register()` registers; - `meta.mcp.public` false on the propose and ask-user abilities; - the `wpai_workspace_write_proposals_enabled` and `wpai_workspace_proposal_kinds` filters; - `raw` on `ai/read-content-bodies`; - the chats panel's rename, archive and delete actions; - the three in-page anchors the doc links to. - **Not run:** e2e. No script, style or behavior changes. **Code review:** `ce-code-review` sized this diff to a single-context review: 51 changed lines, two of them code. It found nothing and gave "Ready to merge". Its one residual is applied in 0b06540: the doc's feature bullet now says rows are written while AI Request Logging is on. ## Screenshots **The settings card**  ## Known limits - The changelog lines for #1314, #1316 and #1317 are added here rather than in those PRs, so they land only when this one merges after them. ## Changelog Entry > Changed - AI Workspace is documented as the plugin's one agent: it now includes what the Site Agent and Command Palette AI Search proposals planned, under its existing name. **Post-deploy monitoring:** no additional operational monitoring is required. Documentation and one settings-card string. --- [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- wp-playground-preview:start --> <a href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1318-aa0faf515572fcec68b35f0b8a0634d387875fd1.zip%22%7D%7D%5D%7D" target="_blank" rel="noopener noreferrer"> <img src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg" alt="Open WordPress Playground Preview" width="220" height="57" /> </a> <!-- wp-playground-preview:end --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

What?
Related: #1287
The AI Workspace assistant can now answer questions about the site itself, and point people to the right admin screen:
This is the second stacked PR for #1287, on top of #1314. In a live run of #1314, the assistant proposed a new tagline and site title without being able to read the current ones ("I can't see your current site title"). This PR fixes that.
Why?
#1287's first version needs the agent to answer site questions and navigation questions directly. Before this, the workspace could read posts but nothing about the site. It also had no way to know which admin screen handles which job.
How?
ai/get-site-inforeturns these fields, and no others:The WordPress and PHP versions are included only for users who can see Site Health (
view_site_health_checks), which on multisite means super admins, as in core. It never returns the admin email, database details or the plugin list. Core's owncore/get-site-inforeturns the admin email, so it joins the workspace'sNEVER_ADMITTEDlist next to the environment and settings readers.ai/find-admin-screensmatches a request against a curated map of 33 core admin screens on the server, using titles and keywords. There's no model call inside it. It returns up to five screens, best match first, and only screens the current user can open, asadmin_url()links on the site's own host.wpai_admin_screensfilter. A filtered entry whose path has a scheme, a leading slash or..is dropped.Both are plain read abilities. Any logged-in user can call them, they're annotated read-only and not open-world, and they're listed over MCP like the content reads. Both join the workspace's curated tool list, because policy admission is off by default.
#1250's palette ability, which makes a nested model call over the palette's own commands, stays separate. It comes with the Command Palette PR.
Site-info field choices are ported from #1214's
Read_Site, credited to @Vrishabhsk with Co-authored-by.Use of AI Tools
AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: planning, implementing the changes and tests, and code review.
I've reviewed the changes, understand them and can explain them under review. They have all been tested locally.
Testing Instructions
ai/get-site-infothrough the Abilities Explorer or REST. The response has no version fields.Tests run (all passing):
Get_Site_InfoTest:test_administrator_gets_every_field_including_versions,test_editor_gets_the_fields_without_versions,test_manage_options_without_site_health_access_gets_no_versions,test_no_response_carries_admin_email_siteurl_database_or_plugins,test_executes_without_any_input,test_name_and_tagline_are_decoded,test_timezone_falls_back_to_the_utc_offset,test_logged_out_visitor_is_refused,test_output_schema_marks_the_versions_optional,test_registration_has_a_category_and_read_only_annotations,test_declared_to_the_model_for_administrator_and_editor_with_admission_offandtest_listed_for_mcp.Find_Admin_ScreensTest:test_hiding_the_site_from_google_finds_reading_settings_first,test_stopping_spam_comments_finds_discussion_settings_first,test_changing_the_timezone_finds_general_settings_first,test_singular_and_plural_settings_match_alike,test_returns_at_most_five_screensandtest_stopword_only_query_returns_an_empty_list.test_editor_asking_for_plugins_gets_no_plugins_or_settings_screen,test_filter_added_screen_appears_only_for_users_with_its_capability,test_filter_can_remove_a_core_screenandtest_every_url_is_on_the_admin_host.test_block_theme_offers_the_site_editor_not_the_customizer,test_classic_theme_offers_the_customizer_not_the_site_editorandtest_stem_is_idempotent_for_every_word_in_the_map.test_logged_out_visitor_is_refused,test_registration_has_a_category_and_read_only_annotations,test_declared_to_the_model_for_administrator_and_editor_with_admission_offandtest_listed_for_mcp.Tool_PolicyTest:test_core_get_site_info_is_withheld_with_perfect_annotations. It failed beforecore/get-site-infowas added toNEVER_ADMITTED.tests/e2e/specs/experiments/ai-workspace*specs, 126 passed. That includes the newai-workspace-navigate.spec.ts: asking where to change the timezone links Settings → General, and the link opens it.Code review: six reviewers ran: correctness, security, adversarial, testing, maintainability and agent-native. The orchestrator then reproduced each finding on a test site, instead of running the skill's separate validator. Four reviewers found nothing. The confirmed findings are fixed in 21cf902:
Known limits
wpai_admin_screensis trusted to name the capability its screen needs. A weaker capability gives users a link they can't open. It never gives a link off the site's host.Find_Admin_ScreensTest.Screenshots
Asking where to change the timezone links Settings → General
Changelog Entry
Post-deploy monitoring: no additional operational monitoring is required. This is an experiment behind the AI Workspace toggle, off by default, and it adds read-only abilities.
🤖 Generated with Claude Code