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
feat(wsl-host): a chat on a stopped WSL distro says so and offers Start - #34681
When the WSL distro behind a chat stops, the chat tab used to look normal. You only found out when sending failed. Now the chat says "Ubuntu is stopped" above the composer and offers a Start button, and Start brings the chat back.
What Changed
use-native-chat-host-outage.ts. A chat whose host is a WSL host now reads that host's own status (wslHostStatuses). When main reports distro-stopped, the outage kind is the new stopped, and it takes precedence over the transport-based "reconnecting" and "offline". A WSL host that is only idle reconnects on its own when the chat is used, so it shows nothing new.
use-native-chat-host-outage-notice.ts. The stopped kind shows "{{distro}} is stopped" with a Start action. Start calls wslHosts.connect, which is the explicit connect that is allowed to boot a distro (E9). After that, it runs the same connect-and-reload as the existing Reconnect. If the start fails, a toast shows main's message and the chat doesn't try to reconnect. Other hosts' notices are unchanged.
en.json: two new keys, hostOutage.stopped and hostOutage.start.
tests/e2e/wsl-host-chat.spec.ts.
After the distro stops, the spec asserts that the chat shows "Ubuntu is stopped" and that nothing booted the distro.
It clicks Start and checks that exactly that click boots the distro, that the notice clears, and that a new message gets a reply.
It then stops the distro a second time and keeps the existing focus-boot path: switching away and back starts it, and the chat continues.
Why
The stopped-state screenshot from #34573's CI run showed a normal-looking chat with no hint that its distro was down. The existing "Reconnect" can't help. A runtime call never boots a parked WSL distro, which is E9, so Reconnect would just fail. Start has to go through the WSL host's explicit connect. I reused the existing host-outage notice row rather than adding a new banner.
Linked Issue
N/A (maintainer).
Visual Proof
Before and after screenshots follow in a comment once this PR's e2e run produces the after shot.
Testing
New NativeChatStructuredSession.wsl-host-stopped.test.tsx covers three cases:
the stopped notice shows the Start action, which calls wslHosts.connect and then reconnects, and the notice clears once the host is ready;
a failed start doesn't reconnect;
an idle WSL host shows no Start.
The existing host-outage and notice suites pass (179 tests).
pnpm tc, typecheck:ci, the e2e-typecheck ratchet, base, native-plugin, type-aware and anti-slop oxlint, check:code-quality:changed, ratchets, the ast-grep gates and the localization catalog checks all pass.
The e2e spec runs in CI's changed-e2e job.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Flag-off: there are no WSL hosts without ORCA_INTERNAL_WSL_HOSTS, so wslHostStatuses stays empty and chats behave exactly as before. User risk is limited to chats on a WSL host.
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
SSH and paired hosts keep their Reconnect notice. Only a WSL host's distro-stopped status changes the wording and the action.
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)
The change detects when a WSL distro is stopped and displays a notice with a Start action. Starting the host triggers a runtime connection and project reload; a start error displays a toast and prevents the reconnect flow. English labels and component and end-to-end tests cover the stopped-host behavior.
Priority: Normal
Merge Risk: Low · previous review a626e
The change is mergeable with a minor error-message issue: failed starts may show technical IPC text before the useful detail.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 66.67% 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 clearly and concisely describes the primary user-facing change: showing a stopped WSL distro notice and offering a Start action.
Description check
The description is detailed and covers the user impact, implementation, rationale, testing, scope, and compatibility considerations. Visual proof is not yet attached, and the full checklist is not mar…
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: Description check
Explanation
The description is detailed and covers the user impact, implementation, rationale, testing, scope, and compatibility considerations. Visual proof is not yet attached, and the full checklist is not marked complete, but the description is otherwise mostly complete and relevant.
Full details: Docstring Coverage
Explanation
Docstring coverage is 66.67% 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 3 functions across 4 files. (1 skipped: 1 unsupported.)
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.
Assert the start error in the rejected-start test.
The test checks only that reconnect is skipped. It does not check the error the user sees. If a change removed the toast.error call on a rejected start and kept the reconnect guard, this test would still pass. Add an assertion for the error message that the start path shows.
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: 5addf5a6-3fad-4824-a551-516f4dbceebe
Commits
Reviewing files that changed from the base of the PR and between 4cd62c4 and a626e3f.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Show the WSL start error without the IPC wrapper.
If wslHosts.connect rejects through Electron IPC, error.message can start with Error invoking remote method 'wslHosts:connect'. The toast then puts that wrapper before the actionable error. Use readIpcErrorDetail(error) with a fallback for other error values. (raw.githubusercontent.com)
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
When the WSL distro behind a chat stops, the chat tab used to look normal. You only found out when sending failed. Now the chat says "Ubuntu is stopped" above the composer and offers a Start button, and Start brings the chat back.
What Changed
use-native-chat-host-outage.ts. A chat whose host is a WSL host now reads that host's own status (wslHostStatuses). When main reportsdistro-stopped, the outage kind is the newstopped, and it takes precedence over the transport-based "reconnecting" and "offline". A WSL host that is onlyidlereconnects on its own when the chat is used, so it shows nothing new.use-native-chat-host-outage-notice.ts. Thestoppedkind shows "{{distro}} is stopped" with a Start action. Start callswslHosts.connect, which is the explicit connect that is allowed to boot a distro (E9). After that, it runs the same connect-and-reload as the existing Reconnect. If the start fails, a toast shows main's message and the chat doesn't try to reconnect. Other hosts' notices are unchanged.hostOutage.stoppedandhostOutage.start.tests/e2e/wsl-host-chat.spec.ts.Why
The stopped-state screenshot from #34573's CI run showed a normal-looking chat with no hint that its distro was down. The existing "Reconnect" can't help. A runtime call never boots a parked WSL distro, which is E9, so Reconnect would just fail. Start has to go through the WSL host's explicit connect. I reused the existing host-outage notice row rather than adding a new banner.
Linked Issue
N/A (maintainer).
Visual Proof
Before and after screenshots follow in a comment once this PR's e2e run produces the after shot.
Testing
New
NativeChatStructuredSession.wsl-host-stopped.test.tsxcovers three cases:wslHosts.connectand then reconnects, and the notice clears once the host is ready;The existing host-outage and notice suites pass (179 tests).
pnpm tc,typecheck:ci, the e2e-typecheck ratchet, base, native-plugin, type-aware and anti-slop oxlint,check:code-quality:changed, ratchets, the ast-grep gates and the localization catalog checks all pass.The e2e spec runs in CI's changed-e2e job.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Flag-off: there are no WSL hosts without
ORCA_INTERNAL_WSL_HOSTS, sowslHostStatusesstays empty and chats behave exactly as before. User risk is limited to chats on a WSL host.Agent skill upstream boundary
Notes
SSH and paired hosts keep their Reconnect notice. Only a WSL host's
distro-stoppedstatus changes the wording and the action.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)