GeezerVison is showing github.com — fix(client-runtime): command failures show the server's text for string defects by juliusmarminge · Pull Request #41550 · pingdotgg/t3code
Conversation
When the server rejected a command with a plain-text defect (for example "RPC contract is registered but unavailable in the control plane: projectClone.start"), the client showed only "An error occurred." because the text came back as a bare string, not an Error. squashAtomCommandFailure now wraps a string defect in an Error, so the Add to another machine dialog and other command-failure messages show the server's text.
Fixes #41542
Reproduction on main
Commit: origin/main f58085a. In a worktree: started source server+web A (T3CODE_DEV_SEED=0 T3CODE_DEV_INSTANCE=41542 vp run dev --home-dir <scratch>/homeA) and a target server B (T3CODE_DEV_SEED=0 T3CODE_DEV_INSTANCE=41543 T3CODE_DEV_ALLOWED_ORIGINS=http://localhost:<webA> vp run dev:server --home-dir <scratch>/homeB). B had a temporary uncommitted patch in apps/server/src/ws.ts so projectClone.start returns Effect.die("RPC contract is registered but unavailable in the control plane: projectClone.start"), the reporter's exact string defect. In the web app on A: paired B in Settings > Environments > Add environment (host + pairing code). Added a scratch git repo with a GitHub origin as a project on A (t3 project add). Opened a new thread in that project, then Run context > Add to another machine > B > 'Clone to '. B's log shows the defect text; the dialog shows only 'An error occurred.' in red, with nothing about which call failed or why. The failing unit test also reproduces it: decoding the string through Schema.Defect (as the RPC client does), then squashAtomCommandFailure(Cause.die(...)), then thrownErrorMessage returns null instead of the text.
Evidence
Pair a second real server whose projectClone.start returns the reporter's exact string defect. In a new draft, choose Run context > Add to another machine > Scenario > Clone to Scenario. Chromium 156 on Linux, 1280×800, light theme, fresh synthetic data on both commits. Temporary workspace paths are redacted.
Scenario source · Capture preparation script
The scenario failed on base and passed on head; both rendered outcomes were visually inspected.
Not shown:
- Other command-failure reporting locations, desktop, and mobile were not individually exercised; this proof covers the reported web dialog through real RPC.
Tests
vp test run src/errors/translatable.test.ts src/state/runtime.test.ts (packages/client-runtime): 47 passed; the repro test fails without the fix
vp test run src/state/assets.test.ts (packages/client-runtime): 10 passed
vp test run src/browser/browserViewportActions.test.ts src/state/terminalSessions.test.ts src/lib/attachmentUploadQueue.test.ts (apps/web): 25 passed
vp run check:changed: format, lint, knip, typecheck (7 packages) and tests all pass
- PR CI on 0ee8e03: all 8 required checks passed
Not in this change
- Non-string, non-Error defects (for example plain objects without a message) still fall through to the generic message.
- The server could send a typed error instead of dying with a string for unavailable control-plane RPCs.
Who did the work
- Written by Claude Opus 5.5, in Claude Code
- Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
- Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5
Run by the t3code factory in T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ssage
Fails on main: a Die cause whose defect is a string squashes to the
string, and thrownErrorMessage returns null for anything not an Error,
so callers show "An error occurred." (#41542).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng defects
A server Effect.die("text") decodes over RPC as a bare string, so
squashAtomCommandFailure returned a string and every caller reading an
Error (thrownErrorMessage, instanceof Error) fell back to "An error
occurred." Wrap a squashed string in an Error so its text reaches the UI.
Fixes #41542
Co-Authored-By: Claude Opus 5.5 <[email protected]>
coderabbitai
Bot
commented
Nov 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
squashAtomCommandFailure now wraps string failures in an Error. A test checks that thrownErrorMessage returns the original string.
Changes: String failure handling
| Layer / File(s) |
Summary |
Wrap squashed string failures packages/client-runtime/src/state/runtime.ts, packages/client-runtime/src/errors/translatable.test.ts |
squashAtomCommandFailure wraps string results from Cause.squash in an Error and returns other values unchanged. The test checks that thrownErrorMessage returns the original string. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested labels: bugfix
Suggested reviewers: macroscopeapp
Merge Risk: Minimal · up to 0ee8e
-
Command failures that arrive as string defects will now show the server's text instead of the generic "An error occurred." The change is small and localized, so merge risk is minimal.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: command failures now show the server's text for string defects. It uses the conventional commit format, scopes the change to client-runtime, and matches the summary, w… |
| Linked Issues check |
 |
[#41542] The reported requirement is that a string defect from an RPC failure reaches the user instead of the generic "An error occurred." The head revision of packages/client-runtime/src/state/runtim… |
| Out of Scope Changes check |
 |
The supplied summary lists two changed files: packages/client-runtime/src/state/runtime.ts (squashAtomCommandFailure string-to-Error wrap, with non-string causes returned unchanged) and packages/clien… |
| Description check |
 |
The description follows the repository template closely. It explains the problem (a plain-text defect from projectClone.start shows only "An error occurred."), the change (squashAtomCommandFailure wra… |
Full details: Title check
-
Explanation
The title names the main change: command failures now show the server's text for string defects. It uses the conventional commit format, scopes the change to client-runtime, and matches the summary, which wraps string defects in an Error in squashAtomCommandFailure. The title is specific and does not describe unrelated work.
Full details: Linked Issues check
-
Explanation
[#41542] The reported requirement is that a string defect from an RPC failure reaches the user instead of the generic "An error occurred." The head revision of packages/client-runtime/src/state/runtime.ts now has squashAtomCommandFailure return new Error(squashed) when Cause.squash yields a string. Call sites such as addProjectToMachine's failureMessage pass that value to thrownErrorMessage, which returns error.message for an Error instance. The added test in packages/client-runtime/src/errors/translatable.test.ts decodes the exact reporter string through Schema.Defect, squashes Cause.die(defect), and asserts thrownErrorMessage returns the original text. This covers the reported string-defect path. The issue's broader proposal (fallback for plain objects with a string message, and console logging) is not implemented. The PR description excludes non-string, non-Error defects, and the issue title scopes the bug to string defects, so this gap is not a failure of the reported requirement. Real-app before/after evidence is still pending per the PR description; it is not a coding requirement. Evidence note: the diff tool could not return a text diff for runtime.ts, so the change was read from the head file content and the supplied summary.
Full details: Out of Scope Changes check
-
Explanation
The supplied summary lists two changed files: packages/client-runtime/src/state/runtime.ts (squashAtomCommandFailure string-to-Error wrap, with non-string causes returned unchanged) and packages/client-runtime/src/errors/translatable.test.ts (a regression test for the string defect). Both connect directly to #41542. The apps/web test runs in the PR description are validation runs, not listed changes. No unrelated change was identified. Limitation: the diff tool could not return the full changed-file list, so completeness rests on the supplied summary.
Full details: Description check
-
Explanation
The description follows the repository template closely. It explains the problem (a plain-text defect from projectClone.start shows only "An error occurred."), the change (squashAtomCommandFailure wraps string defects in an Error), and the scope (it links issue #41542 as the bug). It also gives detailed reproduction steps, before/after evidence, test commands with results, and the authorship note. The Verification section names focused tests and their results, and it notes what was not checked. Minor gaps: the Scope section does not say why a fix needs no issue (an issue is linked, so this is not required), and the Change section does not mention whether the other command-failure locations were checked. Those gaps are not critical.
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between f58085a and 0ee8e03.
Files selected for processing: 2
-
packages/client-runtime/src/errors/translatable.test.ts
packages/client-runtime/src/state/runtime.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
aabdel0181
added a commit
to aabdel0181/ominax
that referenced
this pull request
Nov 24, 2026
…ailures
Upstream pingdotgg#41550 turns a string command failure into an Error so its text
shows. The fork test's "not an error" case used a string; it now uses an
object, which still gets "The side chat could not start."
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
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.
|