Skip to content

feat(ui): adopt shared libterminal runtime - #100128

Merged
steipete merged 1 commit into
mainfrom
codex/adopt-libterminal
Jul 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/adopt-libterminal

Conversation

@steipete

@steipete steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Closes #100126

AI-assisted: yes. The implementation was reviewed locally with Codex autoreview; no agent transcript is attached pending explicit approval.

What Problem This Solves

Fixes an issue where Control UI terminal users could see prompt glyphs as placeholder boxes when an installed Nerd Font was absent from the browser font stack. It also removes the Control UI's duplicate ownership of renderer initialization, fitting, input, resizing, and disposal.

Why This Change Was Made

The Control UI now uses @openclaw/libterminal/browser for browser-side terminal lifecycle while retaining the existing Gateway JSON-RPC terminal session, authorization, sandboxing, reattachment, and process-management backend. Common Nerd Font families are included in the monospace fallback stack, and an exact Vite alias keeps the package import outside the broad source-plugin alias.

User Impact

Control UI terminal sessions use OpenClaw's shared terminal runtime. Users with a common Nerd Font installed get readable prompt symbols without changing terminal settings, while existing Gateway terminal behavior remains unchanged.

Evidence

  • node scripts/run-vitest.mjs ui/src/components/terminal/terminal-panel.test.ts ui/src/app/vite-config.node.test.ts — 2 files, 6 tests passed.
  • node scripts/run-oxlint.mjs ui/src/components/terminal/terminal-panel.ts ui/src/components/terminal/terminal-panel.test.ts ui/src/components/terminal/terminal-theme.ts ui/src/app/vite-config.node.test.ts ui/vite.config.ts — passed.
  • pnpm ui:build — passed; 983 modules transformed and the Ghostty renderer remained a lazy chunk.
  • pnpm install --lockfile-only --frozen-lockfile --ignore-scripts — passed, including supply-chain policy.
  • Testbox tbx_01kwqvkqsrjmgzyq26558zw3kt — full changed-surface typecheck, lint shards, dependency checks, package shrinkwraps, state guards, runtime sidecars, and import-cycle check passed: https://github.com/openclaw/openclaw/actions/runs/28724685256
  • Fresh Codex autoreview: no accepted or actionable findings; overall correctness 0.94.
  • Regression coverage verifies the libterminal adapter, Gateway input/resize forwarding, post-adoption grid resize, Nerd Font fallback, and exact Vite alias.

Visual after-proof was not captured because the existing Chrome-profile bridge lacked its native-host manifest. The reported macOS system had MesloLGLDZ Nerd Font Mono installed; the configured and tested fallback now includes it.

@steipete
steipete requested a review from a team as a code owner July 5, 2026 00:53
@steipete steipete self-assigned this Jul 5, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • pnpm-lock.yaml
  • ui/package.json

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: f96f2df5ad672b87c462c9a092f16dabfa5ac345
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(ui): adopt shared libterminal runtime This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

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

Copy link
Copy Markdown
Contributor

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: f96f2df5ad

ℹ️ 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".

const tabRef = { current: undefined as TerminalTabState | undefined };
let controller: GhosttyTerminalController;
try {
controller = await createGhosttyTerminal({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Register tabs before awaiting terminal creation

When the panel is detached or available flips false while this await createGhosttyTerminal(...) is still pending, disposeAllTabs() has no tab to mark cancelled because the tab is only added after the await. The continuation can then add a tab to a disconnected/unavailable panel and proceed to terminal.open, leaking a gateway session or stale listener during navigation/reconnect races; before this change the tab was registered before the async render/open window, so teardown could cancel it.

Useful? React with 👍 / 👎.

@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at exact PR head f96f2df5ad672b87c462c9a092f16dabfa5ac345.

Review: zero findings; direct @openclaw/libterminal v0.3.1 browser contract checked. Browser lifecycle moves to libterminal while the existing Gateway authorization, sandbox, reattachment, and PTY process-management boundary remains unchanged.

Validation:

Known proof gap: no after screenshot because the required existing Chrome-profile bridge lacked its native-host manifest. The observed Mac has MesloLGLDZ Nerd Font Mono installed, and the new configured/tested fallback includes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui dependencies-changed PR changes dependency-related files maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Adopt shared libterminal runtime in Control UI

1 participant