Improve built-in terminal reliability and remote replay performance - #1076
Merged
ymichael merged 2 commits intoAug 7, 2026
Merged
Conversation
ymichael
force-pushed
the
bb/ide-3-4-terminal-reliability
branch
from
August 7, 2026 17:40
9226b7a to
beee3ad
Compare
ymichael
added a commit
that referenced
this pull request
Aug 7, 2026
## Summary - let GitHub CLI resolve pull requests from the checked-out branch and its configured upstream - fix prompt-banner PR detection for branches tracking contributor forks - apply the same tracking-aware resolution to ready, draft, and merge actions - preserve detached-head and lookup-failure behavior ## Reproduction PR #1076 checked out a branch that tracked Diffuzmetall/bb. Passing its bare branch name to gh pr view searched the base repository and returned no pull request. Running gh pr view from the worktree without a positional target followed the fork upstream and found the PR. ## Validation - 185 host-workspace tests passed - host-workspace and host-daemon typechecks passed - verified the current-branch helper resolves same-repository and fork-backed pull requests and still reports no PR for main ## Commands - pnpm exec turbo run test --filter=@bb/host-workspace --force - pnpm exec turbo run typecheck --filter=@bb/host-workspace --filter=@bb/host-daemon
amadad
pushed a commit
to amadad/bb
that referenced
this pull request
Aug 14, 2026
…et-bb#1076) Closes get-bb#1075. ## Summary - batch raw PTY output into ordered chunks and preserve arbitrary UTF-8/binary bytes end to end - add bounded browser and daemon websocket backpressure, bad-socket isolation, heartbeat/reconnect, input queuing, and sequence deduplication - reconnect from the last received sequence and bound initial browser replay to the latest 512 KiB instead of replaying the full 4 MiB scrollback on every open - serialize terminal restart, open the replacement before closing the old PTY, and wait for daemon exit acknowledgement so final output precedes exit - keep threadless terminal caches current, make latest-attached clients own resize, and restore ownership on failed attach/detach - enable xterm Unicode 11 width rules and Nerd Font fallbacks - bump the host-daemon protocol from 75 to 76 for byte-preserving input and required bounded-replay fields ## Measurements ### Sustained output A local 16 MiB output probe improved from about 6.5 MiB/s to 53–63 MiB/s. Websocket output messages dropped from 16,386 to 258–480 depending on PTY chunking. Input remained responsive during a 16 MiB remote flood. Over the Tailscale path used for QA, the full burst completed without disconnect while a concurrent input echo returned in 101 ms. ### Reopening a populated remote terminal Measured through an SSH tunnel to a patched VPS: | | Before | After | |---|---:|---:| | Time to final replayed line | 2,210 ms | 556 ms | | Replay bytes | 4,192,407 | 461,853 | | Websocket output messages | 1,025 | 15 | A subsequent reconnect requested the previous `nextSeq` and replayed only 319 bytes rather than the retained history. ### Input integrity A 200,009-byte payload containing emoji and combining characters crossed multiple 64 KiB request boundaries on the VPS with an exact SHA-256 match. CLI `--stdin` also has coverage for invalid UTF-8 bytes. ## Validation On current `main`: - `pnpm exec turbo run typecheck` for app, CLI, host daemon, host-daemon contract, server, SDK, server contract, and templates - 191 focused tests across app terminal UI/transport/controller, CLI terminal commands, daemon connection/PTY manager, server hub/routes, and both contracts - production builds for app, CLI, server, and host daemon - patched local and VPS live stacks, including latency, flood/backpressure, atomic restart, large paste, replay truncation, reconnect, and multi-client resize ownership --------- Co-authored-by: Michael Yong <wrong92@gmail.com>
amadad
pushed a commit
to amadad/bb
that referenced
this pull request
Aug 14, 2026
## Summary - let GitHub CLI resolve pull requests from the checked-out branch and its configured upstream - fix prompt-banner PR detection for branches tracking contributor forks - apply the same tracking-aware resolution to ready, draft, and merge actions - preserve detached-head and lookup-failure behavior ## Reproduction PR get-bb#1076 checked out a branch that tracked Diffuzmetall/bb. Passing its bare branch name to gh pr view searched the base repository and returned no pull request. Running gh pr view from the worktree without a positional target followed the fork upstream and found the PR. ## Validation - 185 host-workspace tests passed - host-workspace and host-daemon typechecks passed - verified the current-branch helper resolves same-repository and fork-backed pull requests and still reports no PR for main ## Commands - pnpm exec turbo run test --filter=@bb/host-workspace --force - pnpm exec turbo run typecheck --filter=@bb/host-workspace --filter=@bb/host-daemon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1075.
Summary
Measurements
Sustained output
A local 16 MiB output probe improved from about 6.5 MiB/s to 53–63 MiB/s. Websocket output messages dropped from 16,386 to 258–480 depending on PTY chunking.
Input remained responsive during a 16 MiB remote flood. Over the Tailscale path used for QA, the full burst completed without disconnect while a concurrent input echo returned in 101 ms.
Reopening a populated remote terminal
Measured through an SSH tunnel to a patched VPS:
A subsequent reconnect requested the previous
nextSeqand replayed only 319 bytes rather than the retained history.Input integrity
A 200,009-byte payload containing emoji and combining characters crossed multiple 64 KiB request boundaries on the VPS with an exact SHA-256 match. CLI
--stdinalso has coverage for invalid UTF-8 bytes.Validation
On current
main:pnpm exec turbo run typecheckfor app, CLI, host daemon, host-daemon contract, server, SDK, server contract, and templates