diff --git a/api/agent-notes/core/virtual_environment/providers/e2b_sandbox.py.md b/api/agent-notes/core/virtual_environment/providers/e2b_sandbox.py.md index 763334a89e..3fc5e83859 100644 --- a/api/agent-notes/core/virtual_environment/providers/e2b_sandbox.py.md +++ b/api/agent-notes/core/virtual_environment/providers/e2b_sandbox.py.md @@ -5,7 +5,7 @@ ## Key Decisions - Sandbox metadata is gathered during `_construct_environment` using the E2B SDK before returning `Metadata`. -- Architecture/OS detection uses a single `uname -m -s` call split into two lines to reduce round-trips. +- Architecture/OS detection uses a single `uname -m -s` call split by whitespace to reduce round-trips. - Command execution streams stdout/stderr through `QueueTransportReadCloser`; stdin is unsupported. ## Edge Cases diff --git a/api/core/virtual_environment/providers/e2b_sandbox.py b/api/core/virtual_environment/providers/e2b_sandbox.py index b5f1bb46a5..118980d596 100644 --- a/api/core/virtual_environment/providers/e2b_sandbox.py +++ b/api/core/virtual_environment/providers/e2b_sandbox.py @@ -132,12 +132,18 @@ class E2BEnvironment(VirtualEnvironment): envs=dict(environments), ) info = sandbox.get_info(api_key=options.get(self.OptionsKey.API_KEY, "")) - system_info = sandbox.commands.run("uname -m -s").stdout.splitlines() + system_info = sandbox.commands.run("uname -m -s").stdout.strip() + system_parts = system_info.split() + if len(system_parts) == 2: + os_part, arch_part = system_parts + else: + arch_part = system_parts[0] + os_part = system_parts[1] if len(system_parts) > 1 else "" return Metadata( id=info.sandbox_id, - arch=self._convert_architecture(system_info[0].strip()), - os=self._convert_operating_system(system_info[1].strip()), + arch=self._convert_architecture(arch_part.strip()), + os=self._convert_operating_system(os_part.strip()), store={ self.StoreKey.SANDBOX: sandbox, },