Skip to content

test(wsl-host): type into the WSL host terminal only after its shell prompt - #34607

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-fake-transport-wait-prompt
Oct 27, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-fake-transport-wait-prompt

Conversation

@nwparker

@nwparker nwparker commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2
Prod 0 0 0 0

ELI5

An end-to-end test for WSL hosts types a command into a terminal and waits for its output. Sometimes it typed before the shell was ready, the first few keys were lost, and the test failed. The test now waits until the shell shows its prompt before typing.

What Changed

tests/e2e/wsl-host-fake-transport.spec.ts ("adds a WSL distro as a host, adds a project on it, and runs a terminal there") now waits for the shell's prompt before it types printf 'WSL_HOST_TERMINAL_%s\n' ready. It recognizes the prompt by the project folder's name, which the prompt includes. Two added lines, test only.

Before: on CI the shell sometimes received L HOST TERMINAL % s\n' ready. The opening printf 'WS was dropped, the quote stayed open, the marker never printed, and the test timed out after 30 s. Seen in #33911 (run 40575191833, twice) and #34573 (run 40596517791), which share no code, so the flake was already on main.
After: typing starts only once the shell is reading input.

Why

The test checks that a terminal on a WSL host works, not how early a terminal can accept keystrokes, so waiting for the prompt keeps it on its subject. Losing keys typed right after a remote terminal attaches is a real but separate issue, tracked as its own follow-up. This change doesn't hide it from any test written to check that.

Linked Issue

N/A (maintainer test fix).

Visual Proof

N/A: test-only change, nothing user-facing.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • The test passed 3 out of 3 runs (--repeat-each=3, background launch, non-symlinked TMPDIR on macOS) against a fresh build of this branch.

  • pnpm tc, pnpm run typecheck:ci, check:code-quality:changed and the flaky-test pattern ratchet pass.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Test only; no product, platform, SSH or mobile impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (typecheck and the touched e2e test locally; full lint/test left to CI per load rule)

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b21c0551-a0fa-4e3c-9ba3-f5116f4d2989
Commits

Reviewing files that changed from the base of the PR and between 2fb9353 and c0fb388.

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

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2373ca00-9ad0-4283-b4ac-3f876b5d79e6
Commits

Reviewing files that changed from the base of the PR and between f4d98b7 and 2fb9353.

Files selected for processing: 1
  • tests/e2e/wsl-host-fake-transport.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

The WSL-host terminal E2E test now waits for output containing the project directory’s basename before typing into the remote PTY. The test allows up to 30 seconds for this output. A comment notes that input sent before the shell’s first prompt can be dropped.

Priority: Low

Merge Risk: Minimal · previous review 2fb93

The synchronization change has no established merge-blocking defect.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main test change: waiting for the WSL host shell prompt before typing.
Description check Passed The description is complete and focused. It explains the problem, change, rationale, linked-issue exception, visual-proof exception, testing performed, scope, and checklist status. It also explains wh…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and focused. It explains the problem, change, rationale, linked-issue exception, visual-proof exception, testing performed, scope, and checklist status. It also explains why full lint and test runs were left to CI.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

…prompt

On CI the first keystrokes typed right after the WSL host terminal attached
were sometimes dropped (the shell received "L HOST TERMINAL ..."), leaving an
open quote, so the marker never printed. The spec now waits for the prompt,
which names the project folder, before typing. The dropped input itself is a
separate follow-up.
@nwparker
nwparker force-pushed the nwparker/wsl-fake-transport-wait-prompt branch from 2fb9353 to c0fb388 Compare October 27, 2026 23:28
@nwparker
nwparker merged commit 5e9e4c8 into main Oct 27, 2026
40 checks passed
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