Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix HTTPException not callable error in action_execution_server middleware (#7215)

Robert Brennan7084b0238c87
diff --git a/openhands/runtime/action_execution_server.py b/openhands/runtime/action_execution_server.py
index aece36b52f..2e32bf0fb3 100644
--- a/openhands/runtime/action_execution_server.py
+++ b/openhands/runtime/action_execution_server.py
@@ -546,7 +546,9 @@ if __name__ == '__main__':
try:
verify_api_key(request.headers.get('X-Session-API-Key'))
except HTTPException as e:
- return e
+ return JSONResponse(
+ status_code=e.status_code, content={'detail': e.detail}
+ )
response = await call_next(request)
return response