Skip to content

Jetpack AI Sidebar: Fix failing block-update#110033

Open
kat3samsin wants to merge 1 commit intotrunkfrom
fix/jetpack-ai-show-component-ability-name
Open

Jetpack AI Sidebar: Fix failing block-update#110033
kat3samsin wants to merge 1 commit intotrunkfrom
fix/jetpack-ai-show-component-ability-name

Conversation

@kat3samsin
Copy link
Copy Markdown
Contributor

@kat3samsin kat3samsin commented Apr 17, 2026

Summary

Register the show-component ability under big-sky/show-component instead of big_sky__show_component. The WP Abilities API rejects underscores in ability names, which broke sidebar registration on self-hosted Jetpack sites:

Failed to create Frontend_Ability: big_sky__show_component
(Ability name must be a string containing a namespace prefix...)

big_sky__show_component is the normalized routing form (same pattern as wpcom/update-block-contentwpcom__update_block_content); registration must use the slash form.

Changes

  • Register under big-sky/show-component; keep big_sky__show_component as the envelope tool_id so AM routing and convert-tool-messages-to-components match unchanged.
  • isShowComponentTool accepts both forms.

Pre-flight

  • Accessibility
  • Type checks
  • Tests updated
  • Changelog

Testing

See WPCOM PR 212171

Registering the show-component ability with id/name
`big_sky__show_component` fails WP Abilities API validation:

  Failed to create Frontend_Ability: big_sky__show_component
  (error: Ability name must be a string containing a namespace prefix,
  i.e. "my-plugin/my-ability". It can only contain lowercase
  alphanumeric characters, dashes and the forward slash.)

Underscores are not valid in ability names. `big_sky__show_component`
is the normalized routing form (used by AM's tool routing and the
`convert-tool-messages-to-components` envelope match), not the
registration form. Same relationship as `wpcom/update-block-content` →
`wpcom__update_block_content`.

Register under `big-sky/show-component` (valid slash-form). Preserve
`big_sky__show_component` as the envelope `tool_id` since AM matches
that literal in `convert-tool-messages-to-components.ts` and the
orchestrator uses it in tool routing. `isShowComponentTool` now matches
both forms so `executeAbility` works whether AM calls with the raw or
normalized name.
@matticbot
Copy link
Copy Markdown
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • agents-manager
  • help-center

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/jetpack-ai-show-component-ability-name on your sandbox.

@kat3samsin kat3samsin changed the title Jetpack AI Sidebar: fix show-component ability name validation Jetpack AI Sidebar: Fix failing block-update Apr 17, 2026
@kat3samsin kat3samsin marked this pull request as ready for review April 17, 2026 20:28
@kat3samsin kat3samsin self-assigned this Apr 17, 2026
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants