fix(web): device host checks show the error without a stack trace #29912
main fromrefs/pull/29912/head·merged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHubProblem#
In Settings → Device hosts, Test connection checks a host from each selected environment. When a check fails, its row has a "Show error" disclosure. The hook built that text with Cause.pretty(result.cause), so the user saw the error class name and a client stack trace instead of the message the server wrote:
DeviceHostUnavailableError: Mac mini is unavailable: SSH connection refused.
at http://…/assets/…js:…
at …
Change#
useHostConnectionChecks now throws squashAtomCommandFailure(result) and does not wrap Cause.pretty. The existing checkDeviceHostConnections helper already reports a thrown error by its message. This uses the same failure handling as DevReplayHost, CommandPalette, and the other Settings dialogs. Every device.testHost error (the DeviceError union and EnvironmentAuthorizationError) is a tagged error with a user-facing message, so the message alone loses nothing the user needs.
Scope and approval#
This is a very small, focused fix for an obvious bug, so there is no prior issue. The diff changes 2 lines in one hook and adds one focused browser test.
Overlap search: the local PR index and GitHub search for useHostConnectionChecks, "device host", and "test connection". Open #19173 redacts SSH addresses in the same settings area. It edits deviceHostConnectionChecks.ts but does not change how the hook turns the RPC failure into text, so the two changes are independent. #29889 fixes the same class of problem for scheduled tasks' lastRunError on the server.
Verification#
- Red on main: the new
useHostConnectionChecks.browser.test.tsxfailed with- "Mac mini is unavailable: SSH connection refused."/+ "DeviceHostUnavailableError: Mac mini is unavailable: SSH connection refused.\n at http://localhost…". - Green:
vp test run src/components/settings/useHostConnectionChecks.browser.test.tsx src/components/settings/deviceHostConnectionChecks.test.ts: 2 files, 4 tests passed. vp run check:changedpassed format, lint, knip, typecheck (2 packages), tests, and the React Compiler check.- Not checked: a real-client capture. Only the text changes; the layout does not.
Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved (one nit about test mock reset, applied).
Created with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
3cba0b7Macroscope's review found this PR approvable — Device-host connection failures now display the underlying error message rather than a formatted stack trace. Probe behavior and authorization checks are unchanged, keeping the change limited to error presentation.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review.
Walkthrough
-
The hook now converts failed atom-command results with
squashAtomCommandFailure. A browser test checks that an SSH connection check returns a failed status and the formatted host-unavailable message.Changes: Host connection failure formatting
Layer / File(s) Summary Convert and verify command failures
apps/web/src/components/settings/useHostConnectionChecks.ts,apps/web/src/components/settings/useHostConnectionChecks.browser.test.tsxThe hook uses squashAtomCommandFailurewhen the command fails. The browser test checks the failed status and formatted error message forDeviceHostUnavailableError.Estimated code review effort: 2 (Simple) | ~10 minutes
Suggested reviewers:
juliusmarminge
Merge Risk:
Minimal · up to3cba0-
Host connection failures should show the server message. No material merge risk was identified.
Pre-merge checks:
4-
Check name Status Explanation Title check The title "fix(web): device host checks show the error without a stack trace" matches the main change. The hook now throws squashAtomCommandFailure(result) instead of formatting the cause with Cause.p… Description check The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections. The Problem section explains the stack trace output and the expected message. Th… 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 "fix(web): device host checks show the error without a stack trace" matches the main change. The hook now throws squashAtomCommandFailure(result) instead of formatting the cause with Cause.pretty, so the Show error disclosure displays the message without the error class name or client stack trace. The title is specific, uses a conventional commit prefix, and is 65 characters long.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections. The Problem section explains the stack trace output and the expected message. The Change section explains the switch to squashAtomCommandFailure. The Scope section states this is a small, focused fix of an obvious bug and gives an overlap search. The Verification section lists a red-then-green browser test run and a changed-files check run, and it states what was not checked (a real-client capture). The description does not include a screenshot, but the change affects only text, so the template's before/after screenshot requirement for UI changes is not clearly met. The Scope section also does not link a triaged issue, but it explains why none is needed for a very small obvious bug, as the template permits. The description is mostly complete.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ast-grep (0.51.1)-
ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/python/security/python-pymongo-empty-password-python.yml
Usage-based review receipt#
- Mode: Continue automatically
- Reviewed files: 2
- Charged: $0.50
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
CodeRabbit Verify#
- Run CodeRabbit Verify to test the changes in this pull request.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 61c3794
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e0a461c5-8ccd-4c7b-ba19-4d3ef8f7facd
Commits-
Reviewing files that changed from the base of the PR and between 61c3794c32b0eeebfac09add43e403618c65d2d7 and 3cba0b7ed26fbde4484ea50746364fc4fb064742.
Files selected for processing: 2-
apps/web/src/components/settings/useHostConnectionChecks.browser.test.tsxapps/web/src/components/settings/useHostConnectionChecks.ts
Limit details: You’ve used all 10 included reviews currently available.
-
-
Note
Written by
gpt-6.1-solon behalf of MariaVerified in a real dev environment#
verified exact head
3cba0b7ed26fbde4484ea50746364fc4fb064742on a linux boat vm, using the real dev web app in google chrome driven by the repo's playwright. no mocks, fixtures, or demo data. no code changes needed.- reproduced on
github/main(61c3794c32), installed in a separate worktree: settings → devices → add source → machine over ssh → test connection against localhost port 1. the realdevice.testHostrpc failed and "show error" displayedDeviceOperationError, client stack frames, and the nested ssh connection-refused error. - stopped main and started the exact pr head. the same input and real rpc displayed only
Device probe host failed: Could not communicate with device support. Try refreshing devices.no error class or stack trace. - checked repeated failures, clearing stale results after editing the port, localhost port 22 reporting "already available locally", saving the host, and the saved-row test connection action showing the clean error toast.
- added a project pointing at the real main git worktree through the app. selected codex
gpt-6.1-soland ran a read-only git inspection turn through the client and local provider proxy. it completed in 14s withVERIFY_CODEX_OK; the client showed zero changed files. vp run check:changed 61c3794c32b0eeebfac09add43e403618c65d2d7passed throughblacksmith-check: format, lint, knip, affected typechecks, the browser test, and react compiler check. the worker needed playwright chromium installed first. github ci is also green.





Not verified#
native ios/android and electron clients; macos/windows hosts; multi-environment checks; a successful remote ssh device host with installed simulator tooling. this vm provides linux web verification. the real ssh failure is wrapped as
DeviceOperationError, rather than theDeviceHostUnavailableErrorused by the added browser test; both use the same changed client path. the server's existing generic probe-failure message remains generic.- reproduced on
Yash-Singh1(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes