From 7084b0238c875dd017efbd3f29d02b2c1a866ca6 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Wed, 12 Mar 2025 15:10:13 -0400 Subject: [PATCH] Fix HTTPException not callable error in action_execution_server middleware (#7215) Co-authored-by: openhands --- openhands/runtime/action_execution_server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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