Repository navigation
Conversation
The text added before the site's guidelines contained the HTML entity &WordPress#39; instead of an apostrophe, so the model received "site&WordPress#39;s".
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1230 +/- ##
=============================================
+ Coverage 84.41% 84.43% +0.01%
Complexity 3714 3714
=============================================
Files 149 149
Lines 14144 14144
=============================================
+ Hits 11940 11942 +2
+ Misses 2204 2202 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What?
Closes #1228
Sends "site's" instead of "site's" in the text added before the site's guidelines.
Why?
The prompt is plain text and is never HTML-decoded, so the model received the HTML entity. Details are in #1228.
How?
Replaced
'with a literal apostrophe in the two copies of the text:Abstract_Ability::get_system_instruction()inincludes/Abstracts/Abstract_Ability.phpGenerate_Image::get_prompt_builder()inincludes/Abilities/Image/Generate_Image.phpUse of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus
Used for: Investigation, implementation, tests, and PR wording. I reviewed the changes and the test results, and I take responsibility for the contribution.
Testing Instructions
wp_knowledgerows, for example with the Gutenberg plugin).openai:generationsrequest. The Input Preview reads "The following guidelines represent the site's editorial standards." Ondevelopit reads "the site's editorial standards".I ran these steps in Chrome on WordPress 7.1.3 (wp-env, PHP 8.3), with the repo's
tests/e2e-testingplugin mocking the provider, first ondevelopand then on this branch. I added the guidelines with a temporary mu-plugin that registerswp_knowledgeandwp_knowledge_type, as the PHPUnit helpers do.The copy in
Abstract_Ability::get_system_instruction()(text abilities such as Excerpt Generation) can't be checked this way: the log keeps only the first 1200 characters of the request, and the system instruction is longer, so the guidelines text is cut off. The PHPUnit test below covers it.Automated:
test_get_system_instruction_appends_guidelinesinAbstract_Ability_Guidelines_Test.phpnow also checks for "site's". It fails ondevelop.test_prompt_builder_appends_guidelines_as_plain_textinImage_GenerationTest.phpadds guidelines and checks the image prompt built byget_prompt_builder(). It fails ondevelop. It reads the prompt from the builder's messages, the same way the timeout tests read the request options.npm run test:phppasses (2182 tests).npm run lint:php:stanpasses.Changelog Entry