Repository navigation
Fix #24: test PHP AI Client 1.3.1 compatibility - #34
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I tested this branch locally before commenting, so sharing the result. I cloned this branch and installed it on an environment that reproduces #24, and the site still goes down with the same fatal at AnthropicProvider.php line 97. WP-CLI also cannot run. The composer pin, PHPUnit setup and CI matrix are all useful, and the sorting change looks like a real fix, but line 97 is untouched, so nothing changes at runtime for an affected site. Also a correction from my side. In #24 I said the class is missing from the bundled AI Client. That was wrong, and I should have checked before saying it. WordPress 7.0 through 7.0.4 and 7.1-RC3 all bundle PHP AI Client 1.3.1 and all of them do contain ListModelsApiBasedProviderAvailability. On a clean 7.0.4 with PHP 8.4 the provider registers fine. What actually reproduces the crash is that single class file not being present at runtime while the rest of the client is there, which is an incomplete install rather than a version mismatch. I can reproduce it reliably by deleting just that file from a clean 7.0.4. Adding a guard next to the existing AiClient check fixed it in my testing: if (!class_exists(ListModelsApiBasedProviderAvailability::class)) { With that, the same broken environment loads normally, front end and admin, no fatal. So my only suggestion is that this may be worth merging on its own merits without closing #24, since the fatal is still reproducible with this branch applied. Happy to open a small PR for the guard, and I can share full reproduction steps if useful. |
Fix #48: restore corrupted package metadata in composer.lock (#49) A merge conflict resolution in d8c3e53 (#34) spliced fields from phpcompatibility/php-compatibility and phpstan/phpstan into four packages-dev entries in composer.lock. As a result, `composer install` failed on trunk: nyholm/psr7 and phpcompatibility/php-compatibility both claimed to replace wimg/php-compatibility. Restore the original metadata for nyholm/psr7, phar-io/manifest, php-http/discovery and sebastian/global-state. Locked versions and the content-hash are unchanged. Co-authored-by: noruzzamans <noruzzaman@git.wordpress.org> Co-authored-by: Arkenon <arkenon@git.wordpress.org>
Summary
Verification
composer lintcomposer test— 1 test, 2 assertionscomposer validate --no-check-publish --no-interactioncomposer audit --no-interaction --no-ansi