Skip to content

docs(reference): document the readyz protocol fields and the remote-hub config keys - #3173

Merged
lidge-jun merged 1 commit into
devfrom
codex/3158-t19-t21-docs
Sep 1, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/3158-t19-t21-docs

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two of the four follow-ups tracked by #3158 are documentation debt and close here. T2 and T3 are behaviour gaps and stay open.

T19 — /readyz protocol negotiation fields. The remote-hub work added protocol, minimumClientProtocol, and managementUrl to the readiness body (src/server/index.ts spreads readyProtocolMetadata), but reference/cli/lifecycle.md still described the older six-field shape. A client author reading the reference had no way to know negotiation metadata was there. The page now names the three fields, says what each is for, and explains that managementUrl is hub.managementPublicOrigin when runtimeRole is hub and the observed request origin otherwise. It also states explicitly that the CLI's --json output is narrower than the HTTP body, which previously read as a contradiction between two adjacent sentences.

T21 — three undocumented config keys. hub.managementPublicOrigin and remoteGui.allowedTailscaleUsers were named only in passing inside a runtimeRole sentence; remoteGui.allowInsecureHttp appeared nowhere. Each now has a table row with type, default when absent, and the failure mode of getting it wrong — including the pairing that setting the origin without the user list produces a hub that advertises itself correctly and then refuses every session.

One correction worth flagging. The plan for this change assumed allowInsecureHttp was a live security-relevant opt-out and should be documented with a warning. Reading src/types/config.ts and src/server/gui-session.ts shows it is retired: it grants nothing, a pairing grant now crosses loopback or authenticated HTTPS only, and the key is still parsed solely so an older config.json keeps loading under a strict schema. It is documented as retired, with an instruction to remove it — documenting it as an active setting would have been actively misleading.

Refs #3158 (T19, T21).

Verification

Exact head 12ee15157:

  • English source pages only; git diff --stat is two files, +22/-3.
  • rg confirms all four remote-hub keys and the three readiness fields now appear in their reference pages.
  • bun test tests/docs-bun-source-requirement.test.ts — 1 pass, 0 fail.
  • No source change, so no behavioural regression surface. The docs build runs in CI's gates job.

Locales are deliberately untouched. The tr/ja/fr/ru/zh-cn server.md pages already carry the runtimeRole sentence and do not contradict the English source; adding an English-only table to translated pages would be worse than the current gap. That translation work is not attempted here.

Checklist

  • Targets dev
  • Documentation only — no source, config, schema, or dependency change
  • English source pages; translated locales left consistent rather than half-translated
  • No credential, auth, workflow, or release-automation surface touched
  • Claims verified against src/server/index.ts, src/remote/protocol.ts, src/types/config.ts, and src/server/gui-session.ts rather than from the issue text

Summary by CodeRabbit

  • Documentation
    • Documented remote-hub protocol metadata returned by the /readyz endpoint.
    • Clarified that requests without an HTTP(S) origin are rejected, while CLI JSON output remains unchanged.
    • Added reference information for remote hub configuration keys and defaults.
    • Documented requirements for browser-accessible hubs and clarified that the retired insecure HTTP setting has no effect.

…ub config keys

/readyz gained protocol, minimumClientProtocol and managementUrl in the remote-hub
work, but lifecycle.md still described the older six-field body, so a client author
reading the reference had no way to know negotiation metadata was available.

Three config keys shipped without reference coverage. Two were named only in passing
inside a runtimeRole sentence; remoteGui.allowInsecureHttp appeared nowhere. Give each
a row with its type, its default when absent, and what going wrong looks like.

allowInsecureHttp is documented as retired rather than as a setting. It grants nothing
- pairing crosses loopback or authenticated HTTPS only - and is still parsed purely so
an older config keeps loading under a strict schema.

Refs #3158 (T19, T21)
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 1, 2026 16:38
@lidge-jun
lidge-jun merged commit 0d8147c into dev Sep 1, 2026
6 of 7 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-01T16:41:29.556903Z 12ee151 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun
lidge-jun deleted the codex/3158-t19-t21-docs branch September 1, 2026 16:38
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 1, 2026
@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: fe157513-65b9-498e-8733-f065ff9078f4

📥 Commits

Reviewing files that changed from the base of the PR and between 7386b52 and 12ee151.

📒 Files selected for processing (2)
  • docs-site/src/content/docs/reference/cli/lifecycle.md
  • docs-site/src/content/docs/reference/configuration/server.md

📝 Walkthrough

Walkthrough

The documentation adds remote hub configuration details and updates ocx ready documentation for protocol metadata, management URL selection, origin validation, and CLI JSON output.

Changes

Remote hub documentation

Layer / File(s) Summary
Remote hub configuration reference
docs-site/src/content/docs/reference/configuration/server.md
Documents hub origins, management ingress behavior, trusted Tailscale identities, the retired remoteGui.allowInsecureHttp key, and the required configuration combination for browser access.
Readiness response metadata
docs-site/src/content/docs/reference/cli/lifecycle.md
Documents protocol, minimumClientProtocol, and managementUrl in /readyz, HTTP(S) origin validation, and the narrower CLI --json output.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: ingwannu, luvs01

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/3158-t19-t21-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12ee151578

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +277 to +279
A hub that is reachable from a browser needs `hub.managementPublicOrigin` and at least one entry
in `remoteGui.allowedTailscaleUsers`. Setting the origin without the user list produces a hub that
advertises itself correctly and then refuses every session; setting the user list without the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify the allowlist requirement to preserve GUI pairing

When a hub operator uses the supported single-use, origin-bound GUI pairing flow—for example behind a generic TLS frontend without trusted Tailscale identity headers—an empty allowedTailscaleUsers list does not cause the hub to refuse every session. createGuiPairingGrant and consumeGuiPairingGrant in src/server/gui-session.ts mint a pairing session without consulting this allowlist. State that an entry is required only for automatic Tailscale-identity issuance and retain the pairing flow as the alternative.

AGENTS.md reference: docs-site/AGENTS.md:L7-L10

Useful? React with 👍 / 👎.

| `hub.managementPublicOrigin` | string | unset | The canonical browser-reachable management origin a hub advertises, for example the HTTPS origin Tailscale Serve prints. It is what `/readyz` reports as `managementUrl` while `runtimeRole` is `hub`; with it unset the hub falls back to whatever origin each request arrived on, so a client behind a different frontend can be handed an address it cannot reach. |
| `hub.managementIngress` | `{enabled:false}` or `{enabled:true, port}` | `{enabled:false}` | An extra management-only listener for a local HTTPS frontend. The hostname is not configurable: when enabled the socket always binds `127.0.0.1`, and only GUI, session-bootstrap, and management API routes are admitted. Data-plane routes are rejected before dispatch. |
| `remoteGui.allowedTailscaleUsers` | string[] | `[]` (empty — nobody) | Exact Tailscale login identities allowed to be issued an automatic remote GUI session. The `Tailscale-User-Login` header is trusted **only** on the separate management ingress; an empty list means no remote identity can mint a session, which is the safe default rather than an oversight. Identities are compared exactly, so a typo silently denies access. |
| `remoteGui.allowInsecureHttp` | boolean | unset | **Retired — has no effect.** It once permitted a one-time pairing exchange over non-loopback plaintext HTTP. A pairing grant now crosses loopback or authenticated HTTPS only. The key is still parsed so an existing `config.json` keeps loading (the schema is strict, and dropping the key outright would make an older config fail to load entirely); a persisted `true` is reported once and then ignored. Remove it from your config. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the nonexistent retirement warning

When remoteGui.allowInsecureHttp is persisted as true, the schema in src/config.ts accepts it as a valid field, so the malformed-block warning path does not run, and there is no other runtime reporting path for this key. The claim that it is "reported once" therefore promises feedback users never receive; remove that claim or add the corresponding load-time diagnostic.

AGENTS.md reference: docs-site/AGENTS.md:L7-L10

Useful? React with 👍 / 👎.

Comment on lines +164 to +165
is `{service, version, uptime, pid, port, status}` plus the remote-hub protocol fields
`{protocol, minimumClientProtocol, managementUrl}`. `protocol` is the hub protocol this proxy

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Synchronize the translated readiness contract

After declaring these three fields part of the HTTP readiness identity, the translated lifecycle pages still describe the identity as only {service, version, uptime, pid, port, status} (for example fr/reference/cli/lifecycle.md:125 and zh-tw/reference/cli/lifecycle.md:124). Because parseRemoteReadyMetadata treats the protocol fields as mandatory, those localized contracts now contradict the canonical page; update the directly affected translations to include the fields and their semantics.

AGENTS.md reference: docs-site/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

tarunravi pushed a commit to tarunravi/opencodex that referenced this pull request Sep 14, 2026
…ub config keys (lidge-jun#3173)

/readyz gained protocol, minimumClientProtocol and managementUrl in the remote-hub
work, but lifecycle.md still described the older six-field body, so a client author
reading the reference had no way to know negotiation metadata was available.

Three config keys shipped without reference coverage. Two were named only in passing
inside a runtimeRole sentence; remoteGui.allowInsecureHttp appeared nowhere. Give each
a row with its type, its default when absent, and what going wrong looks like.

allowInsecureHttp is documented as retired rather than as a setting. It grants nothing
- pairing crosses loopback or authenticated HTTPS only - and is still parsed purely so
an older config keeps loading under a strict schema.

Refs lidge-jun#3158 (T19, T21)

Co-authored-by: jun <jun@lidge.dev>
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…ub config keys (lidge-jun#3173)

/readyz gained protocol, minimumClientProtocol and managementUrl in the remote-hub
work, but lifecycle.md still described the older six-field body, so a client author
reading the reference had no way to know negotiation metadata was available.

Three config keys shipped without reference coverage. Two were named only in passing
inside a runtimeRole sentence; remoteGui.allowInsecureHttp appeared nowhere. Give each
a row with its type, its default when absent, and what going wrong looks like.

allowInsecureHttp is documented as retired rather than as a setting. It grants nothing
- pairing crosses loopback or authenticated HTTPS only - and is still parsed purely so
an older config keeps loading under a strict schema.

Refs lidge-jun#3158 (T19, T21)

Co-authored-by: jun <jun@lidge.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant