You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It still sometimes happens that the endpoint of an agent (incl. /submit) is being opened in a browser which leads to the following observation and leaves the agent in a stale state (stops working)
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/uagents/asgi.py", line 81, in __call__
if b"application/json" not in headers[b"content-type"]:
KeyError: b'content-type'
if the path is ending with /submit which is true most of the time if you know how to interact with an agent OR if you do some internal routing.
The internal routing is often the case when hosting an agent in the cloud or making it accessible through a web2 DNS service.
-> The browser by default may not add the content type property to the request, leading to a key error in:
This should be an easy fix to prevent the agent from crashing but I would like to start the discussion here if we would additionally give a standard feedback/response to the browser client that the agent is up and running, e.g. GET "/submit" -> 200, OK - Agent is running
The text was updated successfully, but these errors were encountered:
Problem:
It still sometimes happens that the endpoint of an agent (incl.
/submit
) is being opened in a browser which leads to the following observation and leaves the agent in a stale state (stops working)We check in:
uAgents/python/src/uagents/asgi.py
Line 93 in 8068ca6
/submit
which is true most of the time if you know how to interact with an agent OR if you do some internal routing.The internal routing is often the case when hosting an agent in the cloud or making it accessible through a web2 DNS service.
-> The browser by default may not add the content type property to the request, leading to a key error in:
uAgents/python/src/uagents/asgi.py
Line 109 in 8068ca6
Proposal
This should be an easy fix to prevent the agent from crashing but I would like to start the discussion here if we would additionally give a standard feedback/response to the browser client that the agent is up and running, e.g.
GET "/submit" -> 200, OK - Agent is running
The text was updated successfully, but these errors were encountered: