Skip to content

Standardize the Title Generation Ability to match our other Abilities#227

Open
dkotter wants to merge 4 commits intoWordPress:developfrom
dkotter:update/ability-standardization
Open

Standardize the Title Generation Ability to match our other Abilities#227
dkotter wants to merge 4 commits intoWordPress:developfrom
dkotter:update/ability-standardization

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented Feb 12, 2026

What?

Modifies the input schema of the Title Generation Ability to match how we've set up our other Abilities.

Note

This is technically a backwards compat break as we're changing the schema from post_id to context.

We don't have to make this change but it does bring code consistency as all other Abilities we have function in this way. And it also makes the Title Generation Ability a little more generic and easier to use in all situations.

If we don't think that's worth it though, happy to close this out.

Why?

Ensures we have code consistency and also makes the Title Generation Ability more generic and easier to use in other situations where you may not want to pass in a post ID.

How?

  • In the input schema of the Title Generation Ability, change the post_id field to context and allow either a post ID to be passed or specific context
  • In our execution callback, check if the context field contains a post ID and if so, use that to get our context from that post
  • When making the API request, pass the content and context (if we have some) in XML-like tags and remove the use of triple quotes to delimit content
  • Update our system instructions to take into account the above changes
  • Update our client-side API request to pass the right field

Use of AI Tools

All code changes done by me. Cursor (using Composer 1.5) was used to update failing unit tests

Testing Instructions

  1. Add valid AI credentials
  2. Turn on the Title Generation Experiment
  3. Edit or create a post, adding in some content
  4. Click into the title field and click the (Re-) Generate button
  5. Ensure title suggestions are shown
Open WordPress Playground Preview

…the post ID via a context field. Can also pass in actual context in this field if desired. This matches how our other Abilities now work, ensuring consistency. Also makes the Ability more generic and easier to use in other situations
@dkotter dkotter added this to the 0.4.0 milestone Feb 12, 2026
@dkotter dkotter self-assigned this Feb 12, 2026
@github-actions
Copy link

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dkotter <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 57.69231% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.64%. Comparing base (04c2df4) to head (9d01a29).
⚠️ Report is 25 commits behind head on develop.

Files with missing lines Patch % Lines
...es/Abilities/Title_Generation/Title_Generation.php 58.33% 10 Missing ⚠️
.../Abilities/Title_Generation/system-instruction.php 50.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #227      +/-   ##
=============================================
- Coverage      56.76%   56.64%   -0.12%     
- Complexity       505      507       +2     
=============================================
  Files             32       33       +1     
  Lines           2565     2572       +7     
=============================================
+ Hits            1456     1457       +1     
- Misses          1109     1115       +6     
Flag Coverage Δ
unit 56.64% <57.69%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dkotter dkotter changed the title Update/ability standardization Standardize the Title Generation Ability to match our other Abilities Feb 12, 2026
@jeffpaul jeffpaul modified the milestones: 0.3.1, 0.4.0 Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

2 participants