Skip to content

Connector validity check assumes text generation, so speech-only and image-only connectors report as invalid #933

Closed

Description

@whyisjake

Description

has_valid_ai_credentials() decides whether any configured connector is valid by asking a single question: can it generate text? A site whose only connector is a speech or image provider is therefore told its connectors may be invalid, when they are correctly configured and working.

The notice shown is:

The AI plugin requires a valid AI Connector to function properly. Please review the AI Connectors you have configured to ensure they are valid.

That reads as "your connector is broken." The connector is fine; it simply does not do text.

Expected: the plugin explains that its features need a text-generation connector, and that the configured connector does not provide one.

Actual: a red error notice asking the user to review their connectors "to ensure they are valid."

Note the UI already distinguishes two cases — "no connectors configured" versus "configured but not valid" — and a non-text connector lands in the second. So the connector is detected correctly; it is the verdict and the wording that mismatch.

Step-by-step reproduction instructions

  1. Install WordPress 7.0.4 and the AI plugin 1.2.0, with no AI connector configured.
  2. Activate a connector plugin that registers a non-text capability only, and give it a working API key. I used an ElevenLabs provider registering TEXT_TO_SPEECH_CONVERSION and SPEECH_GENERATION.
  3. Confirm in Settings → Connectors that the connector shows as Connected.
  4. Visit the AI plugin settings screen.

The red "ensure they are valid" notice appears.

Screenshots, screen recording, code snippet

Run against the environment above, with the connector configured and authenticated:

$p = wp_ai_client_prompt( 'Test' );
var_dump( $p->is_supported_for_text_generation() );            // false
var_dump( $p->is_supported_for_text_to_speech_conversion() );  // true
var_dump( WordPress\AI\has_valid_ai_credentials() );           // false

The connector is registered, authenticated, and usable for the capability it advertises. Only the text-generation question fails.

The verdict comes from includes/helpers.php, in has_valid_ai_credentials() (line 617 on develop at the time of writing):

// See if we have credentials that give us access to generate text.
try {
    return wp_ai_client_prompt( 'Test' )->is_supported_for_text_generation();
} catch ( Throwable $t ) {
    return false;
}

That result reaches the settings screen as PAGE_DATA.hasValidCredentials.

Why this may be worth separating

Most current features — alt text, summarisation, classification, comment moderation — genuinely do need text generation, so gating them is right. The issue is that a capability-specific requirement is reported as a global validity judgement.

This will affect more sites over time. The AI Client SDK defines capabilities for text-to-speech, speech generation, image generation, video generation, and embeddings, and connectors implementing the non-text ones are starting to appear. Any such connector, alone on a site, produces this notice.

There is precedent in this repository for a finer-grained approach: PR #679 ("Gate image generation UI on provider support detection") gates the image generation UI on whether a provider actually supports it, and PR #748 refined that detection. The global credentials check has not yet picked up the same capability awareness.

Possible directions, not prescriptive:

  1. Keep has_valid_ai_credentials() as the "can this plugin do its text-based work" gate, but reword the notice to name the missing capability, e.g. "These features need a connector that generates text. Your configured connectors provide speech only."
  2. Split the check: a connector is valid if it authenticates and registers any capability; sufficient for a feature is then decided per feature, the way image generation already is.
  3. Report per-capability status on the settings screen, so a site can see that speech is available even while text is not.

Happy to work on a PR if there is a preferred direction.

Environment info

  • WordPress 7.0.4
  • AI plugin 1.2.0. The same code is present on develop, so this is not specific to the released version.
  • PHP AI Client 1.3.1 (bundled in core)
  • Connector under test: a third-party ElevenLabs provider, v0.3.0
  • Environment: wp-env, block theme (Twenty Twenty-Five), Chrome on macOS

Confirmations


AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5). Used for: reproducing the behaviour in a local wp-env environment, tracing it to has_valid_ai_credentials(), searching for duplicates, and drafting this report. The reproduction commands above were executed and their output is quoted verbatim.

Activity

  1. added theissue type on Aug 13, 2026
  2. moved this from Triage to To do in WordPress AI Roadmapon Aug 13, 2026
  3. added this to the 1.4.0 milestone on Aug 13, 2026
  4. self-assigned this
    on Aug 13, 2026
  5. moved this from To do to In progress in WordPress AI Roadmapon Aug 13, 2026
  6. moved this from In progress to Needs review in WordPress AI Roadmapon Aug 19, 2026
  7. modified the milestones: 1.4.0, Future Release on Sep 11, 2026
  8. modified the milestones: Future Release, 1.5.0 on Oct 22, 2026
  9. moved this from Needs review to Done in WordPress AI Roadmapon Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions