Skip to content

feat: OpenHands Gateway and V1 routing for self-hosted deployments + agent-canvas backend support#14909

Open
kripper wants to merge 12 commits into
OpenHands:mainfrom
kripper:feat/agent-canvas/pr
Open

feat: OpenHands Gateway and V1 routing for self-hosted deployments + agent-canvas backend support#14909
kripper wants to merge 12 commits into
OpenHands:mainfrom
kripper:feat/agent-canvas/pr

Conversation

@kripper

@kripper kripper commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

HUMAN:
Verified.

  • A human has tested these changes.

Why

To have agent+canvas + OH containers + OH self-hosted

Description

  • implements V1 routers to access the agent-servers/sandboxes through the same endpoint that serves OpenHands (AKA self-hosted mode).
  • adds support for adding OpenHands OSS as an OpenHands backend in Agent Canvas.

Requires: OpenHands/agent-canvas#1435

How to Test

  • Run OH with env var ENABLE_WEBSOCKET_GATEWAY=true. This enables the websocket gateway on the backend.
  • Set VITE_ENABLE_WEBSOCKET_GATEWAY="true" in frontend/.env and rebuild the front end. This makes the websockets use relative urls and use the same host and port of the web app.
  • Depending on your setup, if your sandboxes are somehow not reachable by the OH app-server (see OH logs), set the env var SANDBOX_CONTAINER_URL_PATTERN="http://127.0.0.1:{port}" (change to the IP of your dockerd host).

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

@kripper kripper mentioned this pull request Jun 19, 2026
8 tasks
@kripper kripper changed the title Feat/agent canvas/pr OpenHands Backend (with agent-canvas support) + OpenHands Gateway (V1 routers) Jun 19, 2026
@kripper kripper changed the title OpenHands Backend (with agent-canvas support) + OpenHands Gateway (V1 routers) OpenHands Gateway and V1 routing for self-hosted deployments + agent-canvas backend support Jun 19, 2026
@kripper kripper changed the title OpenHands Gateway and V1 routing for self-hosted deployments + agent-canvas backend support feat: OpenHands Gateway and V1 routing for self-hosted deployments + agent-canvas backend support Jun 19, 2026
@github-actions github-actions Bot added the type: feat A new feature label Jun 19, 2026
kripper added 10 commits June 19, 2026 18:20
- Added POST /{conversation_id}/pause proxy endpoint forwarding to agent-server
- Uses _get_agent_server_context to resolve agent-server URL and session key
- Modified pauseConversation to check VITE_ENABLE_WEBSOCKET_GATEWAY flag
Refactor conversation_router.py:
- Extract _proxy_to_agent_server() and _resolve_agent_server_context() helpers
- Refactor pause_conversation to use shared helpers
- Add resume_conversation (POST /api/conversations/{id}/run)
- Add events_count (GET /api/conversations/{id}/events/count)

Add git_changes proxy to git_router.py:
- GET /api/v1/git/changes?conversation_id={id}&path={p}

Update frontend services for gateway routing (same pattern as pause):
- resumeConversation, getEventCount, getGitChanges: gateway path via openHands
- Add POST /{conversation_id}/ask_agent proxy with 600s timeout for LLM calls
- Refactor _proxy_to_agent_server() to accept optional timeout param
  (httpx 0.28+ send() drops timeout kwarg - use dedicated client)
- Read request.body() once upfront instead of single-use request.stream()

Add git/diff proxy to git_router.py:
- GET /api/v1/git/diff proxy endpoint

Update frontend services for gateway routing:
- askAgent: gateway path via openHands
- getGitChangeDiff: gateway path via openHands with conversationId
- When app-server local event store is empty, proxy search/count requests to
  agent-server so V1 conversations can still list and count their events
- Added _proxy_request() helper and _get_agent_server_context lazy import
- search_events falls back to agent-server when local store has no items
- count_events falls back to agent-server when local store returns zero
openhands.core.logger was removed in newer SDK versions. Switch
to openhands.app_server.utils.logger which is the local replacement.
feat: add gateway WebSocket URL to AppConversation and improve sandbox_spec fallback (sandbox_spec/condenser part)
… integration

- POST /oauth/device/authorize — returns device_code, user_code, verification URIs
- POST /oauth/device/token — polled by client; returns authorization_pending → access_token
- POST /oauth/device/verify-authenticated — confirms authorization from browser popup
- GET  /oauth/device/verify — self-contained HTML authorization page

Uses X-Forwarded-Proto for scheme detection with https fallback for known
cloud domains. Registered in app.py.
@kripper kripper force-pushed the feat/agent-canvas/pr branch from dcf7581 to dc014e3 Compare June 19, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant