Skip to content

WP Codebox provider plugin staging assumes directory-named entrypoints #2355

Description

@chubes4

Problem

A valid provider plugin checkout whose WordPress entrypoint is plugin.php cannot cross the WP Codebox agent-task adapter. The adapter and runtime reduce provider_plugin_paths to strings, derive slugs from directory names, and then require <slug>/<slug>.php before staging.

Current checkout:

/Users/chubes/Developer/ai-provider-for-openai@codex-oauth-provider/plugin.php

Generated recipe entries:

{
  "source": "/Users/chubes/Developer/ai-provider-for-openai@codex-oauth-provider",
  "slug": "ai-provider-for-openai-codex-oauth-provider",
  "pluginFile": "ai-provider-for-openai-codex-oauth-provider/ai-provider-for-openai-codex-oauth-provider.php"
}

A second generated entry uses slug ai-provider-for-openai and guesses ai-provider-for-openai/ai-provider-for-openai.php. Both are invalid; the real entrypoint is plugin.php.

The runner already has providerPluginEntryFile(), which detects a plugin header and falls back to plugin.php, but preparePluginDirectory() independently refuses to stage a source unless ${slug}.php exists. The typed entrypoint is then lost again when provider_plugin_paths is forwarded as strings.

Evidence

Expected contract

Provider plugin materialization preserves a detected or explicitly declared WordPress entrypoint as typed data from Homeboy Extensions through WP Codebox recipe generation. Directory names and branch/worktree suffixes are not treated as plugin entrypoints.

Acceptance criteria

  • Detect root plugin headers and plugin.php once, before source staging.
  • Stage valid plugin directories regardless of whether ${slug}.php exists.
  • Preserve { source, slug, pluginFile, loadAs, activate } through the provider plugin boundary.
  • Avoid emitting duplicate extra-plugin entries for the same source.
  • WP Codebox recipe validation receives the staged source and exact entrypoint.
  • Provider readiness rejects missing source paths or missing declared/detected entrypoints before a Cook consumes provider budget.
  • Add a fixture checkout named with a worktree suffix whose only entrypoint is plugin.php.

Upstream direction

If WP Codebox currently accepts only string provider_plugin_paths, add a typed provider-plugin contract upstream rather than synthesizing a duplicate slug-named PHP file in the adapter.

AI assistance

  • AI assistance: Yes
  • Tool: Homeboy, WP Codebox, and OpenCode
  • Model: OpenAI GPT-5.6 Sol
  • Used for: Ran the repaired readiness and Cook path, inspected the generated recipe and adapter staging code, and drafted the typed-entrypoint contract. Chris reviewed and owns the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions