OpenHands/agent-canvas

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

Open

#843 创建于 2026年5月27日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)TypeScript (26 fork)github user discovery
buggood first issue

仓库指标

Star
 (43 star)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南