feat(control-ui): show non-main gateway checkout branch in sidebar footer#104262
Conversation
…oter Source-checkout (non-release) gateways now report their git branch in the Control UI bootstrap config; the sidebar footer renders it in red next to the connection dot. Package installs, main/master, and detached HEAD never show it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e7ebe66a5
ℹ️ 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".
| .gatewayVersion=${context.config.current.serverVersion ?? | ||
| gatewaySnapshot.hello?.server?.version ?? | ||
| null} | ||
| .devGitBranch=${context.config.current.devGitBranch} |
There was a problem hiding this comment.
Source the branch from the connected Gateway
Here the sidebar reads context.config.current.devGitBranch, but that config is loaded from the page-relative /control-ui-config.json rather than the selected gateway.connection.gatewayUrl. When the supported Gateway URL flow connects a page served by one Gateway to a different remote Gateway, the badge reflects the page-serving checkout (or disappears) instead of the connected Gateway, so operators can still miss that the remote Gateway under test is on a feature branch.
Useful? React with 👍 / 👎.
…oter (openclaw#104262) Source-checkout (non-release) gateways now report their git branch in the Control UI bootstrap config; the sidebar footer renders it in red next to the connection dot. Package installs, main/master, and detached HEAD never show it.
What Problem This Solves
Operators who run the gateway from a source checkout (dev installs) have no visual cue in the Control UI when that gateway is on a feature branch instead of
main. It is easy to test against a stale or experimental branch without noticing, because the sidebar footer only shows a connection dot.Why This Change Was Made
The gateway now resolves its own checkout branch once per process (
src/infra/dev-install-branch.ts) and ships it in the Control UI bootstrap config asdevGitBranch. The value is only present for source-checkout installs whose package root is itself the git toplevel — the same install-kind ruleupdate-checkuses — and is suppressed formain,master, and detached HEAD. Release (npm/package) installs never report a branch, so the badge cannot appear there. The sidebar footer renders the branch in the danger color next to the connection dot, truncating with an ellipsis when the sidebar is narrow.User Impact
When the gateway runs from a git checkout on a non-
mainbranch, the sidebar footer shows that branch name in red. Release installs and mainline checkouts are unchanged.Evidence
Footer with a dev branch active (from the e2e run's screenshot artifact):
src/infra/dev-install-branch.test.ts— resolver behavior: feature branch reported; null for package installs, nested installs,main/master/detached HEAD, and git failures (9 tests, Testbox).src/gateway/control-ui.http.test.ts— bootstrap config includesdevGitBranchwhen the resolver reports a branch and omits it otherwise (312 tests across 4 gateway lanes, Testbox).ui/src/e2e/sidebar-dev-branch.e2e.test.ts— mocked-gateway Playwright proof: badge text/title match the branch, computed color equals the resolved--dangertoken, badge absent without a branch (2 tests, Testbox).pnpm check:changedand autoreview: results in PR comments/commits below.