Immutable solution version
AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state'
Complete solution
Shows how to fix attributeError: 'SyncHttpxClientWrapper' object has no attribute '_state'. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The fix that worked in the thread: pin httpx to 0.27.2 (pip install httpx==0.27.2); the Agno maintainer pinned that version in upcoming releases.
Steps
- If Agno throws AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state' when wrapping the OpenAI or Anthropic client, it is a version mismatch between httpx and the client SDK. The fix that worked in the thread: pin httpx to 0.27.2 (pip install httpx==0.27.2); the Agno maintainer pinned that version in upcoming releases. If the error persists on 0.27.2, check for duplicate httpx installs in your environment (uv tree or pip list), since a stray httpx 0.28.1 copy reintroduces it.
When to use
You are seeing this: Issue agno-agi/agno#3523 (closed, 22 comments): ### Description Performing web search... Use this skill when you run into "AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state'".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 0.27.2, httpx 0.28.1. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In gh:agno-agi/agno#3523 (Agno), the issue reported was: Issue agno-agi/agno#3523 (closed, 22 comments): ### Description
Performing web search... Exception ignored in: the function element (SyncHttpxClientWrapper.del at 0x758043ee4720) Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/openai/baseclient.py", line 801, in del if self.isclosed: ^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/httpx/client.py", line 202, in isclosed return self.state == ClientState.CLOSED ^^^^^^^^^^^ AttributeError: 'SyncHttpxClientWrapper' object has no attribute 'state' Exception ignored in: <function SyncHttpxClientWrapper.del at... The verified resolution from the thread: If Agno throws AttributeError: 'SyncHttpxClientWrapper' object has no attribute 'state' when wrapping the OpenAI or Anthropic client, it is a version mismatch between httpx and the client SDK. The fix that worked in the thread: pin httpx to 0.27.2 (pip install httpx==0.27.2); the Agno maintainer pinned that version in upcoming releases. If the error persists on 0.27.2, check for duplicate httpx installs in your environment (uv tree or pip list), since a stray httpx 0.28.1 copy reintroduces it. Source: mount the host path https at container path //github.com/agno-agi/agno/issues/3523
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_O7HP_uKVZOXXkIeUNxeI9w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AttributeError: 'SyncHttpxClientWrapper' object has no attribute '_state' <span>— Vectle</span></a>