Repository navigation
Conversation
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1004 +/- ##
=============================================
+ Coverage 85.49% 86.82% +1.32%
- Complexity 4807 6335 +1528
=============================================
Files 188 226 +38
Lines 17734 22915 +5181
=============================================
+ Hits 15161 19895 +4734
- Misses 2573 3020 +447
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:
|
|
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:
|
|
@whyisjake we'll likely want the streaming PR in the PHP AI client into a tagged release there as a precursor to this PR (and perhaps something in the Requests library as well?), so if you could help on those upstream effort(s) and then come back to this PR that'll help keep things unblocked. |
|
Thanks @jeffpaul, agreed on the sequencing. WordPress/php-ai-client#255 is rebased and mergeable and is waiting on @JasonTheAdams's review. The streaming subset vendored here is byte-identical to the current head of that PR, apart from the core-prefixed PSR imports, and the AI Workspace test suites run it under core's prefixed environment. I'll post that as a consumer review there and weigh in on the two open design questions (the opt-in streaming interface, and aborting a stream mid-way). On Requests: WP's HTTP API buffers the whole body, so this branch opens the stream with This stays a draft until WordPress/php-ai-client#255 is in a tagged release, then I'll re-vendor from trunk. |
…reen Adds a full-screen, capability-gated admin screen behind its own experiment toggle. The screen renders an app shell only; conversation behaviour, REST routes, and streaming land in later units. The capability check is layered rather than single-point: the menu entry, the asset enqueue, and the render callback each gate on manage_options, so a direct call to the render callback cannot emit the app shell or its localized data to a user without the capability. Advances R1, R2, R3, R4 (U1). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
Registers ai/search-content, a bounded full-text search over the post types exposed to the Abilities API. core/read-content is exact-match only and is kept byte-similar to core's copy, so this lands as a sibling rather than a change to it. Results are filtered at execute time against the requesting user's read permission, mirroring core/read-content's permission walk including the inherited-parent chain, so every ability consumer inherits the same filtering rather than relying on the query alone. The permission callback can only gate coarsely; the row filter is the authoritative check. Two query behaviours worth noting. per_page is capped at 20 in the schema and clamped again in the callback, so the cap holds on transports that skip schema validation. perm => 'readable' is passed only for a single-post-type query: WP_Query resolves a multi-type query to the placeholder capability read_private_multiple_post_types, which no role holds, silently hiding private posts from users who can read them. Registered from the workspace experiment rather than the Custom Abilities gated collection, so the workspace always has its search tool and every other ability consumer can still reach it. Advances R12, R13 (U2). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
…overlay Adds an independently-gated `streaming` feature to SDK_Overlay, alongside `embeddings`, so environments whose bundled PHP AI Client predates streaming get the streaming types from a vendored copy. A spike established what the plan had wrong. WordPress core bundles the SDK without its vendor directory, so upstream PR #255's Guzzle-based streaming transport does not apply here; core supplies its own transporter over wp_safe_remote_request. Only the SDK-level types are useful, and a WordPress streaming transporter is required regardless of whether that PR merges. Vendored files are NOT verbatim, unlike the embeddings feature. Core prefixes its PSR and Nyholm dependencies under WordPress\AiClientDependencies, so every such import is rewritten; the unprefixed names do not resolve under a WordPress bootstrap. The README records the rewrite table. PromptBuilder and AiClient are deliberately excluded. PromptBuilder is 45KB of trunk-era code and the largest drift risk against the bundled 0.3.1, and the method it adds only validates, resolves the model, and delegates. Two further candidates were trimmed as unreferenced by the kept set. The sentinel is StreamedGenerativeAiResult rather than the streaming model interface: resolve() probes with class_exists(), which returns false for interfaces, so an interface sentinel would activate the feature even where the environment already ships streaming. A new test enforces that for every feature. Streaming is not yet reachable end to end: the transport and an Anthropic model implementing the streaming interface are still missing (U12). Adds U11 (new; the plan has no unit for this work). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
Makes streaming reachable in PHP. A Streaming_Http_Transporter decorates the configured transporter: non-streaming calls delegate unchanged, and a streaming request is opened through fopen() with a stream context so the body is pulled lazily and wrapped as a PSR-7 stream the SDK's SSE parser reads unmodified. Because this path bypasses wp_safe_remote_request(), it also bypasses connector approval and request logging, so both are restored explicitly. Approval mirrors Http_Guard step for step -- same Connector_Key_Index lookup, same Caller_Identifier, same Approvals_Store check, same pending-approval record -- and runs before the opener is touched. A test asserts zero calls to the opener, which is the only egress point, so "before egress" is proven rather than implied. Logging wraps the whole body in a finally, so a refused request is logged as an error too. Two honest limits are documented on the class: a streamed entry records time-to-headers, not time-to-last-byte, and carries no token counts, because those arrive inside a body that has not been read yet. The same bypass loses that function's SSRF protection, so wp_http_validate_url() is applied before connecting and CRLF is stripped from header names and values. Anthropic's stream is mapped in its own class. Its SSE uses named events rather than a single delta shape, which is why upstream PR #255 does not cover it, and tool arguments arrive as input_json_delta fragments that must be concatenated across deltas before parsing -- parsing a fragment early yields plausible but wrong arguments. Interleaved fragments from concurrent tool calls are covered. The transporter is deliberately not installed globally and nothing constructs the streaming model in production code; ordering against Logging_Http_Transporter in the registry belongs to the turn endpoint that will drive it. phpstan.neon.dist excludes the two classes that implement or extend SDK and provider symbols PHPStan cannot resolve. Verified necessary: without it the run reports 15 errors that PHPStan itself marks unignorable. This follows the existing precedent for Logging_Http_Transporter; the mapper, opener and interface stay fully analysed. Adds U12 (new; the plan has no unit for this work). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
The spike in U3 contradicted three assumptions KTD3 rested on, and its outcome added two units the plan did not contain. Brings the artifact back in line with the code so U4 is planned against what exists. - KTD3 records the corrected findings: upstream PR #255 streams via Guzzle, which core does not bundle, so a WordPress-side transport is needed either way; vendoring cannot be verbatim because core prefixes its PSR dependencies; and the guards are restorable by construction through the public transporter seam rather than bypassed. - U3 is marked complete with its outcome; U11 and U12 are added. - U2's file list pointed at the gated-abilities collection, which accepts only gated base classes and runs only when a different experiment is enabled. - U4's approach corrected on three counts found by review and confirmed in the code: the batch resolver call offers no per-call seam for provenance or logging; a null-input permission call cannot filter tools because this repo's content callbacks are input-dependent; and cancellation cannot rely on abort detection on a buffered turn. - Stop conditions and the streaming open question updated: a host that cannot stream now degrades to a buffered request instead of blocking the plan. Also adds the Anthropic provider to the wp-env configs, since Claude is the chosen provider and the environment previously loaded only Google and OpenAI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
…l loop Runs a bounded, permission-filtered, logged tool-calling conversation behind POST ai/v1/workspace/messages, with a companion cancel route. Both gate on capability independently of nonce validation. Tool selection uses a coarse, input-free capability predicate. Filtering with a null-input permission check does not work here: this repository's content permission callbacks are input-dependent and return false without a post id or slug, so that filter would deny every tool to every user including administrators. Object-level authorization stays at execute time, where WP_Ability::execute() runs the ability's own callback. The loop iterates the assistant message's function-call parts and invokes the resolver's single-call execute_ability() per call. The batch form runs every call internally and exposes no hooks, leaving no seam for the provenance envelope or for one log row per invocation. Tool results are wrapped as provenance-tagged data before returning to the model, and every invocation writes exactly one log row -- allowed, denied, and failed alike. Denials are distinguishable from failures on the indexed status column without decoding context, and context.surface discriminates workspace rows from MCP rows sharing the same ability name. Cancellation is out of band: a separate route sets a marker the loop re-reads between rounds. Client-abort detection cannot serve here because PHP observes a disconnect only after writing output, which a buffered turn never does and the strict no-output test setting forbids. The marker is written by a different request, so the read drops its cache entries first -- otherwise the loop would answer from the value cached at request start and never observe a cancel. Conversation state lives in user-scoped transients: session-lifetime, regenerable, and expiring, which matters because it accumulates retrieved private and draft post bodies. Ownership is enforced twice -- the key is derived from the user id, and the stored owner is compared again on load -- so a second user holding the same capability cannot read another's conversation. A miss is a 404 rather than a silently-new conversation. Streaming is driven through U12's transport behind a seam, and every reference to the provider-dependent model is isolated so nothing autoloads where the Anthropic plugin is absent. A transport that cannot stream on this host falls back to a buffered request rather than failing. phpstan.neon.dist excludes one small driver file whose provider parent is unresolvable; the errors are non-ignorable and the surface was deliberately isolated so the rest of the loop stays fully analysed. Advances R6, R7, R8, R9, R10, R13, R18, R20, R21 (U4). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
…mission Builds the conversational surface: transcript with tool steps, prompt input with send/stop/clear, the two context scopes, and the streaming client. Server side, Stream_Responder consumes the filter seam the turn endpoint left and emits SSE frames. Model output is rendered by a restricted-subset markdown renderer rather than a parser plus sanitizer. The renderer emits a node tree, never an HTML string, and the components map nodes to elements, so dangerouslySetInnerHTML appears nowhere in the unit. Dangerous constructs are impossible to emit rather than stripped after parsing. Links get the same treatment as images, which the plan understated. Blocking images alone leaves the exfiltration path half open: a model steered by injected post content can emit a link whose destination carries retrieved private content in its query string, behind anchor text that reads as a legitimate next step. A link is live only when it resolves to http or https on this host; everything else renders as text with its destination visible. Images are inert including reference-style syntax, which is not implemented at all. Streaming asks for SSE and branches on the response content type, so a host that cannot stream renders the identical turn arriving at once with a quiet line saying so -- not an error state. Headers are sent lazily on the first delta, so a turn that never streams falls through to the ordinary JSON body. Accessibility replaces the plan's loose wording: one polite visually-hidden live region updated at sentence and paragraph boundaries and on completion, with the transcript itself no longer aria-live. Announcing every chunk was the failure mode that wording invited. Retry resends the original prompt as a new turn rather than replacing the failed one. A turn that failed mid-stream may already have run tools, and replacing it in place would hide that it ran twice -- exactly the fact a person needs once writes exist. Only errors offer retry; round-cap and cancelled turns do not, because the model ended those, not the transport. ContextScope in the TypeScript types was 'site' | 'post-type' | 'selection', which matched neither R6 nor the endpoint's enum. Reconciled to 'site' | 'general'. Known gap, commented at the call site: on the first turn of a new conversation the client does not yet know the server-minted conversation id, so Stop closes the reader locally while that round finishes server-side. Later turns cancel properly. Closing it needs the turn endpoint to publish the id early. Advances R2, R6, R8, R9, R11, R19 (U5). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
…the transcript Closes a gap the transcript could not work around: the turn route returned only tool invocation records, never the results, so no post list could reach the client at all. Each tool_calls entry now carries the ability's own return value on success, and null on a denial -- a refusal is not a result. The passthrough is deliberately narrow. Nothing is re-fetched, joined, or enriched, because re-fetching post data client-side would bypass the execute-time permission filtering the whole read path rests on. A test asserts the value the client receives is identical to direct ability execution for the same user and input, so the response cannot leak more than the tool did. The client then treats it as unknown and rebuilds each row from the fields the search ability declares, so a future ability with a wider payload cannot push unexpected fields into the table. The table is chrome-free by construction rather than by configuration: composing DataViews with an explicit Layout child means search, filters, view config and pagination are never mounted, since the component renders its default UI only when given no children. Per-field flags and controlled view state back that up. The plan's instruction to copy the DataViews stylesheet in webpack was unnecessary -- the copy plugin already emits it once to a fixed path outside the entry map -- so the config is untouched and the page enqueues the existing file conditionally, mirroring the request-logs page. R14 is only half-met by this unit: rows link to the post, not to its editor. The search ability returns no edit URL and nothing client-side may invent one, so the edit action is gated on a row-supplied URL and is currently never rendered. Completing it belongs on the ability that already owns the permission walk. Advances R14 (U6). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
Completes R14. The transcript table already had an edit action gated on a row-supplied URL, but no ability emitted one, so the action never rendered and rows linked only to the published post. The URL doubles as the permission proof: it is present only when the current user can edit the post, so a consumer does not re-derive the capability and cannot construct an editor URL for a post it may only read. That also avoids guessing wp-admin/post.php, which breaks on non-standard admin paths. The explicit capability check is deliberate redundancy, and the docblock says so: get_edit_post_link() already returns nothing for a user who cannot edit, and a mutation run with the gate removed left the new tests green. The gate stays because the emptiness of this field is a permission guarantee consumers rely on, and that guarantee should not rest on the internals of a core function that is free to change. The tests lock the contract rather than the mechanism. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
…ally work Two bugs found by running the workspace against a real provider rather than against tests. Both were invisible because each degraded politely instead of failing. OptionEnum::FUNCTION_DECLARATIONS is not a constant. That call threw an undefined-constant Error, a catch-everything swallowed it, and the screen therefore always reported "no compatible model available" -- even though all eleven Anthropic models advertise function calling. The enum extends AbstractEnum, so the member is reached with isFunctionDeclarations(). The catch is now narrower in effect: an Error is re-thrown rather than swallowed, so a programming mistake in that method surfaces instead of presenting as a permanent, plausible-looking capability gap. An unreachable provider still degrades quietly, which is the case the catch is for. Throwable is still the caught type because the project's coding standard requires it over Exception. The streaming driver called GenerativeAiResultChunk::toText(), which does not exist -- the method is getDeltaText(). The Throwable guard turned that into "this host cannot stream", so every turn silently fell back to a buffered request and the UI truthfully reported a condition that was not true. Verified end to end afterwards: a turn now streams, and the fallback notice is gone. Only the visible delta text is emitted; getReasoningDeltaText() carries the model's thinking, which is not the reply. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
…hinking signatures Two defects found by running a two-turn conversation against the real provider. The model was whichever candidate the registry happened to return first, which on a live site resolved to the most capable and most expensive model available -- selected by array position, not intent. Selection now consults an ordered preference, filterable per site, and falls through cleanly when a preferred model is absent. That accidental choice also exposed the second defect. Always-on-thinking models return thinking blocks, and Anthropic rejects a replayed thinking block whose signature is missing, so the second turn of any conversation failed with "messages.1.content.0.thinking.signature: Field required". The signature arrives as its own signature_delta after the block's thinking text, so the mapper now records which block indices opened as thinking and carries the signature onto the part it belongs to, matched by index rather than arrival order. The storage round trip was never at fault: the SDK's MessagePart already carries a thought signature and Message::fromArray()/toArray() preserve it. The loss was ours, in the mapper, on the streaming path only -- which is why no test saw it and why it took a live second turn to surface. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
The model can propose drafts; only a person's confirmation writes them. The proposal is persisted server-side and the confirmation renders the stored resolved values, never the model's summary of them -- that summary is attacker-influenceable, which is the reason the requirement exists. There is no registered write ability. The plan called for one kept off the MCP surface, but that is an intention without a mechanism: a registered ability is reachable by the MCP surface, the Abilities Explorer, and any third-party caller, none of which have a confirm gate. Instead the writer is a plain class reachable only from the proposal controller, so the confirm gate is a structural property of the write path rather than a validation rule someone can route around. The model's only reach is a propose ability that writes nothing, is hidden from REST and MCP, and refuses outside an active turn context. Ownership is bound, not merely capability-checked. Capability is not identity: without this, a second user holding the same capability could execute another's proposal by id, and the values they approved on screen would not be the ones written. The store derives its key from the owner, compares the stored owner again on read, and compares the conversation at execution -- three checks independent of the capability re-check at write time. Verified by mutation: with the key no longer user-scoped, the stored-owner comparison still refuses a peer, so both layers hold on their own. Set approval is bounded. Proposals cap at twenty items, matching the search tool's row bound, and items start deselected so an item appended by injected content must be chosen deliberately rather than ridden in on a batch approval. A status the user cannot publish to fails the proposal instead of being downgraded silently. Partial failure is reported per item to both the person and the model, with no auto-retry, and re-executing a confirmed proposal creates nothing. Every write attempt is logged in the shape the tool-call rows already use, so writes and reads join on one conversation. Advances R15, R16, R17, R20 (U7). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
An Options-menu action in the post editor opens the workspace with the current post in scope. It carries identity only -- post ID, status, type, title -- and never the body: the workspace reads content through the permission-checked tool path, so there is one enforcement path and nothing trusts a client-supplied body. A test asserts a marker in the post content never reaches the localized data. The seed is re-resolved server-side from the query argument and checked with read_post, so the URL cannot hand someone a post they may not read; a refusal renders an explanation rather than content. A post title is author-controlled text, so it is flattened to single spaces and clamped before it leaves PHP -- a title cannot smuggle a multi-line instruction block -- and it reaches the model only inside a message the person has seen and can edit. The composer is prefilled, never auto-sent. The residual surface is a person who sends a prefilled prompt without reading it; that is bounded to one clamped line with a human in the loop, and removing it entirely would mean not naming the post at all, which the available tools make useless. Mounted as a post-level Options-menu item rather than the block toolbar the plan named. This is a navigation action for the whole post: a block toolbar entry would either repeat on every block or be arbitrarily scoped to one block type the way content resizing is. The repository already has post-level plugin precedent. The webpack entry is part of this change. That build declares every bundle explicitly, and the asset loader bails silently on a missing asset file, so without the entry the action would never appear and nothing would report why. R5 is only half met and should not be read as complete: the handoff carries identity, but no read-full-body tool is in the workspace allowlist, so the assistant can find the post and see its excerpt while the body stays out of reach. Widening the allowlist is a security-relevant scope decision and was deliberately left alone. Advances R5, R18 (U8). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
…t chats (#1301) Stacked on #1299. Part of the follow-up on [jeffpaul's review](#1004 (comment)), item 9: "new topic, then find the old one again". #1299 keeps chats and adds their routes; this adds the panel that uses them. ## What changed **A Chats panel.** - It lists the person's own chats, most recent activity first, under the names #1299 gives them. - **New space** starts afresh without deleting the chat on screen. It replaces the header's "New topic", which the header now uses for a **Chats** toggle. - Each row opens its chat. Its menu has: - **Rename**, inline. Enter saves, Escape cancels, and leaving the name empty keeps the old one. - **Archive**, or **Restore** for an archived chat. - **Delete**, after a confirmation. - An **Archived** toggle switches the list to archived chats. - Panel states: - "No chats yet." (or "No archived chats."); - a loading state; - an inline error with **Retry** when the list fails; - a dismissible notice when a rename, archive or delete fails. - Every change goes to the server first, and the list changes only once the server agrees. **Layout.** - At wide widths the panel is a sidebar, collapsed and expanded by the header's **Chats** button. - At 782px and below, wp-admin's mobile breakpoint, it's a drawer over the conversation. - Opening it moves focus to **New space**. - Escape closes it and returns focus to the toggle. - Choosing a chat closes it. - Crossing the breakpoint resets the panel to that width's default: open on wide, closed on narrow. **Opening a chat.** - The transcript is rebuilt from the chat's stored turn records (KTD7), never from the model messages. - A proposal whose approval was reported into the chat shows that stored outcome, links and all, with nothing fetched. - A proposal that wasn't executed is fetched as it is today. The server's 30-minute proposal expiry decides whether it's still approvable, and an expired one says it's no longer available. - A reload reopens the chat, which is kept in the URL as `&chat=<id>`. A chat that isn't there, or isn't the reader's, says "That chat was not found." and starts a new one. - The history list refreshes when a turn finishes, so a new chat appears, or an active one moves to the top, without a reload. **Switching chats mid-turn.** - The request in flight is aborted, so nothing more of that turn reaches the screen. - A turn whose chat the server already knows is cancelled there too. It stops between rounds and is recorded in its own chat as a stopped turn. - A first turn has no chat yet to cancel. It finishes server-side and shows up in the list as a new chat. **Server: links for reopened outcomes.** - The approval outcome a chat stores names each post by ID but carries no link. - The single-chat route now adds each written post's current `post_type`, `status` and `edit_link`. - The link is given only when the reader may edit the post, which is what `get_edit_post_link()` checks. - A post that has since been deleted gets an empty link. ## Since the stack merged This branch now sits on `feat/ai-workspace` with #1254 through #1300 merged in (008dbb0). Combining the two needed these changes beyond the merge itself: - **A reopened chat keeps a turn that ended on a proposal or a question.** Turns that end in `awaiting_user` (#1254) were shown as errors on reopening, because the stored-status list predated that status. A follow-up turn's record is also marked now, so it reopens with no empty prompt bubble. - **A follow-up belongs to its chat.** A proposal card whose approval settles after you open another chat, or start a new one, no longer starts a follow-up in the chat on screen. It's also skipped while a chat loads. - **"New space" lives in the Chats panel only.** #1239 hid the header's "New space" until a conversation existed. Here the header button is replaced by the Chats toggle, and the panel keeps its own "New space", including on an empty workspace, where it does nothing harmful. **Open question for review:** should the panel button follow #1239's rule and appear only once there is a conversation? That would change the drawer's focus target, so I left it as designed. - Tests updated for the merge: #1239's checks look at the header only, the history spec uses #1294's card and link names, and the starter-prompt clicks in #1300's spec are scoped to the empty state, since saved chats with the same names now appear in the panel. - New unit test in `ai-workspace-chat.spec.ts`: "keeps a turn that ended on a proposal or a question, and marks a follow-up". After the merge: all PHPUnit tests (3205) and all `tests/e2e/specs/experiments/ai-workspace*` specs (101, Chromium) pass locally. ## Screenshots With the e2e provider mock. "New topic" became the panel's **New space**. (Renamed from "New chat" in 458371d, following the review of #1239; a chat with no first message is still named "New chat".) | Before | After | | --- | --- | |  |  | At 390px wide the panel is a drawer over the conversation:  ## Choices the plan left open These are how this PR behaves today; each is easy to change in review. 1. **A pending proposal in a reopened chat stays approvable** while the server still holds it, rather than always showing as expired, as the plan put it. The 30-minute proposal expiry still applies, so an old one says it's no longer available. 2. **The list shows the 50 most recent chats**, with no "load more". The route caps a page at 50. 3. **Archived chats can't be renamed** from their menu; restore one first. 4. **Deleting the chat on screen** starts a new chat. **Archiving it** leaves it on screen. 5. **A stored turn that failed** shows the generic failure message with Retry. The stored error code isn't shown. 6. **Crossing the 782px breakpoint** resets the panel to that width's default. Two parts of the plan's U12 depend on units that aren't in this base, and are left for when those land: - **`ai/ask-user` cards in a reopened chat:** U6, #1288. A stale card's choices should be disabled. - **Skipping a pending follow-up when switching:** U5, #1254. ## Tests PHPUnit, `Conversation_ControllerTest`: - New: "test_write_results_link_to_the_posts_they_wrote". A draft gets its type, status and edit link, and a deleted post gets no link. - New: "test_write_results_hide_links_and_ignore_model_text". A reader who can't edit the post gets no link, and a model reply shaped like an outcome isn't returned as one. Playwright, new `ai-workspace-history.spec.ts` (11 tests): - "shows the empty state when there are no chats" - "starts a new chat, then finds the old one and carries on in it": two turns, then New space, then the old chat from the list, then its transcript, then a further message continues the same chat, then a reload reopens it from the URL. - "renames a chat, and the name survives a reload": includes the empty-name case. - "archives, shows and restores a chat" - "deletes a chat only once confirmed": Cancel leaves it. Deleting the chat on screen starts a new one. - "a chat that is not there says so" - "a chat that fails to load stays in the address": the chat's route is aborted on reload; the notice shows and `&chat=` stays. - "nothing can be sent while a chat is still loading": the chat's route is held; the composer is disabled until it answers. - "leaving a chat mid-turn cancels the turn and keeps its reply out": the second turn's request is held, New space is clicked, a cancel request is sent, and nothing of the turn appears once it would have answered. - "opens and closes as a drawer by keyboard on a narrow screen": 390px wide, with Enter, focus moving in, Escape, and focus returning to the toggle. - "a reopened chat shows the drafts it created, with their links": the stored outcome and its "Open in the editor" link, with no checkbox. Playwright, new `ai-workspace-chat.spec.ts` (5 unit tests, no browser): - listing chats; - rebuilding a turn from its stored record and ignoring model messages; - showing an unknown stored status as an error; - keying outcomes by proposal; - reading and writing `&chat=` in the URL. Playwright, `ai-workspace.spec.js`: "streams a turn into the transcript and clears it" and "reaches the scope control, the input and the turn controls by keyboard" now use **New space**. What failed before the change: - On #1299's code, all 8 of the first history tests fail. - On a395f65 (the first commit), "a chat that fails to load stays in the address", "nothing can be sent while a chat is still loading" and "test_write_results_hide_links_and_ignore_model_text" fail. "leaving a chat mid-turn…" passes there too: it covers the guard the first commit already had. - The unit spec can't load, because `utils/chat.ts` doesn't exist. - "test_write_results_link_to_the_posts_they_wrote" errors, because there are no `post_type`, `status` or `edit_link` keys. Also run, on WordPress 7.1.4, on c5bfd98: - **Full PHPUnit suite:** 3101 tests passed, 57 skipped. - **e2e:** every `ai-workspace*` spec, 57 passed (Chromium). - **PHPStan:** no errors. - `npm run typecheck`, `npm run build` and `wp-scripts lint-js` on the workspace sources and specs: clean. - **phpcs:** clean on `Conversation_Controller.php`. `Conversation_ControllerTest` has the same count as the base, which is none. Not covered: - **Opening chat A then chat B quickly** (the load that loses) has no test. - **Escape in the rename field** isn't tested. Whether a browser fires blur on the input as it unmounts, which would save the cancelled name, wasn't checked. - **The failure notices** for rename, archive and delete, and the list's Retry, have no test. - **Multisite** wasn't run. ## Code review ce-code-review ran at full depth on a395f65, run `20261105-144300-53ec7b11`. - **Reviewers:** correctness, security, adversarial, testing, maintainability, API contract and frontend races. - **Not run:** the cross-model pass, because no other provider's CLI is installed, so the adversarial lens ran in-process. There are no project standards files on this branch. - **Verdict:** "Ready with fixes". The validator confirmed five findings, all fixed in c5bfd98: - **P2** (found by three reviewers independently): a message sent while a chat was loading landed after the new chat appeared and bound the screen back to the chat it ran in. Sending is now blocked, and the composer inert, until the load settles. - **P2:** switching chats mid-turn had no test. It now does, with the turn's request held. - **P3:** a turn left mid-way skipped the list refresh, so a first turn that finished on the server didn't appear. - **P3:** reloading a chat's address removed `&chat=` before the load settled, so a failed load lost it. - **P3:** a new helper sat between `not_found()` and its docblock. - **Also fixed in c5bfd98, from the review's residual risks:** - Only user messages are read for approval outcomes, so a model reply shaped like one isn't shown as one. - An outcome item that wrote nothing keeps its stored type and status. - **Left as they are:** - The Escape-blur question above. - A delete that finishes after you've opened another chat can clear the new one; the window is narrow. - A list refresh can briefly show a stale name during a rename. - `utils/chat.ts` adds a fourth copy of the small record-reading helpers. - The 50-chat cap. AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: implementing the change and its tests, which I reviewed. I've reviewed the changes, understand them and can explain them under review. They have all been tested locally. 🤖 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-1301-6cc914bfcf88e3b3880865bcc7b92b43a067b4d3.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>
Developer - Update our test to use `prepare_input` instead of `coerce_input`. Co-authored-by: dkotter <dkotter@git.wordpress.org> (cherry picked from commit 6bc5600)
…or is usable With no AI Connector configured, the workspace showed a warning titled "No AI credentials configured" that linked to the AI settings screen. The settings screen shows the same problem as an error with its own wording and a link to the Connectors screen, where it is fixed. The workspace now uses that notice type, wording and Manage Connectors link. A connector with no function-calling model stays a warning, as on the settings screen, and links to Connectors too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves tests/e2e-testing/e2e-testing.php by keeping both sides: the Abilities Explorer fixtures and mocked-response helper from this branch, and the Markdown Feeds and Rank Math test hooks from develop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Item 11 is done in 3505baa. With no AI Connector configured, the workspace now shows the same error notice as the AI settings page ("The AI Workspace requires a valid AI Connector to function properly. Verify you have one or more AI Connectors configured.") with a "Manage Connectors" link to the Connectors screen. A connector with no function-calling model stays a warning, as on the settings page, and links to Connectors too. AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: the change and drafting this reply. I've reviewed the changes, understand them and can explain them under review. |
Let's go with that top level menu as "Workspace", the +New option as only "Workspace", and no need to handle the URL redirect as the experiment hasn't been released yet.
Fine to just open that as a follow-up issue for the 1.7.0 release.
Let's update the space the error message takes up to more closely match the slightly more condensed format on the AI settings screen. Current workspace:
Current settings page:
|
…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>
#1315) ## What? Related: #1287 The AI Workspace assistant can now answer questions about the site itself, and point people to the right admin screen: - **"What PHP version am I running?"** It reads the site's name, tagline, language, timezone, theme and, for admins, the WordPress and PHP versions. - **"Where do I hide my site from Google?"** It answers with a link to Settings → Reading. 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-info`** returns these fields, and no others: - the site name, tagline and home URL; - the language and timezone; - the date and time formats; - the active theme, and whether it's a block theme. 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 own `core/get-site-info` returns the admin email, so it joins the workspace's `NEVER_ADMITTED` list next to the environment and settings readers. **`ai/find-admin-screens`** matches 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, as `admin_url()` links on the site's own host. - Sites and plugins can add or remove entries with the new `wpai_admin_screens` filter. A filtered entry whose path has a scheme, a leading slash or `..` is dropped. - The Site Editor is offered only on block themes, and the Customizer only on classic ones. **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 1. Enable AI Workspace and connect a provider. 2. Ask "What PHP version am I running?". The assistant answers with your PHP version. 3. Ask "Where do I hide my site from Google?". The reply links Settings → Reading, and following the link opens it. 4. As an editor, call `ai/get-site-info` through the Abilities Explorer or REST. The response has no version fields. **Tests run** (all passing): - **PHPUnit, full suite:** 3325 tests on WordPress latest. - **`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_off` and `test_listed_for_mcp`. - **`Find_Admin_ScreensTest`:** - Queries: `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_screens` and `test_stopword_only_query_returns_an_empty_list`. - Access: `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_screen` and `test_every_url_is_on_the_admin_host`. - Themes and matching: `test_block_theme_offers_the_site_editor_not_the_customizer`, `test_classic_theme_offers_the_customizer_not_the_site_editor` and `test_stem_is_idempotent_for_every_word_in_the_map`. - Registration: `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_off` and `test_listed_for_mcp`. - **`Tool_PolicyTest`:** `test_core_get_site_info_is_withheld_with_perfect_annotations`. It failed before `core/get-site-info` was added to `NEVER_ADMITTED`. - **e2e (Chromium):** all `tests/e2e/specs/experiments/ai-workspace*` specs, 126 passed. That includes the new `ai-workspace-navigate.spec.ts`: asking where to change the timezone links Settings → General, and the link opens it. - **Test-first:** tests written before their change failed before it. - **Other checks:** PHPStan finds no errors, phpcs is clean on the changed plugin PHP, and the build passes. - **Not run yet:** a live check against a real provider. **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: - a call with no input failed; - the name and tagline came back HTML-escaped; - the versions were visible to sub-site admins on multisite; - the screen matcher missed singular words; - the theme branch had no test. ## Known limits - An entry a plugin adds through `wpai_admin_screens` is 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. - Keywords are English only. A query in another language matches only the translated screen titles. - The navigation e2e test's link comes from the mocked model reply, so it proves the tool round trip and the link working, while the ranking itself is covered by `Find_Admin_ScreensTest`. ## Screenshots **Asking where to change the timezone links Settings → General**  ## Changelog Entry > Added - AI Workspace can answer questions about the site (name, tagline, theme, and WordPress and PHP versions for admins) and link to the admin screen for a request. **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. --- [](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-1315-2113f328ff63bca3163299767db00d0699313222.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: Vrishabhsk <vrishabhsk@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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>
Jeff's review of #1004, items 4, 11, 12 and 13. 4. Workspace is a top-level menu now, with the chat icon, below Settings so it does not push Posts and Pages down for everyone who never opens it. It is labelled "Workspace" because the settings page already uses "AI". The admin bar's New menu gains a Workspace entry, which opens the screen with no space selected and so starts a new one. There is no redirect from the old Tools URL: the experiment has not shipped, so nothing links to it. Every link was already built by Admin_Page::url(), so moving that one method moved the editor handoff, the command palette and the rest with it. The tests were not so tidy: several reached the old page by handing visitAdminPage() 'tools.php' as its own argument, which a search for the old URL never finds, and get_plugin_page_hookname() had the same parent baked in. The reachability tests needed more than a new URL. add_submenu_page() refuses to register a page the user cannot open; add_menu_page() registers it anyway and leaves hiding it to the menu renderer. So "not registered for a subscriber" stopped being true, and "not in the Tools submenu" would have kept passing while proving nothing. The subscriber test now asserts the gate that actually holds: the entry needs a capability they lack, and the page callback is never hooked for them. 11. The no-connector notice is the same @wordpress/ui notice the AI settings screen uses, in the same 680px column, so the two places that send someone to the Connectors screen read alike. It was a full-width bar with no icon and a wide gap before the link. 12. "Chat" becomes "space" wherever a person reads it: the Spaces button and panel, the empty states, the default name for a new space, the error messages, and the personal-data export labels. Those last ones appear on WordPress's own export screen, outside the workspace, so they read "AI Workspace spaces" to make sense there. Internal names -- the post type, REST routes, the ?chat= parameter, component names -- stay as they are. 13. The composer placeholder ends with a full stop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L
|
Thanks Jeff — all of these are in e752260. 4. Workspace is a top-level menu with the chat icon. I put it just below Settings, which keeps it out of the way of Posts and Pages; easy to move if you had somewhere else in mind. + New → Workspace opens a fresh space. No redirect from the old Tools URL, as you said. 8. Opened #1402 for Add context, against 1.7.0. 11. The no-connector notice now uses the same Before: After: 12. I took this a bit further than the two you pointed at. Changing only those would have left "Loading chats…" and "No chats yet." in the same panel as "Spaces", and every new space would still have been named "New chat". So every string a person reads now says "space". Two calls worth checking: the personal-data export labels appear on WordPress's own Export Personal Data screen, outside the workspace, so they read "AI Workspace spaces" rather than just "spaces"; and internal names — the post type, REST routes, the 13. Done. |
jeffpaul
left a comment
There was a problem hiding this comment.
Awesome, thanks for all the iterations here @whyisjake! Over to you @dkotter for code review, good luck have fun 😬









Implements #282: a full-screen conversational admin screen where a site owner talks to an AI that can read their content — under their own capabilities, never above them.
What this adds
A new
ai-workspaceexperiment (Tools → AI Workspace,manage_options), built on the Abilities API and core's ability-backed tool loop:execute_ability()rather than the batch path, so every invocation — including denials — produces exactly one log row and a provenance envelope.ai/search-contentreturns titles and excerpts only;ai/read-content-bodiesreturns full bodies for at most five posts named by ID. Both filter row by row at execute time against the requesting user's own capabilities.Notes for review
Permission filtering is execute-time, not declaration-time. The coarse capability on a tool decides whether it is declared; which rows come back is decided per row, per user, on every call. Both matter, and the tests mutate each independently to prove neither is inert.
Withheld counts are measured, not derived — a deliberate divergence from the plan. The plan's U13 prescribed the opposite, specifying the withheld count as "the difference between the ability's total and its returned rows". Implementing it revealed that verification to be wrong, so it was not followed.
total - count(results)conflates pagination with permission filtering: page one of fifty matches would announce forty posts hidden by the person's role on an ordinary search.ai/search-contentcounts withholding as the permission walk drops rows from the page it builds.ai/read-content-bodiesdeliberately reports no count at all — it answers for IDs the caller named, so counting unknown and unreadable apart would say whether those exact posts exist.Tool surface is a hand-maintained allowlist of three abilities, which is deliberate for a first cut and is the subject of follow-up #1003 — every ability the model can call is also reachable by an instruction embedded in content someone else wrote.
Streaming is a follow-up (#1083)
Provider streaming depended on WordPress/php-ai-client#255, which is not merged or released, so this PR used to carry a vendored copy of that PR's streaming classes. It no longer does. Streaming now lives in #1083, stacked on this PR, as a single commit that reverts its removal. It can merge once #255 is released and re-vendored from that release.
What that means for this PR:
publicmeta flag from WordPress 7.1.embeddingsfiles already ondevelopunderincludes/Vendor/AiClient/are unchanged; the streaming overlay entry and its classes are gone.Testing
npm run test:php— 1,990 tests, 6,045 assertions, 42 skipped, 0 failures (on 68425d6).npm run test:e2e— all 38 AI Workspace e2e tests pass, against mocked providers with sequenced tool-calling turns. No network access.npm run lint:php(PHPCS, WordPress-VIP-Go + Slevomat) — clean.npm run lint:php:stan(PHPStan level 8) — no errors.npm run build,npm run typecheck,npm run lint:js— clean.Test suites executed by name, as the WordPress AI Guidelines require:
PHPUnit (
tests/Integration/) —AI_WorkspaceTest,Turn_ControllerTest,Tool_SelectorTest,Proposal_ControllerTest,Propose_DraftsTest,Prompt_Model_ClientTest,Search_ContentTest,Read_Content_BodiesTest,SDK_OverlayTest,UninstallTest.Playwright (
tests/e2e/specs/experiments/) —ai-workspace.spec.js,ai-workspace-tools.spec.ts,ai-workspace-post-results.spec.ts,ai-workspace-markdown.spec.ts,ai-workspace-handoff.spec.ts.Individual tests named in the mutation evidence below:
test_execute_callback_clamps_to_five_without_schema_validation,test_private_body_of_another_author_is_withheld_from_author,test_draft_body_of_another_author_is_withheld_from_lower_roles,test_unexposed_post_types_are_never_read,test_mixed_request_returns_only_readable_posts,test_retrieval_summary_never_counts_paginated_rows_as_withheld,test_pagination_alone_reports_nothing_withheld,test_withheld_counts_the_rows_the_permission_walk_dropped,test_vendored_files_use_the_prefixed_psr_dependencies.Security-relevant tests were verified by mutation rather than by passing alone. Forcing
Read_Content_Bodies::check_read_permission()open and removing its clamp fails five tests, including one asserting an unexposed post type's body sentinel appears nowhere in the encoded result. Replacing the withheld count with subtraction failstest_retrieval_summary_never_counts_paginated_rows_as_withheldandtest_pagination_alone_reports_nothing_withheld.Still open
Opening as a draft — the presentation layer is being worked separately, and three decisions are unresolved: the confirmation modal's default selection state, the full-screen gap (
is-fullscreen-modeis applied but@wordpress/interfaceCSS is never enqueued), and the editor handoff's placement in the Options menu.AI assistance: Yes. Tool(s): Claude Code (Opus 5). Used for: implementation of all units in the linked plan, test authoring including the mutation testing described above, and this description.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L