Skip to content

fix(tui): make attached frontends match source state - #8476

Closed
lawrencecchen wants to merge 30 commits into
codex/cmux-tui-viewer-lease-releasefrom
codex/cmux-tui-frontend-parity
Closed

lawrencecchen wants to merge 30 commits into
codex/cmux-tui-viewer-lease-releasefrom
codex/cmux-tui-frontend-parity

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #8475. Consumed by cmux Browser #14, which pins this exact commit (768c8d3f99a3b04294a6305a555cc48af638e7a1) and Manaflow Ghostty d6f611a3077aa12510761ca10e2a5e0a93979536.

The complete stack contains canonical cmux main b5631833741d0a1a2c25ede49988eadf2f412dd2.

Summary

  • mirror authoritative source colors, resolved cursor visuals, screen/cursor activity, and exact VT state into attached frontends
  • publish pane/tab/screen/workspace selection from an attached TUI back to the owner mux
  • acknowledge attachment-scoped viewer sizes so the canonical PTY follows the smallest live viewer
  • require canonical workspace UUIDs and preserve armed mouse releases across routing refresh/recovery
  • add local-only, PID/generation-fenced daemon handoff while durable per-terminal hosts remain alive
  • make hosted daemon Ghostty surfaces response-silent; the durable terminal host remains the sole authority for Kitty/DA/DSR replies
  • drain the bounded Kitty graphics probe after recognition so delayed response bytes cannot leak into a shell
  • retain live rendered viewport bounds after introducing the terminal-size cache, restoring mouse text selection

These focused attach, registry, state, resize, input, and handoff APIs are sufficient for cmux Browser. Another broad custom-frontends abstraction is not required.

State and failure semantics

  • cmux TUI is the only writer for canonical workspace and terminal lifecycle.
  • Browser and attached TUI models are projections; Browser-only layout lives in an opaque versioned frontend projection.
  • The PTY-owning host survives daemon, Browser, renderer, and attached-frontend replacement.
  • Hosted mirrors parse state for projection but never write parser-generated terminal responses back into the PTY.
  • Recovery retains release-only mouse tombstones to prevent a stuck button after an uncertain downstream flush. Exact-once observation would require tokenized host-side input acknowledgements/deduplication.

Latest-main regression audit

The stacked tip was compared directly with canonical main rather than only tested in isolation. That exposed nine stack-only Clippy warnings, a stale rendered-bounds selection regression, and a smoke assertion that incorrectly assumed indexed foreground SGR would never share an escape with background state.

This tip clears every warning, restores live bounds, and makes the smoke parser recognize exact SGR commands without stripping valid combined foreground/background output. Indexed and RGB operands are consumed atomically, so an operand value such as 31 cannot falsely satisfy a foreground-red assertion.

Validation

  • cargo fmt --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo check --workspace --all-targets --locked
  • cargo test --workspace --locked
  • cargo build -p cmux-tui --locked
  • python3 scripts/smoke-tui.py (SMOKE OK)
  • python3 scripts/smoke-attach.py (ATTACH SMOKE OK)
  • TypeScript SDK build and 41 tests
  • web frontend production build and 150 tests
  • exact revision-stamped release artifact reports cmux 768c8d3... and Ghostty d6f611a...; all 585 bundled Ghostty resource hashes verify
  • consuming Browser PR: 23/23 host suites, including 149 renderer-ordering checks and 87 TUI-protocol checks

@vercel

vercel Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jul 19, 2026 2:55pm
cmux-staging Building Building Preview, Comment Jul 19, 2026 2:55pm

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a9ddf784-6a81-4e87-b6d9-12f85b191581

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cmux-tui-frontend-parity

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.

@lawrencecchen
lawrencecchen force-pushed the codex/cmux-tui-frontend-parity branch from 0b34c26 to b3e87d4 Compare July 20, 2026 02:58
@lawrencecchen
lawrencecchen force-pushed the codex/cmux-tui-viewer-lease-release branch from 021a8e3 to 293b538 Compare July 20, 2026 02:58
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Superseded and landed cumulatively in #8717 (merge commit ea51d55). Closing this review-stack entry so the merged main branch is the canonical review surface.

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