#17690·OpenHands

[Bug]: Automations poller calls GET /api/automation/v1 without X-Session-API-Key, raising a 401 toast every minute on self-hosted

Author: bentlynixon-codesCreated Sep 24, 2026Updated Sep 28, 2026
Labelspriority:medium

Operating System

Linux (Ubuntu 24.04)

Installation Method

Docker — ghcr.io/openhands/agent-canvas, self-hosted behind an SSO reverse proxy

Agent Canvas Version

1.22.0

Bug Description

On a self-hosted canvas with no automations configured, the UI polls GET /api/automation/v1?limit=1&offset=0 roughly once a minute without the X-Session-API-Key header. The server correctly answers 401, and the UI surfaces each one as a Request failed with status code 401 toast.

The endpoint itself works. Called directly from inside the container:

no key:   401
with key: 200  {"automations":[],"total":0}

And GET /api/automation/health returns 200 from the same browser, in the same page load, while v1 returns 401. So the session and the key are fine; the automations poller simply does not attach the header that the rest of the UI's /api calls do.

We checked whether this is #17371 (rotated key not reconciled into openhands-backends). It is not: in the browser, window.AGENT_CANVAS_SESSION_API_KEY is present and every stored entry in localStorage['openhands-backends'] matches it, and the key file has not changed since before the container started.

Steps to Reproduce

  1. Run agent-canvas 1.22.0 self-hosted (Docker), with no automations created.
  2. Open the canvas UI and leave it open for a few minutes.
  3. Watch the browser Network tab, or the server access log.

Actual Behavior

GET /api/automation/v1?limit=1&offset=0 returns 401 roughly once a minute (sometimes several within seconds), each raising a Request failed with status code 401 toast. Browser console:

/api/automation/v1?limit=1&offset=0:1  Failed to load resource: the server responded with a status of 401 ()

Expected Behavior

The automations poller sends X-Session-API-Key like the other /api calls, and returns the empty list. Failing that, a poll that 401s should not raise a user-facing toast every minute.

Relevant Logs

Server access log, three hours of an idle open tab. The only HTTP traffic logged was the automations poller:

 86 × 401  GET /api/automation/v1
 28 × 200  GET /api/automation/health
  2 × 200  GET /api/automation/sdk-version

Acceptance Criteria

  • An open canvas with no automations produces no 401s from the automations poller.
  • No periodic Request failed with status code 401 toast on an idle self-hosted canvas.

Additional context

The 1.22.0 release notes describe the automation changes in cloud-backend terms ("Organization members can now reach the add and import automation entry points on cloud backends"), which may be why the self-hosted auth path was not exercised.

This is cosmetic but not harmless: on a deployment whose real alerts are also toasts, one that fires every minute trains people to dismiss them. Our workaround answers GET /api/automation/v1 with an empty list at the reverse proxy, which we will remove once this is fixed.