Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
94b9e8f
docs: WebSocket host link spec and plan
andrebrait Oct 31, 2026
1d1bcac
docs: record the WebSocket link probe
andrebrait Oct 31, 2026
a11955a
feat(hosts): ack message, close codes and binary result frames for th…
andrebrait Oct 31, 2026
2fd9469
feat(hosts): the host daemon links over one WebSocket
andrebrait Oct 31, 2026
e91c6db
fix(hosts): no dial after stop; contain handler errors
andrebrait Oct 31, 2026
a6fcb7b
feat(hosts): the web server takes host links over one WebSocket
andrebrait Oct 31, 2026
dd24dda
fix(hosts): refuse a revoked host's hello, cap the first frame, conta…
andrebrait Oct 31, 2026
1b9372e
test(hosts): run the link integration test over a real WebSocket
andrebrait Oct 31, 2026
bea3904
fix(hosts): pace the downlink from the outbox instead of bursting
andrebrait Oct 31, 2026
c7e2b6b
docs: describe the WebSocket host link
andrebrait Oct 31, 2026
7d364a5
docs: correct shutdown close, stale rows and the slow-link floor
andrebrait Oct 31, 2026
fe5c923
docs: the ai-web proxy is Traefik, not nginx
andrebrait Oct 31, 2026
ac5c4dd
docs(hosts): design link pieces and fair sending (protocol 5)
andrebrait Nov 1, 2026
5871623
feat(hosts): link protocol 5 sends large messages in fair 256 KiB pieces
andrebrait Nov 1, 2026
807e8e4
docs(hosts): describe link pieces and fair sending (protocol 5)
andrebrait Nov 1, 2026
381fd2c
fix(hosts): sender and joiner bounds for link pieces
andrebrait Nov 1, 2026
f6c6326
fix(hosts): bound unacked link data below the socket in both directions
andrebrait Nov 1, 2026
f934e9e
docs(hosts): describe the unacked link window
andrebrait Nov 1, 2026
b34c61d
fix(hosts): no unacked window for v4 daemons; pin the window and rese…
andrebrait Nov 1, 2026
1f912d7
docs(hosts): v4 daemons get no unacked window
andrebrait Nov 1, 2026
cc67982
fix(hosts): unacked link window of 2 pieces (512 KiB), not 4
andrebrait Nov 1, 2026
0f6222f
docs: label the remote host link WebSocket in the architecture diagrams
andrebrait Nov 2, 2026
3a8284c
docs: link protocol version 5 with minimum 4; a v4 daemon links besid…
andrebrait Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 69 additions & 48 deletions AGENTS.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f

### Fixes & Improvements

- **ompweb now runs on Bun instead of Next.js.** The npm package brings its own Bun, so installs and updates work as before, with no change to URLs, ports, settings or the password gate. Host link uploads are no longer cut at 10 MB. `OMP_WEB_DEV_ORIGIN` is removed: it only configured the Next development server. `npm run build` no longer interferes with `npm run dev`. The skills.sh search now gives up after 10 s and falls back to the `skills find` CLI instead of waiting on a stalled skills.sh.
- **The host link is now one WebSocket**, with fewer requests and large results sent in the same connection. A reverse proxy in front of ompweb must forward WebSocket upgrades on `/api/hosts/link` (see the README's hosts section). Update ompweb on the server first, then on its hosts: a host linked with an earlier build of this release shows **needs upgrade** until it is updated.
- **ompweb now runs on Bun instead of Next.js.** The npm package brings its own Bun, so installs and updates work as before, with no change to URLs, ports, settings or the password gate. `OMP_WEB_DEV_ORIGIN` is removed: it only configured the Next development server. `npm run build` no longer interferes with `npm run dev`. The skills.sh search now gives up after 10 s and falls back to the `skills find` CLI instead of waiting on a stalled skills.sh.
- **If you start ompweb from a terminal (`ompweb` or `npx`), start it again once after the in-app update to this version.** The launcher that is already running applies the update and then tries to restart the server with Next, which the update removed, so the server does not come back. systemd, launchd and the tray start the new launcher and are not affected.
- Browsers older than Safari 16.2 or Chrome 111 lose the colours ompweb mixes with `color-mix()` (tints, borders and focus rings), which no longer carry a solid fallback. Those browsers were outside the Next.js build's targets too.
- **The service installers set up the host daemon too.** `ompweb systemd install`, `ompweb-launchd install` and the Windows tray install now register `ompweb host` as a second unit (`ompweb-host`) next to the web service, restarting it after a 10 s delay so it can wait for the web server to write its host link on first install. `uninstall` and `status` cover both, and the tray menus show the daemon state.
- **Forking a session or editing a message asks first.** The Fork button under a message and the Edit button under your own message now open a confirmation dialog, so a stray tap while scrolling no longer creates a new session or rewinds the current one.
- **In-app updates work when ompweb runs as a systemd service.** The update worker ran inside the service's cgroup, so stopping the server killed the worker too: nothing was installed, the service could stay down (`Restart=on-failure` does not restart a clean SIGTERM exit), and every page load reopened the update dialog at "Stop ompweb-managed sessions". The worker now runs in its own transient scope (`systemd-run --scope`) and stops, updates and starts the unit through `systemctl`, starting it again if the install fails.
- **An update whose worker died is reported as failed.** A running update whose worker process is gone, or whose lease has expired, now becomes a failed attempt the dialog can show and clean up, instead of waiting forever.
- **Upgrade ompweb before its hosts.** The web server links a host daemon one link protocol version older than its own, so a host keeps running sessions until its `ompweb` is updated; after a web restart that daemon's live runs are resumed rather than adopted. A daemon older than that, or newer than the web server, is still asked to upgrade.
- **Upgrade ompweb before its hosts.** The web server links a host daemon one link protocol version older than its own, so a host keeps running sessions until its `ompweb` is updated. After a web restart the server adopts that daemon's live runs, as it does a current daemon's, without resuming them; only a large message from such a host still arrives whole instead of in pieces, which can stall that host's link on a slow connection. A daemon older than that, or newer than the web server, is still asked to upgrade.
- **The Provider Usage header stays put while its list scrolls.** Scrolling a long provider list in the sidebar also scrolled the section header (title, window toggle, refresh) out of view, on desktop and mobile. Only the list scrolls now.

---
Expand Down
13 changes: 6 additions & 7 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ through the link described below. The implementation on the web server is
the machine whose omp it owns.

```
Browser ─▶ ompweb ◀── link (loopback) ── ompweb host ── spawn omp --mode rpc-ui (stdio)
◀── link (HTTP) ── ompweb host on another machine
└─ spawn omp --mode rpc-ui
Browser ─▶ ompweb ◀── link (loopback) ── ompweb host ── spawn omp --mode rpc-ui (stdio)
◀── link (WebSocket) ── ompweb host on another machine
└─ spawn omp --mode rpc-ui
```

"This machine" is the host with the fixed id `local`, linked to the daemon
Expand All @@ -106,10 +106,9 @@ knowing where omp runs. Session routes address a session by id; the owning
host resolves the file path, so a remote path never reaches the serving
machine's filesystem.

The link is two HTTP requests that the `ompweb host` daemon opens to the
server: a long-lived response for server → daemon and batched POSTs for
daemon → server. There is no WebSocket yet: the route handlers
are plain `Request` → `Response` functions. The daemon
The link is one WebSocket that the `ompweb host` daemon opens to the
server: text frames carry the messages in both directions and binary frames
carry large op results (daemon → server). The daemon
forwards omp's NDJSON unchanged and answers a fixed allow-list of host
operations; there is no generic exec or file-read operation. A host is
trusted like the serving machine: control of the server or of a host token is
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ everything else on it: they resume when it wakes, and the link returns then. A
docked or no-sleep setup keeps running with the lid closed. Revoking a host in
Settings closes its link and the daemon stops its omp processes.

Behind a reverse proxy, forward WebSocket upgrades on `/api/hosts/link` (nginx: `proxy_http_version 1.1;`, `proxy_set_header Upgrade $http_upgrade;`, `proxy_set_header Connection "upgrade";`, and a `proxy_read_timeout` well above 30 s).

Update ompweb on the server before its hosts: a host from before this version shows **needs upgrade** until it is updated.

Notes:

- **Service helpers:** `ompweb systemd install` and `ompweb launchd install` set up
Expand Down
7 changes: 0 additions & 7 deletions app/api/hosts/link/blob/[reqId]/route.ts

This file was deleted.

18 changes: 8 additions & 10 deletions app/api/hosts/link/route.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { handleLinkGet, handleLinkPost } from "@/lib/hosts/hub";
import { handleLinkUpgrade, handleOutdatedLinkPost, type LinkSocketData } from "@/lib/hosts/hub";

// The `ompweb host` daemon's link (lib/hosts/hub.ts). proxy.ts does not run
// for this path: the hub checks the host's bearer token before reading a body,
// and only then lifts Bun's idle timeout (disableIdleTimeout, server/app.ts).
type Context = { disableIdleTimeout: () => void };
// for this path: the hub checks the host's bearer token before it upgrades.

// GET /api/hosts/link — downlink: a long-lived NDJSON stream, server → daemon.
export function GET(req: Request, { disableIdleTimeout }: Context) {
return handleLinkGet(req, disableIdleTimeout);
// GET /api/hosts/link — the link's WebSocket; undefined once upgraded (server/app.ts).
export function GET(req: Request, { upgrade }: { upgrade: (data: LinkSocketData) => boolean }) {
return handleLinkUpgrade(req, upgrade);
}

// POST /api/hosts/link — uplink: a batch of NDJSON messages, daemon → server.
export function POST(req: Request, { disableIdleTimeout }: Context) {
return handleLinkPost(req, disableIdleTimeout);
// POST /api/hosts/link — only refuses a daemon from before the WebSocket (its hello POST) with 426.
export function POST(req: Request) {
return handleOutdatedLinkPost(req);
}
Loading
Loading