Skip to content

Apply wp-ai-client connect timeout to cURL#1798

Merged
chubes4 merged 1 commit intomainfrom
fix-wp-ai-curl-connect-timeout
May 5, 2026
Merged

Apply wp-ai-client connect timeout to cURL#1798
chubes4 merged 1 commit intomainfrom
fix-wp-ai-curl-connect-timeout

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 5, 2026

Summary

  • Applies Data Machine's resolved wp-ai-client connect timeout to WordPress HTTP's cURL handle via CURLOPT_CONNECTTIMEOUT.
  • Keeps the existing low-speed timeout behavior unchanged.
  • Extends the wp-ai-client timeout smoke test to assert that the cURL hook receives both request and connect timeouts.

Why

PR #1796 added a connect-timeout setting/filter and propagated request options through the model and prompt builder. Local validation then showed WordPress core's WP_AI_Client_HTTP_Client maps only total timeout from RequestOptions into WP HTTP args, so the actual cURL connect timeout still needed to be applied through Data Machine's scoped http_api_curl hook.

Testing

  • php tests/wp-ai-client-request-timeout-smoke.php — 25 assertions
  • php -l inc/Engine/AI/RequestBuilder.php && php -l tests/wp-ai-client-request-timeout-smoke.php
  • git diff --check origin/main...HEAD

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Drafting the follow-up patch, smoke assertion updates, and PR description; Chris remains responsible for review and testing.

@chubes4 chubes4 merged commit 081f9fd into main May 5, 2026
2 of 3 checks passed
@chubes4 chubes4 deleted the fix-wp-ai-curl-connect-timeout branch May 5, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant