2025-12-09 17:51:05 +00:00
---
2025-12-09 23:16:57 +01:00
summary: "Loopback WebChat static host and Gateway WS usage for chat UI"
2025-12-09 17:51:05 +00:00
read_when:
- Debugging or configuring WebChat access
2026-01-31 16:04:03 -05:00
title: "WebChat"
2025-12-09 17:51:05 +00:00
---
2025-12-08 12:50:37 +01:00
2026-01-31 21:13:13 +09:00
# WebChat (Gateway WebSocket UI)
2026-01-07 00:25:16 +01:00
Status: the macOS/iOS SwiftUI chat UI talks directly to the Gateway WebSocket.
2025-12-08 12:50:37 +01:00
2025-12-09 14:41:55 +01:00
## What it is
2026-01-31 21:13:13 +09:00
2026-01-07 00:25:16 +01:00
- A native chat UI for the gateway (no embedded browser and no local static server).
2026-01-13 07:15:57 +00:00
- Uses the same sessions and routing rules as other channels.
2026-01-07 00:25:16 +01:00
- Deterministic routing: replies always go back to WebChat.
2025-12-09 14:41:55 +01:00
2026-01-11 02:40:28 +01:00
## Quick start
2026-01-31 21:13:13 +09:00
1. Start the gateway.
2. Open the WebChat UI (macOS/iOS app) or the Control UI chat tab.
3. Ensure gateway auth is configured (required by default, even on loopback).
2026-01-11 02:40:28 +01:00
2026-01-07 00:25:16 +01:00
## How it works (behavior)
2026-01-31 21:13:13 +09:00
2026-01-16 00:28:43 +00:00
- The UI connects to the Gateway WebSocket and uses `chat.history` , `chat.send` , and `chat.inject` .
2026-02-16 21:50:01 -05:00
- `chat.history` is bounded for stability: Gateway may truncate long text fields, omit heavy metadata, and replace oversized entries with `[chat.history omitted: message too large]` .
2026-01-16 00:28:43 +00:00
- `chat.inject` appends an assistant note directly to the transcript and broadcasts it to the UI (no agent run).
2026-02-15 16:55:28 -08:00
- Aborted runs can keep partial assistant output visible in the UI.
- Gateway persists aborted partial assistant text into transcript history when buffered output exists, and marks those entries with abort metadata.
2026-01-07 00:25:16 +01:00
- History is always fetched from the gateway (no local file watching).
- If the gateway is unreachable, WebChat is read-only.
2025-12-09 14:41:55 +01:00
2026-02-22 23:55:59 -06:00
## Control UI agents tools panel
- The Control UI `/agents` Tools panel fetches a runtime catalog via `tools.catalog` and labels each
tool as `core` or `plugin:<id>` (plus `optional` for optional plugin tools).
- If `tools.catalog` is unavailable, the panel falls back to a built-in static list.
- The panel edits profile and override config, but effective runtime access still follows policy
precedence (`allow` /`deny` , per-agent and provider/channel overrides).
2025-12-09 14:41:55 +01:00
## Remote use
2026-01-31 21:13:13 +09:00
2026-01-07 00:25:16 +01:00
- Remote mode tunnels the gateway WebSocket over SSH/Tailscale.
- You do not need to run a separate WebChat server.
2025-12-09 14:41:55 +01:00
2026-01-07 00:25:16 +01:00
## Configuration reference (WebChat)
2026-01-31 21:13:13 +09:00
2026-01-07 02:04:02 +01:00
Full configuration: [Configuration ](/gateway/configuration )
2025-12-08 12:50:37 +01:00
2026-01-13 07:15:57 +00:00
Channel options:
2026-01-31 21:13:13 +09:00
2026-01-07 00:25:16 +01:00
- No dedicated `webchat.*` block. WebChat uses the gateway endpoint + auth settings below.
2025-12-08 12:50:37 +01:00
2026-01-07 00:25:16 +01:00
Related global options:
2026-01-31 21:13:13 +09:00
2026-01-07 00:25:16 +01:00
- `gateway.port` , `gateway.bind` : WebSocket host/port.
2026-02-14 12:44:25 +01:00
- `gateway.auth.mode` , `gateway.auth.token` , `gateway.auth.password` : WebSocket auth (token/password).
- `gateway.auth.mode: "trusted-proxy"` : reverse-proxy auth for browser clients (see [Trusted Proxy Auth ](/gateway/trusted-proxy-auth )).
2026-01-07 00:25:16 +01:00
- `gateway.remote.url` , `gateway.remote.token` , `gateway.remote.password` : remote gateway target.
- `session.*` : session storage and main key defaults.