Skip to content

fix: defer code ability registration until API loads#438

Merged
chubes4 merged 1 commit into
mainfrom
late-ability-registration-after-init
May 20, 2026
Merged

fix: defer code ability registration until API loads#438
chubes4 merged 1 commit into
mainfrom
late-ability-registration-after-init

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 20, 2026

Summary

  • Defer DMC ability registration to wp_abilities_api_init when ability classes are constructed before WP_Ability is loaded.
  • Preserve immediate registration when the Abilities API is already available.
  • Add smoke coverage for the deferred constructor path that wp-codebox exercises.

Verification

  • php tests/smoke-late-ability-registration.php
  • php tests/smoke-deferred-ability-registration.php
  • php -l inc/Abilities/WorkspaceAbilities.php && php -l inc/Abilities/GitHubAbilities.php && php -l inc/Abilities/GitSyncAbilities.php && php -l inc/Abilities/WordPressRuntimeAbilities.php && php -l inc/Abilities/CodeTaskAbilities.php && php -l tests/smoke-deferred-ability-registration.php

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (gpt-5.5)
  • Used for: Diagnosed the wp-codebox canary registration ordering failure, drafted the code change and smoke test, and ran local verification. Chris remains responsible for review and merge.

@chubes4 chubes4 merged commit a4bdd8b into main May 20, 2026
@chubes4 chubes4 deleted the late-ability-registration-after-init branch May 20, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant