OpenHands/agent-canvas

Bug: Cloud-proxy calls continue after switching to local backend

Closed

#843 opened on May 27, 2026

 (1 comment) (0 reactions) (0 assignees)TypeScript (26 forks)github user discovery
buggood first issue

Repository metrics

Stars
 (43 stars)
PR merge metrics
 (Avg merge 2d 10h) (106 merged PRs in 30d)

Description

Steps to Reproduce

  1. Register both a local agent-server backend and an OH cloud backend
  2. Start with the cloud backend as active
  3. Switch to the local backend

Expected Behavior

When switching to a local backend, there should be NO calls to /api/cloud-proxy (method: OPTIONS) since that is only for cloud backend communication.

Actual Behavior

Network inspector shows continuous OPTIONS requests to:

  • http://127.0.0.1:8000/api/cloud-proxy (method: OPTIONS, status: 200)

These requests happen every ~10 seconds, continuing indefinitely after switching away from the cloud backend to a local one.

Possible Cause

Two hooks make unconditional calls to cloud backends:

  1. useBackendsHealth (src/hooks/query/use-backends-health.ts:91)

    • Polls ALL registered backends every 10 seconds
    • Calls getCurrentCloudApiKey(backend)callCloudProxy()/api/cloud-proxy for cloud backends
    • Issue: Does not check if the backend is the active one before polling
  2. useAllCloudOrganizations (src/hooks/query/use-cloud-organizations.ts:16)

    • Fetches organizations for ALL cloud backends (not just the active one)
    • Used by the backend selector dropdown

Neither hook gates on whether the backend is the active one - they iterate through every registered backend regardless of the active selection.

Contributor guide