Skip to content

Allow tuning wp-ai-client connect timeout#1796

Merged
chubes4 merged 1 commit into
mainfrom
fix-wp-ai-connect-timeout
May 5, 2026
Merged

Allow tuning wp-ai-client connect timeout#1796
chubes4 merged 1 commit into
mainfrom
fix-wp-ai-connect-timeout

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 5, 2026

Summary

  • Adds a wp_ai_client_connect_timeout Data Machine setting and datamachine_wp_ai_client_connect_timeout filter so provider connection timeouts can be tuned independently from full request timeouts.
  • Applies Data Machine request options to both the resolved wp-ai-client model and the prompt builder, preventing WordPress core's builder defaults from overwriting connect timeout.
  • Applies the resolved connect timeout to WordPress HTTP's cURL handle via CURLOPT_CONNECTTIMEOUT, because core's WP_AI_Client_HTTP_Client maps only total timeout from RequestOptions into WP HTTP args.
  • Extends the wp-ai-client timeout smoke test to cover model-level, builder-level, and cURL connect-timeout handling.

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
  • Local Studio validation on intelligence-chubes4:
    • confirmed explicit openai/gpt-5.4 model creation does not call /models with the php-ai-client hotfix present
    • set datamachine_settings.wp_ai_client_connect_timeout=120
    • confirmed Data Machine direct dispatch sees connect_timeout=120
    • confirmed cURL timeout failures changed from 30s to 120s after the cURL hook, proving the setting is applied to the active transport path

Notes

  • This complements Avoid listing models for explicit text model IDs WordPress/php-ai-client#231. Data Machine can cache successful model-list responses, but it cannot fully avoid first-call /models lookups for explicit model IDs; that upstream behavior needs the php-ai-client fix.
  • The remaining large-lane MGS failures appear to be provider/runtime latency under broad fan-out, not the original /models metadata lookup issue.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Drafting the Data Machine patch, smoke coverage, local Studio validation commands, and PR description; Chris remains responsible for review and testing.

@homeboy-ci
Copy link
Copy Markdown
Contributor

homeboy-ci Bot commented May 5, 2026

Homeboy Results — data-machine

Lint

lint — failed

  • formatting — 7 finding(s)
  • other — 2 finding(s)
  • Total: 9 finding(s)

ℹ️ Auto-fix: homeboy lint data-machine --path /home/runner/work/data-machine/data-machine --changed-since c2058e2 --fix (or homeboy refactor data-machine --path /home/runner/work/data-machine/data-machine --changed-since c2058e2 --from lint --write)
ℹ️ Some issues may require manual fixes
ℹ️ Full options: homeboy docs commands/lint
Deep dive: homeboy lint data-machine --changed-since c2058e2

Test

test — passed

  • 63 passed

ℹ️ Auto-fix lint issues: homeboy refactor data-machine --from lint --write
ℹ️ Collect coverage: homeboy test data-machine --coverage
ℹ️ Save test baseline: homeboy test data-machine --baseline
ℹ️ Pass args to test runner: homeboy test -- [args]
ℹ️ Full options: homeboy docs commands/test
Deep dive: homeboy test data-machine --changed-since c2058e2

Audit

audit — passed

  • test_coverage — 57 finding(s)
  • dead_code — 47 finding(s)
  • intra-method-duplication — 13 finding(s)
  • requested_detectors — 7 finding(s)
  • dead_guard — 2 finding(s)
  • parallel-implementation — 2 finding(s)
  • Content — 1 finding(s)
  • Directives — 1 finding(s)
  • Retention — 1 finding(s)
  • Tasks — 1 finding(s)
  • Total: 133 finding(s)

Deep dive: homeboy audit data-machine --changed-since c2058e2

Tooling versions
  • Homeboy CLI: homeboy 0.157.1+a3e4619a
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: a9f3e87
  • Action: Extra-Chill/homeboy-action@v2

@chubes4 chubes4 merged commit ebee488 into main May 5, 2026
2 of 3 checks passed
@chubes4 chubes4 deleted the fix-wp-ai-connect-timeout branch May 5, 2026 17:56
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