Fix SQLAlchemy result handling in get_sandbox_by_session_api_key (#12148)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Tim O'Farrell 2025-12-23 17:11:16 -07:00 committed by GitHub
parent 8bc1a47a78
commit dc99c7b62e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -356,7 +356,7 @@ class RemoteSandboxService(SandboxService):
StoredRemoteSandbox.id == runtime.get('session_id')
)
result = await self.db_session.execute(query)
sandbox = result.first()
sandbox = result.scalar_one_or_none()
if sandbox is None:
raise ValueError('sandbox_not_found')
return self._to_sandbox_info(sandbox, runtime)