Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix the issue where session id might be duplicated (#1557)

Binyuan Huib2a99b509fc3
diff --git a/opendevin/runtime/docker/exec_box.py b/opendevin/runtime/docker/exec_box.py
index 9f7a5d69b6..9c4e325fb3 100644
--- a/opendevin/runtime/docker/exec_box.py
+++ b/opendevin/runtime/docker/exec_box.py
@@ -61,7 +61,7 @@ class DockerExecBox(Sandbox):
)
raise ex
- self.instance_id = sid if sid is not None else str(uuid.uuid4())
+ self.instance_id = sid + str(uuid.uuid4()) if sid is not None else str(uuid.uuid4())
# TODO: this timeout is actually essential - need a better way to set it
# if it is too short, the container may still waiting for previous
diff --git a/opendevin/runtime/docker/ssh_box.py b/opendevin/runtime/docker/ssh_box.py
index 6df0367bc4..9d1b8eec7f 100644
--- a/opendevin/runtime/docker/ssh_box.py
+++ b/opendevin/runtime/docker/ssh_box.py
@@ -77,7 +77,7 @@ class DockerSSHBox(Sandbox):
)
raise ex
- self.instance_id = sid if sid is not None else str(uuid.uuid4())
+ self.instance_id = sid + str(uuid.uuid4()) if sid is not None else str(uuid.uuid4())
# TODO: this timeout is actually essential - need a better way to set it
# if it is too short, the container may still waiting for previous