Skip to content

Gateway client fails against OpenClaw 2026.9.5: Control UI build check on connect, and sessions.create before the new agent registers #91

Description

@FancyKat

clawbench run cannot complete a task against an OpenClaw 2026.9.5 gateway (ec9c1a1). There are two separate incompatibilities in clawbench/client.py, found at ClawBench e3f8d25 (current main).

Setup

  • ClawBench image built from e3f8d25 with --build-arg OPENCLAW_IMAGE= pointing at the ghcr.io/openclaw/openclaw:2026.9.5 index (linux/arm64).
  • A loopback gateway in the same container:
    openclaw gateway run --allow-unconfigured --bind loopback --port 18789 --auth token --token "$TOKEN"
    
  • The run:
    clawbench run --model ollama/gemma4:26b --task t1-fs-quick-note --runs 1
    
    (OPENCLAW_GATEWAY_TOKEN set; judge off.)

1. The handshake is rejected as a stale Control UI

RuntimeError: RPC connect failed: UNAVAILABLE - protocol mismatch: Control UI updated; reload this page to continue

Gateway log:

[ws] control ui build rejected ... clientBuild=legacy gatewayBuild=2026.9.5-ec9c1a13db89-2026-09-18T18-50-25.957Z; reload required

The client connects as {"id": "openclaw-control-ui", "mode": "ui"} with no buildId. The 2026.9.5 gateway's connect handler (resolveControlUiBuildMismatch) compares a Control UI client's buildId with its own build and closes the connection when they differ. A missing id counts as legacy. The protocol range (3–4) is fine: the gateway speaks v4.

Identifying as the CLI ({"id": "cli", "mode": "cli"}) gets past the handshake. That client then needs its device identity paired: its first connect answers NOT_PAIRED, and openclaw devices approve <requestId> resolves it. Setting CLAWBENCH_DISABLE_GATEWAY_DEVICE_IDENTITY=1 avoids the pairing, but the connection then lacks operator.admin, and agents.create fails with FORBIDDEN - missing scope: operator.admin.

2. sessions.create runs before the new agent exists

RuntimeError: RPC sessions.create failed: INVALID_REQUEST - Unknown agent id "clawbench-t1-fs-quick-note-run-0-541829"

Gateway log (timestamps):

16:44:43.767 res ✓ agents.create 78ms
16:44:43.808 res ✗ sessions.create ... Unknown agent id "clawbench-t1-fs-quick-note-run-0-541829"
16:44:43.952 [reload] config hot reload applied (... agents.entries.clawbench-t1-fs-quick-note-run-0-541829 ...)

On 2026.9.5, agents.create returns before the agent is registered. The agent becomes known when the config hot reload applies, about 200 ms later.

Suggested fixes

  1. Connect as a backend or CLI client rather than the browser Control UI, or send a buildId the gateway accepts. Document the device-pairing step for token-authenticated harness clients, or have the worker approve its own pairing request, since it owns the gateway.
  2. After agents.create, wait until the agent is registered before sessions.create: poll agents.list, or retry Unknown agent id briefly.

Workaround used

This local patch to clawbench/client.py, plus pairing the harness device with openclaw devices approve, made the smoke pass on 2026.9.5. The run scored 0.880 on t1-fs-quick-note with ollama/gemma4:26b (completion 1.00, trajectory 0.60, behavior 1.00).

-                    "id": "openclaw-control-ui",
+                    "id": "cli",
                     "version": __version__,
                     "platform": "linux",
-                    "mode": "ui",
+                    "mode": "cli",
@@ async def create_session(
-        response = await self._rpc("sessions.create", params)
+        for attempt in range(20):
+            try:
+                response = await self._rpc("sessions.create", params)
+                break
+            except RuntimeError as error:
+                if "Unknown agent id" not in str(error) or attempt == 19:
+                    raise
+                await asyncio.sleep(0.25)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions