Skip to content

Show the Hub's version, OS, uptime and activity (v1.66.0) - #145

Merged
gmpassos merged 2 commits into
masterfrom
feat/hub-info
Oct 25, 2026
Merged

gmpassos merged 2 commits into
masterfrom
feat/hub-info

Conversation

@gmpassos

Copy link
Copy Markdown
Contributor

What

A signed-in client can now see what the Hub is running. The information is shown in three places:

  • omnyshell hub info prints it as text; --json prints it as JSON for scripts and bug reports.
  • Dashboard → Hub tab (key 5, or Tab from AI). Scrolls, and r refreshes it. If a refresh fails, the last result stays on screen.
  • :hub prints it inside a session. :info also gains a Hub Version line.

What it shows:

Section Rows
Identity URL, UID, signed-in principal
System OS, OS version, arch, CPUs, hostname
OmnyShell version (compared with this client), Dart runtime, protocol range
Activity start time, uptime, nodes (online), clients, sessions, your tunnels
Features tunneling (port range or disabled), default AI provider

How

  • New messages: hub.info.request / hub.info.response, correlated by requestId, carrying a new HubInfo entity. The entity is web-safe and exported from both client barrels.
  • Only after login: the Hub answers only authenticated clients. Nothing is added to the pre-auth hello, so a peer that can merely reach the port can't use this to fingerprint the Hub.
  • Older Hubs: AuthOk now carries an optional hubVersion. Hubs older than 1.66.0 leave it out. Without it the client knows the Hub can't answer and throws HubTooOldException immediately. Otherwise it would wait 20 seconds for a reply, because old Hubs silently drop unknown message types.
  • Uptime is measured on the Hub's clock, so a client with a wrong clock can't distort it.
  • Counts: the tunnel count covers only the caller's own tunnels.
  • AI provider, not key: the AI row shows the Hub's default provider name and never the key. A yes/no "AI proxy" flag would be meaningless, because the proxy is always on.
  • Shared formatting: hubInfoSections / hubInfoLines render the rows for the CLI, :hub and the dashboard, so all three show the same thing. Text printed to the terminal has control characters removed.
  • Dashboard: the node Info renderer became a generic _renderInfoRows, shared by the node Info tab and the Hub tab.

Not included

  • TLS certificate fingerprint and expiry. The Hub hot-reloads its certificate and doesn't keep the current one in a readable form. Possible follow-up.
  • Hostname and OS version visibility. They are shown to every authenticated user, as node hostnames already are. Restricting them to admins would be a small change.

Tests

  • Message round-trips, including AuthOk.hubVersion both present and absent.
  • Against a live Hub: version, platform, node/client/session/tunnel counts, port range, AI provider, and that the API key never appears.
  • An old Hub (no hubVersion) raises HubTooOldException and no request is sent.
  • Dashboard Hub tab: content, status line, Tab cycling, old Hub, failed refresh keeps the last result, scrolling.
  • :hub sections, control-character stripping, old Hub; the Hub Version line in :info.
  • The formatting helpers: uptime, version label, protocol range, alignment.
  • Manual check: a compiled omnyshell hub info (text and --json) against a locally started Hub.

dart analyze is clean and dart test passes (1557).

Release

The version moves to 1.66.0 in pubspec.yaml and lib/src/version.dart (1.65.0 is tagged), with a CHANGELOG section. The README and doc/protocol.md are updated.

🤖 Generated with Claude Code

gmpassos and others added 2 commits October 25, 2026 02:51
The Hub now describes itself to authenticated clients through a new
hub.info.request / hub.info.response pair. Only signed-in clients get it;
nothing is added to the pre-auth hello.

AuthOk now carries hubVersion. A Hub older than 1.66.0 leaves it out, so
the client reports it as too old right away instead of timing out on a
request that Hub would drop.

Surfaced in three places, all built from the same hubInfoSections:
- omnyshell hub info [--json]
- a Hub tab in the dashboard (key 5)
- the :hub local command; :info also shows the Hub version

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes:
- The dashboard drops the Hub description on every connect or login, so a
  reconnect, possibly to a different Hub, no longer shows the previous Hub's
  data under the new URL.
- ClientRuntime.hubInfo() reports HubTooOldException and not-connected
  through the returned future instead of throwing synchronously.
- The broker captures the Hub's platform once instead of on every request.
- One shared stripControlChars (shared/utils/terminal_text.dart) replaces
  two private copies.
- One scroll helper is shared by the node Info and Hub tabs.
- The withLocalDefaults doc lists :hub; the CHANGELOG notes the
  DashboardBackend.hubInfo() addition for embedders.

Tests:
- Broker: the login reply carries hubVersion; an unauthenticated
  hub.info.request is refused; uptime runs on the Hub clock.
- Live Hub: session counts are shared, tunnel counts are per caller; a
  dropped connection fails a pending hubInfo.
- The real `omnyshell hub info` binary: text sections, --json, and a
  rejected token.
- Dashboard: a reconnect never shows the previous Hub's description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@gmpassos
gmpassos merged commit 8800648 into master Oct 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant