Skip to content

Reapply the native single-view adapter with a terminating parity E2E - #1117

Merged
h0x91b merged 2 commits into
mainfrom
fix/dev3-native-adapter-e2e-exit
Jul 24, 2026
Merged

Reapply the native single-view adapter with a terminating parity E2E#1117
h0x91b merged 2 commits into
mainfrom
fix/dev3-native-adapter-e2e-exit

Conversation

@h0x91b

@h0x91b h0x91b commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Hi, this is Claude (the AI assistant that wrote #1111 and reverted it in #1113). This reapplies that work with the two defects that caused the revert actually fixed, plus the real test failure it had been hiding.

1. The parity E2E never exited

Checks passed in ~18s, then the process hung until the job's timeout-minutes: 20 killed it — on all three platforms.

Two open handles kept the Bun event loop alive:

  • terminal-parity/checks.ts imported the pure helper smallestClientSize from pty-server.ts, which calls Bun.serve({...}) at module load. The E2E's very first log line was [pty] PTY WebSocket server running on ws://localhost:40905, printed before its own output. The helper now lives in the pure src/shared/resize-protocol.ts (its unit tests moved with it), so the corpus no longer touches that module.
  • The native harness handed out reconnect() controllers it never disposed, so an attach WebSocket opened by a reconnect check stayed open. All of them are tracked and disposed now.

Belt and braces: the E2E ends with an explicit process.exit(0/1) like every sibling native e2e, and its CI step gets timeout-minutes: 5 so a future hang fails fast instead of eating the job budget.

Verified by running the E2E with the explicit exit removed — it terminates on its own in 19s, which shows the leak is gone rather than papered over. An isolation test now fails if checks.ts/corpus.ts/runner.ts ever imports pty-server again.

2. The sharded test gate was silently passing over a real failure

This one is on me. My reporting improvement piped each suite through tee, and the default run: shell is bash -e {0}no pipefail (visible in the logs as shell: /usr/bin/bash -e {0}). The pipeline reported tee's exit code, so a failing suite was recorded as outcome: success.

Concretely: #1111's first run correctly said shard 4/5: cli=failure; after the tee change every shard went green while shard 4's log still contained FAIL tmux-audit/__tests__/tmux-audit.test.ts. That is how a red PR auto-merged.

Fixed by declaring shell: bash (which is -eo pipefail) on the three suite steps, guarded by src/bun/__tests__/workflow-pipefail.test.ts — verified by removing shell: bash from one step and watching the test name it.

3. The failure it was hiding

tmux-audit genuinely failed: the four adapter production files mention tmux (only in comments asserting it never touches tmux) and no rule classified them. Added a ^src/bun/native-terminal-adapter/ rule as compatibility / MIG-006 / isolation / reference, mirroring the native registry, and regenerated inventory.json / inventory.md.

Verification

bun run lint clean; bun run test green (mainview 2931 / bun 3228 / cli 600); the tmux live parity e2e green (14 tests); the native parity E2E prints ALL CHECKS PASSED and exits 0 in 19s. Decisions 165 and 166 record both root causes.

Note: one bun test flaked a single time right after the rebase and did not reproduce in two subsequent full runs; the grouped output did not name it, so I could not identify it — flagging it rather than claiming it was nothing.

h0x91b added 2 commits July 24, 2026 22:33
Move `smallestClientSize` to the pure shared resize-protocol module so the
parity corpus no longer imports pty-server, whose module-load `Bun.serve`
kept the standalone E2E alive after its checks passed. Dispose every
reconnect controller the native harness hands out, exit the E2E explicitly,
and cap its CI step with a timeout.

Declare `shell: bash` on the sharded suite steps: the default `run:` shell
has no pipefail, so `vitest | tee` recorded a failing suite as successful
and the aggregate gate went green over a real failure. Add guards for both
regressions and classify the adapter in the tmux audit inventory.
@h0x91b
h0x91b enabled auto-merge (squash) July 24, 2026 20:10
@h0x91b
h0x91b merged commit 403ac49 into main Jul 24, 2026
11 of 12 checks passed
@h0x91b
h0x91b deleted the fix/dev3-native-adapter-e2e-exit branch July 24, 2026 20:11
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