Add VSCode URL support and worker ports to sandbox services (#11426)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Tim O'Farrell
2025-10-20 12:43:08 -06:00
committed by GitHub
parent 2889f736d9
commit 6d137e883f
11 changed files with 8027 additions and 161 deletions

View File

@@ -94,7 +94,8 @@ def mock_running_container():
container.attrs = {
'Created': '2024-01-15T10:30:00.000000000Z',
'Config': {
'Env': ['OH_SESSION_API_KEYS_0=session_key_123', 'OTHER_VAR=other_value']
'Env': ['OH_SESSION_API_KEYS_0=session_key_123', 'OTHER_VAR=other_value'],
'WorkingDir': '/workspace',
},
'NetworkSettings': {
'Ports': {
@@ -629,7 +630,10 @@ class TestDockerSandboxService:
assert agent_url.url == 'http://localhost:12345'
vscode_url = next(url for url in result.exposed_urls if url.name == VSCODE)
assert vscode_url.url == 'http://localhost:12346'
assert (
vscode_url.url
== 'http://localhost:12346/?tkn=session_key_123&folder=/workspace'
)
async def test_container_to_sandbox_info_invalid_created_time(self, service):
"""Test conversion with invalid creation timestamp."""