Skip to content

Commit 59834a4

Browse files
authored
Fix response being None
This should resolve the TypeError: 'NoneType' object is not callable that was occurring because the handler was implicitly returning None. With this modification to the mcpm library source code (which OpenHands uses), the /messages endpoint should now function correctly without crashing.
1 parent 549d56c commit 59834a4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mcpm/router/transport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ async def handle_post_message(self, scope: Scope, receive: Receive, send: Send):
240240
logger.warning(f"Connection error when sending message to session {session_id}: {e}")
241241
self._read_stream_writers.pop(session_id, None)
242242
self._session_id_to_identifier.pop(session_id, None)
243+
return response
243244

244245
def _validate_api_key(self, scope: Scope, api_key: str | None) -> bool:
245246
# If api_key is explicitly set to None, disable API key validation

0 commit comments

Comments
 (0)