The VS Code, and Web Hosts features are not functi...
# proj-sdk
m
The VS Code, and Web Hosts features are not functioning properly 🧵
Hi @straight-sundown-84319 and @freezing-spoon-14104, As Stephan mentioned, we need to call the /api/v1/sandboxes/search endpoint to retrieve the VSCode and web host URLs (listed under the exposed_urls property). I tested this, and here’s the response I received. However, I wasn’t able to find the web_host URL, nor could I locate the VSCode and web host URLs for a specific conversation ID. Do you have any suggestions or insights on this? Thank you! thankyou
Copy code
{
  "items": [
    {
      "id": "oh-agent-server-2rmVpNV8Csuktfy0yr4EtU",
      "created_by_user_id": null,
      "sandbox_spec_id": "ghcr.io/all-hands-ai/agent-server:ab36fd6-python",
      "status": "RUNNING",
      "session_api_key": "udYazIMgi0t0C3qv1dg7K8olz0xpDxQ7l3CI1bdHpmd",
      "exposed_urls": [
        {
          "name": "AGENT_SERVER",
          "url": "http://localhost:50943"
        },
        {
          "name": "VSCODE",
          "url": "http://localhost:50944/?tkn=udYazIMgi0t0C3qv1dg7K8olz0xpDxQ7l3CI1bdHpmd&folder=/home/openhands/workspace"
        },
        {
          "name": "WORKER_1",
          "url": "http://localhost:50945"
        },
        {
          "name": "WORKER_2",
          "url": "http://localhost:50946"
        }
      ],
      "created_at": "2025-10-24T03:46:19.579568Z"
    },
    {
      "id": "oh-agent-server-BCu9iyWQ0kD7eLkmdyHDC",
      "created_by_user_id": null,
      "sandbox_spec_id": "ghcr.io/all-hands-ai/agent-server:ab36fd6-python",
      "status": "RUNNING",
      "session_api_key": "m21WquLoz0NzRj1IjO7GSstvRdfrm2daIUeDUpVceVM",
      "exposed_urls": [
        {
          "name": "AGENT_SERVER",
          "url": "http://localhost:64340"
        },
        {
          "name": "VSCODE",
          "url": "http://localhost:64341/?tkn=m21WquLoz0NzRj1IjO7GSstvRdfrm2daIUeDUpVceVM&folder=/home/openhands/workspace"
        },
        {
          "name": "WORKER_1",
          "url": "http://localhost:64342"
        },
        {
          "name": "WORKER_2",
          "url": "http://localhost:64343"
        }
      ],
      "created_at": "2025-10-24T03:36:34.517289Z"
    }
  ],
  "next_page_id": null
}
Hi @straight-sundown-84319 Do you have any suggestions or insights on this?
s
Yes. A single agent server runs inside each sandbox - that is why you get a single AGENT_SERVER url. If you go to http://localhost:64340/docs you'll see the OpenAPI for that instance - if you authenticate with the session api key you should be able to manage conversations and events within that sandbox. (If you used the start converation api from the app server, there should be a single running conversation. Alsom the agent server runs a single VSCode instance against it rather than one per conversation - that is why you get a single one of those too. Same with the workers. This will allow us to have multiple conversations per sandbox in the future - but from the perspective of the UI nothing needs to change for now - we will run conversation per sandbox - so those URLs you get for the sandbox are the ones you should use in the UI.
m
Yes, but on the conversation page, I only need to retrieve the VSCode URL and the web host URL for a specific conversation. Do we have an endpoint for this, such as: • /api/v1/sandboxes/search?conversation_id=<conversation_id> • /api/v1/sandboxes/search?sandbox_id=<sandbox_id> • /api/v1/sandboxes/search?session_id=<session_id>
s
Yes
So you'll: • get the conversation info • In this, you'll find the sandbox_id - and you can query that endpoint
(So you'll call this first):
We don't have a filter for conversation id in the sandbox search endpoint - but I suppose it could also make sense to add one
If you wanted to make this a single call
m
Yes, the /api/v1/sandboxes endpoint makes sense—that’s exactly what I need. Thank you! thankyou
Will the web host URL be included in the exposed_urls field?
s
Yes - there were always 2 of these - in the runtime API they were called
WORKER_1
and
WORKER_2
so I settled on that to unify the naming
(So I think you are looking for WORKER_1)
m
Yes, thank you! thankyou