OpenHands/agent-canvas
在 GitHub 查看Bug: Cloud-proxy calls continue after switching to local backend
Open
#843 创建于 2026年5月27日
buggood first issue
仓库指标
- Star
- (43 star)
- PR 合并指标
- (PR 指标待抓取)
描述
Steps to Reproduce
- Register both a local agent-server backend and an OH cloud backend
- Start with the cloud backend as active
- 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:
-
useBackendsHealth(src/hooks/query/use-backends-health.ts:91)- Polls ALL registered backends every 10 seconds
- Calls
getCurrentCloudApiKey(backend)→callCloudProxy()→/api/cloud-proxyfor cloud backends - Issue: Does not check if the backend is the active one before polling
-
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.