Summary
The SDK's intercept wrapper around httpx.Response implements raise_for_status as -> None (_responses.py), where the underlying httpx.Response.raise_for_status returns Self.
This silently breaks the standard httpx idiom every consumer reaches for:
return c.get("/path").raise_for_status().json()
Inside an intercept_context, the patched response wraps the real one. The chained .raise_for_status() returns None, .json() is then called on None, and the agent fails with:
AttributeError: 'NoneType' object has no attribute 'json'
Reproduction
Any HTTP call inside provably.intercept_context(...) that uses the chained idiom. We hit this on every CRM/billing/support/orders/messaging tool until we worked around it.
Workaround
We split every chained call into three statements (tools.py — see _get_json/_post_json):
def _get_json(c, path):
r = c.get(path)
r.raise_for_status()
return r.json()
This works but every consumer ends up writing the same helper. The SDK should match httpx's contract.
Proposed fix
def raise_for_status(self) -> "WrappedResponse":
self._orig.raise_for_status()
return self
(Same change in both wrapper variants.) One-line change, full backward compat.
Summary
The SDK's intercept wrapper around
httpx.Responseimplementsraise_for_statusas-> None(_responses.py), where the underlyinghttpx.Response.raise_for_statusreturnsSelf.This silently breaks the standard httpx idiom every consumer reaches for:
Inside an
intercept_context, the patched response wraps the real one. The chained.raise_for_status()returnsNone,.json()is then called onNone, and the agent fails with:Reproduction
Any HTTP call inside
provably.intercept_context(...)that uses the chained idiom. We hit this on every CRM/billing/support/orders/messaging tool until we worked around it.Workaround
We split every chained call into three statements (tools.py — see
_get_json/_post_json):This works but every consumer ends up writing the same helper. The SDK should match httpx's contract.
Proposed fix
(Same change in both wrapper variants.) One-line change, full backward compat.