You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(wsl-mover): a moved project's chat opens and answers here; a fenced terminal names its host - #34880
After a project moves to its WSL host, its existing chats stay on this computer. Until now, no test proved they still work. This PR adds that end-to-end test: open the moved project's chat, send a message, and a reply comes back from the agent on this computer, with no host involved.
Writing the test found a real crash. Opening a moved project's chat from its sidebar entry took down the whole terminal workbench ("Orca hit a recoverable UI error"). That's fixed here.
The PR also fixes a misleading message. A new terminal in a project the host now owns was refused with "This project is moving… try again when the move finishes". That move had already finished. The message now names the host and the way back.
What Changed
New e2e (wsl-move-moved-project-chat-send.spec.ts):
It creates a real Claude chat in a project, using the repo's structured Claude stub. Only the stub's directory is on PATH, so no real Claude can answer.
It seeds a committed WSL move of that project and relaunches.
It opens the chat from the "Moved to Ubuntu host" entry, types a message and sends it.
It asserts that "Stub reply." arrives, that the stub launched again after the move (this computer ran the agent), and that no runtime environment exists, so nothing went to a host.
It's POSIX-only, like the other stub-based chat specs.
Crash fix (NativeChatPromptEditor): opening the chat switches workspace and asks the composer for focus in the same tick. The focus request reached the prompt editor before tiptap had mounted its view, and tiptap's view throws then: "The editor view is not available".
The editor handle's focus and contains now go through mountedEditorView, which returns null before mount or after destroy.
Focus waits for the next reveal instead of throwing. This affects any activation that switches workspace and focuses a chat at once, not only moved projects.
Fenced-terminal message (WslMoveProjectFencedError, spawn-cwd.ts): when the project's move has already committed, the PTY spawn refusal now says: "This project now runs on its WSL host, so its terminals open there. Use it on this computer again to open one here."
The error code is unchanged (wsl_move_in_progress).
A move still in progress keeps the old message.
This is the path a chat agent's request for a terminal in that project would take.
Why
The test: it closes a flag-on checklist unknown, whether a moved project's chats still work.
Crash fix: it guards the editor handle instead of delaying the activation, because any caller can request focus. The handle is the one place that knows whether the view exists.
Message: it reuses the existing error and the journal's host-distro lookup, so callers and the error code don't change.
Linked Issue
N/A (maintainer, WSL mover flag-on checklist).
Visual Proof
The crash, before the fix: opening the moved chat showed "Orca hit a recoverable UI error / React render error in terminal-workbench", with tiptap's "The editor view is not available" in the renderer log. After the fix, the new e2e opens the chat, sends a message and sees the reply.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
The new e2e:
It failed before the fix, at the composer, with the workbench crash.
It passes after the fix, alongside the existing wsl-move-moved-project-chats.spec.ts (3/3, built locally, background launch).
native-chat-mounted-editor-view.test.ts: returns null before mount and after destroy without throwing, and returns the view once mounted.
spawn-cwd-wsl-move.test.ts: after a committed move, a fresh terminal is refused with the message naming the host, not the "try again" one.
Local checks:
tc and typecheck:ci pass;
check:code-quality:changed, audit:anti-slop, ast-grep-gates and the full pnpm lint pass;
the native-chat and pty host-env suites pass, apart from one draft-store test that timed out under load and passes alone.
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
Cross-platform: the editor guard is platform-neutral. The e2e is POSIX-only (stub wrapper). The message change only fires for WSL moves.
SSH and mobile: unaffected.
Owner decision, flagged separately: whether a desktop chat in a host-owned project should stay writable.
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 (or CI will cover; local preferred)
…ed terminal names its host
New e2e: a moved project's existing chat still answers after the move, run by this computer's
agent, with no host involved. Writing it surfaced two product gaps:
- Opening the chat from the moved project's sidebar entry asked its composer for focus before
the prompt editor mounted; tiptap threw and the terminal workbench crashed. The editor handle
now focuses (and answers contains) only once its view is mounted.
- A new terminal in a project its WSL host now owns (one a chat's agent might ask for) was
refused with "is moving ... try again when the move finishes". It now names the host and the
way back: use the project on this computer again.
The changes update WSL move fencing so terminal requests can identify the destination host, and add an end-to-end test for sending a chat message after a committed move. They also add a mounted-editor-view helper and use it to guard native chat focus and containment checks.
Priority: Normal
Merge Risk: Low · up to 82caf
The change is broadly mergeable, but the moved-chat test needs stronger assertions for project cwd and local-only execution.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title names two real changes in the diff: the moved-project chat fix in the editor focus path and the fenced-terminal message naming the WSL host. It is long and joins two topics with a semicolon,…
Description check
The description follows the template's main sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Review, Agent skill upstream boundary, Notes, and Checklist. It explains the before …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names two real changes in the diff: the moved-project chat fix in the editor focus path and the fenced-terminal message naming the WSL host. It is long and joins two topics with a semicolon, but it is related to the changeset and is not misleading or vague.
Full details: Description check
Explanation
The description follows the template's main sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Review, Agent skill upstream boundary, Notes, and Checklist. It explains the before and after, the mechanism, and the rationale in detail. Gaps: the Linked Issue section says N/A for a maintainer, which the template allows, but the Visual Proof section describes a crash and a post-fix e2e run rather than attaching before and after media. Also, the AI Disclosure section is absent, the Testing checkbox for manual testing is unchecked, and the final pnpm checklist item is unchecked. The author also states that the native-chat and PTY suites were not fully green. These gaps are minor relative to the overall completeness.
Full details: Docstring Coverage
Explanation
Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 7 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 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.
The test binds the chat to repoPath, but Stub reply. does not depend on the agent cwd. Record process.cwd() in the stub launch log and assert the chat launch uses the canonical repoPath (realpathSync(repoPath)). The existing structured-chat test checks launch arguments and provider IDs, not cwd.
This is a test-coverage improvement, not evidence of a current production failure.
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: 4fc2ada8-79c2-4064-9faa-2847c7bea427
Commits
Reviewing files that changed from the base of the PR and between a891e36 and c4c5899.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
Assert runtime-host absence at the runtime boundary.
runtimeEnvironments.list() reads only the persisted environment catalog. An empty result does not detect transient or unlisted runtime-host activity, so this test can pass even if the send contacts a runtime host. Assert an execution-target/local marker, or instrument runtime-host requests and assert zero activity. Keep the existing working-directory assertion separate.
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: 0bb707cf-a4ce-4b5d-84a0-3d9e82b52c53
Commits
Reviewing files that changed from the base of the PR and between c4c5899 and 82caffc.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
…ery keeps
Since #34683 a move journal promotes the WSL hosts gate to serve-only, so startup
recovery now runs and undoes a move interrupted before blobs-transferred. The
spec restarted at source-fenced and expected the fence to survive; assert the
undo there, fence from blobs-transferred, and expect the committed refusal to
name the host (#34880). Route fence and recovery sources to the spec.
Co-Authored-By: Claude <[email protected]>
…ery keeps (#39200)
Since #34683 a move journal promotes the WSL hosts gate to serve-only, so startup
recovery now runs and undoes a move interrupted before blobs-transferred. The
spec restarted at source-fenced and expected the fence to survive; assert the
undo there, fence from blobs-transferred, and expect the committed refusal to
name the host (#34880). Route fence and recovery sources to the spec.
Co-authored-by: Claude <[email protected]>
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
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.
ELI5
After a project moves to its WSL host, its existing chats stay on this computer. Until now, no test proved they still work. This PR adds that end-to-end test: open the moved project's chat, send a message, and a reply comes back from the agent on this computer, with no host involved.
Writing the test found a real crash. Opening a moved project's chat from its sidebar entry took down the whole terminal workbench ("Orca hit a recoverable UI error"). That's fixed here.
The PR also fixes a misleading message. A new terminal in a project the host now owns was refused with "This project is moving… try again when the move finishes". That move had already finished. The message now names the host and the way back.
What Changed
New e2e (wsl-move-moved-project-chat-send.spec.ts):
It's POSIX-only, like the other stub-based chat specs.
Crash fix (
NativeChatPromptEditor): opening the chat switches workspace and asks the composer for focus in the same tick. The focus request reached the prompt editor before tiptap had mounted its view, and tiptap'sviewthrows then: "The editor view is not available".focusandcontainsnow go throughmountedEditorView, which returns null before mount or after destroy.Fenced-terminal message (
WslMoveProjectFencedError,spawn-cwd.ts): when the project's move has already committed, the PTY spawn refusal now says: "This project now runs on its WSL host, so its terminals open there. Use it on this computer again to open one here."wsl_move_in_progress).Why
Linked Issue
N/A (maintainer, WSL mover flag-on checklist).
Visual Proof
The crash, before the fix: opening the moved chat showed "Orca hit a recoverable UI error / React render error in terminal-workbench", with tiptap's "The editor view is not available" in the renderer log. After the fix, the new e2e opens the chat, sends a message and sees the reply.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
The new e2e:
native-chat-mounted-editor-view.test.ts: returns null before mount and after destroy without throwing, and returns the view once mounted.
spawn-cwd-wsl-move.test.ts: after a committed move, a fresh terminal is refused with the message naming the host, not the "try again" one.
Local checks:
pnpm lintpass;Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)