[wp-trac] [WordPress Trac] #65094: AI: Prompt construction fails with fatal error when wp_ai_client_default_request_timeout filter returns negative number
WordPress Trac
noreply at wordpress.org
Fri Apr 24 12:50:38 UTC 2026
#65094: AI: Prompt construction fails with fatal error when
wp_ai_client_default_request_timeout filter returns negative number
-------------------------------------------------+-------------------------
Reporter: westonruter | Owner:
| westonruter
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 7.0
Component: AI | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests commit | Focuses:
dev-feedback |
-------------------------------------------------+-------------------------
Comment (by dhrumilk):
I reproduced the issue in a local WordPress development setup and
documented the findings.
**Steps performed:**
* Set up a fresh local WordPress core environment
* Attempted to apply the `wp_ai_client_default_request_timeout` filter
* Initially added the filter in `wp-config.php`, which resulted in a fatal
error since `add_filter()` is not available at that early stage of
execution
* Relocated the filter to `functions.php`, where WordPress is fully loaded
and hooks are accessible
**Result:**
* No fatal errors occurred when the filter was implemented in the correct
location
* WordPress functioned as expected without any issues
**Conclusion:**
The behavior is correct and expected. The filter works properly when used
within the appropriate context (i.e., after WordPress has fully
initialized), and the earlier error was due to placing it too early in the
load sequence.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65094#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list