Make image generation request timeout configurable#862
Make image generation request timeout configurable#862
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #862 +/- ##
=============================================
+ Coverage 78.40% 78.43% +0.03%
Complexity 2454 2454
=============================================
Files 104 104
Lines 9918 9920 +2
=============================================
+ Hits 7776 7781 +5
+ Misses 2142 2139 -3
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:
|
|
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. |
What?
Closes #853
This PR makes the request timeout for the image generation ability configurable via the
wp_ai_client_default_request_timeoutfilter, while retaining 90 seconds as the default timeout.Why?
The timeout was hardcoded to 90 seconds which completely bypassed the
wp_ai_client_default_request_timeoutglobal filter, meaning developers could not customise or extend the timeout for slower image generation requests.How?
$request_options->setTimeout( 90 )call with a filtered value:test_request_timeout_defaults_to_90andtest_request_timeout_can_be_filteredto verify the defaults and overridden filter values.Testable_Generate_Imageto bypass environment checks so the tests can run anywhere.Use of AI Tools
AI assistance: Yes
Tool(s): Gemini 3.5 Flash)
Used for: Drafting integration test assertions and preparing validation commands.
Testing Instructions
Run the automated tests:
Changelog Entry