Skip to content

feat: add Guzzle 8 support - #103

Merged
Harshini1098 merged 3 commits into
masterfrom
cursor/guzzle-8-support-ae2c
Nov 26, 2026
Merged

Harshini1098 merged 3 commits into
masterfrom
cursor/guzzle-8-support-ae2c

Conversation

@Harshini1098

Copy link
Copy Markdown
Collaborator

Allow guzzlehttp/guzzle ^7 || ^8 so customers on Guzzle 8 can install the
SDK. Map no-response failures via NetworkExceptionInterface, avoid
getHandlerContext() (removed in Guzzle 8), and configure CurlMultiHandler
connection caps in a Guzzle 7/8-compatible way.

Harshini1098 and others added 3 commits November 25, 2026 10:43
Allow guzzlehttp/guzzle ^7 || ^8 so customers on Guzzle 8 can install the
SDK. Map no-response failures via NetworkExceptionInterface, avoid
getHandlerContext() (removed in Guzzle 8), and configure CurlMultiHandler
connection caps in a Guzzle 7/8-compatible way.
Guzzle 8 raises ResponseTimeoutException when a transfer times out after
the response headers arrived. It is not a NetworkExceptionInterface, so
it fell through to the generic catch and was reported as "unknown".
Guzzle 7 reports the same failure as ConnectException, which maps to
"timeout".

Add a CI leg that resolves Guzzle 8, since composer.lock pins Guzzle 7
and the existing matrix never runs the Guzzle 8 code paths or tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@nijeesh-stream nijeesh-stream left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this against Guzzle 8.6.0 locally: unit suite, PHPStan, and real-socket failures (refused, DNS, connect timeout, TLS, empty reply, truncated body, plain 200 and 500). Nearly everything matched Guzzle 7. Two things didn't, and I pushed 1aab39b to fix both.

Fixed: a timeout after the response had started came back as unknown on Guzzle 8. If the server sends headers and then stalls, Guzzle 8 throws ResponseTimeoutException. That isn't a NetworkExceptionInterface, so it fell into the generic GuzzleException catch. Guzzle 7 reports the same failure as timeout. The generic catch now maps it to ERROR_TYPE_TIMEOUT, with a test (guzzle8ResponseTimeoutMapsToTimeoutErrorType) that fails if the mapping is removed.

Fixed: CI never ran Guzzle 8. composer.lock pins 7.10 and the workflow runs composer install, so all three PHP legs tested Guzzle 7 and the Guzzle 8 tests were skipped. There's now a Test & lint (8.3, Guzzle 8) job that resolves guzzlehttp/guzzle:^8.0 and runs the same lint and unit lane. It's green on this head.

Left alone:

  • composer.lock is out of date with composer.json, but it already is on master, so not this PR's problem.
  • The Guzzle 8 branch sets max_total_connections to the per-host value. Guzzle 7 has no total cap. Fine while the SDK talks to one host; worth knowing if that changes.

The branch is 8 commits behind master. I merged master locally and both legs still pass, so no conflict there.

@Harshini1098
Harshini1098 marked this pull request as ready for review November 26, 2026 11:39
@Harshini1098
Harshini1098 merged commit 8ee9d24 into master Nov 26, 2026
10 checks passed
@Harshini1098
Harshini1098 deleted the cursor/guzzle-8-support-ae2c branch November 26, 2026 11:42
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.

2 participants