Fix excerpt generation post context payload#651
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #651 +/- ##
==========================================
Coverage 74.58% 74.58%
Complexity 1754 1754
==========================================
Files 85 85
Lines 7547 7547
==========================================
Hits 5629 5629
Misses 1918 1918
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixed - Excerpt generation post context payload. Co-authored-by: ekamran <ekamran@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org>
What?
Fixes the Excerpt Generation editor request so it passes the current post ID through the ability's existing
contextfield instead of sending an unsupportedpost_idfield.Why?
The
ai/excerpt-generationability schema acceptscontentandcontext. Its post ID path is triggered whencontextis numeric.Before this change, the editor sent
post_id, which is not part of the Excerpt Generation ability schema. The request could still generate an excerpt becausecontentwas also sent, but the ability skipped the intended post-context path.This brings Excerpt Generation in line with the existing ability contract and with sibling features like Title Generation and Summarization.
How?
context: postId.toString()from the Excerpt Generation editor hook.Testing Instructions
Automated checks run locally:
Manual testing:
wp-abilities/v1/abilities/ai/excerpt-generation/runsendsinput.contextwith the post ID instead ofinput.post_id.Screenshots/Screencast
Before:
After:
Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT / Codex
Used for: Repository review, reproduction planning, implementation guidance, test updates, and local verification. I reviewed the changes, tested the behavior locally, and take responsibility for the final submission.