fix: require gateway client id

# Conflicts:
#	apps/macos/Sources/Clawdbot/GatewayChannel.swift
#	docs/concepts/typebox.md
#	docs/gateway/index.md
#	src/commands/onboard-non-interactive.gateway-auth.test.ts
#	src/commands/onboard-non-interactive.lan-auto-token.test.ts
#	src/gateway/call.ts
#	src/gateway/client.ts
#	src/gateway/gateway.wizard.e2e.test.ts
#	src/gateway/probe.ts
#	src/gateway/protocol/schema.ts
#	src/gateway/server.auth.test.ts
#	src/gateway/server.health.test.ts
#	src/gateway/server.ts
#	src/gateway/test-helpers.ts
#	src/tui/gateway-chat.ts
This commit is contained in:
Peter Steinberger
2026-01-12 04:55:31 +00:00
parent d26518687a
commit 8e1cdf3a1f
4 changed files with 13 additions and 9 deletions

View File

@@ -18,12 +18,12 @@ provide quick operator visibility.
Presence entries are structured objects with fields like:
- `instanceId` (optional but strongly recommended): stable client identity
- `instanceId` (optional but strongly recommended): stable client identity (usually `connect.client.instanceId`)
- `host`: humanfriendly host name
- `ip`: besteffort IP address
- `version`: client version string
- `deviceFamily` / `modelIdentifier`: hardware hints
- `mode`: `gateway`, `app`, `webchat`, `cli`, `node`, ...
- `mode`: `ui`, `webchat`, `cli`, `backend`, `probe`, `test`, `node`, ...
- `lastInputSeconds`: “seconds since last user input” (if known)
- `reason`: `self`, `connect`, `node-connected`, `periodic`, ...
- `ts`: last update timestamp (ms since epoch)
@@ -62,7 +62,7 @@ for that node and refreshes it periodically so it doesnt expire.
Presence entries are stored in a single inmemory map:
- Entries are keyed by a **presence key**.
- The best key is a stable `instanceId` that survives restarts.
- The best key is a stable `instanceId` (from `connect.client.instanceId`) that survives restarts.
- Keys are caseinsensitive.
If a client reconnects without a stable `instanceId`, it may show up as a
@@ -94,6 +94,6 @@ indicator (Active/Idle/Stale) based on the age of the last update.
- To see the raw list, call `system-presence` against the Gateway.
- If you see duplicates:
- confirm clients send a stable `instanceId` in the handshake
- confirm clients send a stable `client.instanceId` in the handshake
- confirm periodic beacons use the same `instanceId`
- check whether the connectionderived entry is missing `instanceId` (duplicates are expected)