Skip to content

Fix remote tmux seed/live output ordering - #8436

Merged
austinywang merged 28 commits into
mainfrom
issue-7990-tailscale-mirror-echo
Jul 22, 2026
Merged

austinywang merged 28 commits into
mainfrom
issue-7990-tailscale-mirror-echo

Conversation

@austinywang

@austinywang austinywang commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • make each remote-tmux capture/state cycle a UUID-correlated pane-seed transaction
  • reconcile live %output around the authoritative capture boundary instead of depending on SSH latency or read chunks
  • filter authoritative snapshots independently from the stateful live title stream, then replay post-capture output exactly once
  • bound pending seed memory and use the existing reconnect/reseed path on overflow
  • keep lifecycle failure/rollback on one shared pending-command transaction path

Root cause

The mirror delivered live output while capture-pane and pane-state replies independently repainted the same surface. Which write won depended on transport timing, and a live screen-title filter could be left mid-escape when synthetic snapshot bytes arrived. Tailscale SSH exposed both ordering assumptions through different latency and chunk boundaries.

Regression coverage

The test-only first commit feeds the real incremental control parser with deterministic uneven transport chunks and covers:

  • typed echo split around the capture result
  • an ESC k screen-title sequence split across the snapshot boundary

The fix commit adds typed-seed observer coverage, including the no-duplicate compatibility contract.

A manual CI run was started on the test-only commit to record red/green status, but the existing strict determinism guard failed first on three unrelated sleep-then-assert findings in MobileShellRenderGridLivenessTests.swift. That preflight skipped the app-host tests, so the PR keeps the requested two-commit test/fix structure without claiming that unrelated CI red as regression proof.

Validation

  • tagged Debug build: ./scripts/reload.sh --tag issue-7990-tailscale-mirror-echo
  • Swift warning budget: 0 new cmux-owned warnings
  • pbxproj normalization/object-version guard
  • cmuxTests project wiring lint: 529 files checked
  • swiftc parse and git diff check
  • line budget: both existing 500+ line files shrink (990 to 984; 609 to 590); every new Swift file is under 500 lines
  • localization audit: no user-facing strings introduced

Closes #7990

Summary by CodeRabbit

  • New Features

    • Added an optional pane-seed observer callback to deliver authoritative pane snapshots with ordered live cutover, including seeded output routing.
    • Enhanced pane capture/reseed to use correlated pane-seed IDs and support optional scrollback clearing.
  • Bug Fixes

    • Improved pane-seed buffering/cutover to prevent early/duplicate live output and ensure exact-once, in-order replay (including reconnect and title-escape boundary safety).
    • Refined window/surface repaint behavior for verified single-pane grid growth.
  • Tests

    • Added regression coverage for uneven transport chunking, blank lines inside command blocks, reconnect/cutover edge cases, and pane grid growth command sequencing.

Loading
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.

remote-tmux: mirror shows duplicated input echo and drops prompt lines on attach — only over Tailscale SSH transport

1 participant