← Back to PRs

#11528: feat(control-ui): configurable page title with hostname default

by Annaxiebot open 2026-02-07 23:14 View on GitHub →
app: web-ui gateway stale
## Problem When running multiple OpenClaw instances (laptop, server, VM, etc.), all browser tabs show the same title "OpenClaw Control". The only way to distinguish them is by URL, which is not practical. ## Solution Add a `gateway.controlUi.pageTitle` config option that: - Defaults to `<hostname> - OpenClaw Control` using `os.hostname()` (so it works out of the box) - Can be overridden in config to any custom string - Is injected server-side when serving `index.html` (no client-side changes needed) - Is HTML-escaped to prevent injection ## Config example ```json { "gateway": { "controlUi": { "pageTitle": "My Server - OpenClaw Control" } } } ``` If not set, a machine named `MateBook` would show: **MateBook - OpenClaw Control** ## Changes - `src/config/types.gateway.ts`: Add `pageTitle` to `GatewayControlUiConfig` - `src/config/zod-schema.ts`: Add to validation schema - `src/config/schema.ts`: Add labels, descriptions, examples - `src/gateway/control-ui.ts`: Inject title in `injectControlUiConfig()`, add `os.hostname()` default ## Use case Running OpenClaw on a MateBook (WSL) and a MacOS VM — need to tell the tabs apart. Currently requires post-install `sed` patching that breaks on every update. This makes it a first-class config option. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Adds a new `gateway.controlUi.pageTitle` configuration option (with UI schema metadata + zod validation) and wires it into the Control UI index.html server-side injection. On the gateway side, `injectControlUiConfig()` now computes a default title from `os.hostname()` and attempts to replace the static `<title>` in the served HTML, while still injecting the existing `window.__OPENCLAW_*` globals. <h3>Confidence Score: 4/5</h3> - Mostly safe to merge, but there is one functional issue where title injection can be skipped in some scenarios. - Changes are small and localized, with config/schema updates consistent across types + zod + UI hints. The main concern is the early-return in `injectControlUiConfig()` which can prevent applying the page title when the HTML already contains the injected globals or the function is invoked more than once. - src/gateway/control-ui.ts <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs