Skip to content

Commit

Permalink
fix log_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Aug 22, 2024
1 parent 96616c1 commit f17312d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion openhands/runtime/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ async def execute_action(action_request: ActionRequest):
observation = await client.run_action(action)
return event_to_dict(observation)
except Exception as e:
logger.error(f'Error processing command: {str(e)}')
logger.error(f'Error processing command: {e}')
logger.exception(e)
raise HTTPException(status_code=500, detail=str(e))

@app.post('/upload_file')
Expand Down
3 changes: 2 additions & 1 deletion openhands/runtime/client/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ async def ainit(self, env_vars: dict[str, str] | None = None):
self.container = self.docker_client.containers.get(self.container_name)
await self.start_docker_container()

self.log_buffer = LogBuffer(self.container)

@staticmethod
def _init_docker_client() -> docker.DockerClient:
try:
Expand Down Expand Up @@ -259,7 +261,6 @@ async def _init_container(
environment={'DEBUG': 'true'} if self.config.debug else None,
volumes=volumes,
)
self.log_buffer = LogBuffer(container)
logger.info(f'Container started. Server url: {self.api_url}')
return container
except Exception as e:
Expand Down

0 comments on commit f17312d

Please sign in to comment.