[wp-trac] [WordPress Trac] #64483: Core Abilities getting error when execution
WordPress Trac
noreply at wordpress.org
Mon Jan 19 12:22:31 UTC 2026
#64483: Core Abilities getting error when execution
-------------------------------------------------+-------------------------
Reporter: arkenon | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: AI | Version: 6.9
Severity: normal | Resolution:
Keywords: has-patch needs-testing needs-unit- | Focuses:
tests |
-------------------------------------------------+-------------------------
Changes (by justlevine):
* component: General => AI
Comment:
@hbhalodia thanks very much for the tag 🙇
> Now if we check for execute function, it has normalize_input and
validate_input. normalize_input just checks for the input is null or not,
if null or input_schema is empty, it returns null, but in our case it is
empty array, coming as input, so it checks only first condition that input
is not null, hence it return with empty array instead of null.
I'm looking for the prior discussion, but this was actually an intentional
design decision when folks decided to support `mixed` input and not just a
shaped array/object (as @hbhalodia noted, `input_schema` being optional is
also intentional).
The gate therefore intentionally differentiates between an ability
''intentionally called with no value'' (`$a->execute()`), but not a
falsey/potentially malformed one (e.g. $a->execute( 0 )` or `$a->execute(
[ ] )`.
Based on that I'd suggest '''against''' the change proposed
https://github.com/WordPress/wordpress-develop/pull/10755.
-----
Similarly per the above, the true source of the bug reported by @arkenon
in wp-ai-client - also as @hbhalodia noted. Assumedly
[https://github.com/WordPress/wp-ai-
client/blob/dacb6e8b73ff3097c41a256dfe26fb3d0cea9f48/includes/Builders/Helpers/Ability_Function_Resolver.php#L92
| Ability_Function_Resolver::execute_ability()] needs to be changed to
correctly differentiate between functions with no args and empty args.
(Unless the thing feeding `[]` to it is your orchestrator project. Cool
concept btw 🙌).
I'll flag the folks working on that plugin first, but assumedly we want to
close this ticket in favor of one over there (cc @jasontheadams)
-----
There's still the general DX friction that sourced this. As far as whether
we should give these `core/*` abilities an explicit schema (and/or the
ability to take any falsely value), could be a worthwhile discussion for
`enhancement`, but personally I'd be wary of doing that without minimally
making `input_schema` required and ideally banning `mixed` and require a
shape with explicit arg names. Which would be pretty sad since by starting
with mixed we now cant enforce this and only warn, but still probably
worthwhile.
(PS: Abilities probably needs its own component, or we need clearer
signposts that it's still being handled by the AI team. If @hbhalodia
didn't tag me none of us would have probably seen this until it merged).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64483#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list