fix(workspaces): surface real error messages on failed workspace operations#29167
Open
jamesmurdza wants to merge 2 commits into
Open
fix(workspaces): surface real error messages on failed workspace operations#29167jamesmurdza wants to merge 2 commits into
jamesmurdza wants to merge 2 commits into
Conversation
Plugin throws reach the create handler as Effect defects (EffectBridge uses Effect.promise), so they bypassed Effect.mapError and surfaced as a generic error. Catch the cause, extract the original message, and return a typed ApiWorkspaceCreateError so the real reason reaches the client. Signed-off-by: James Murdza <james@jamesmurdza.com>
…lures Replace .catch(() => undefined) and detail-less toasts in the workspace create, warp, and adapter-load flows with try/catch that surfaces the real error via errorMessage(), shown as a title + message toast. Signed-off-by: James Murdza <james@jamesmurdza.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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue for this PR
Closes #27284
Type of change
What does this PR do?
When a workspace operation failed, the UI showed a generic message ("Creating workspace failed", "Failed to load workspace adapters", etc.) with no detail about the actual cause, so users had no idea why it failed.
There were two reasons the real error never reached the user:
Server. The
workspace.createhandler mapped every failure to a genericBadRequest, and plugin throws arrive as Effect defects (EffectBridgeruns plugins viaEffect.promise), so they bypassedEffect.mapErrorand surfaced generically. Now it catches the cause, extracts the original message, and returns a typedApiWorkspaceCreateError.Client (TUI). The create / warp / adapter-load flows used
.catch(() => undefined)and detail-less toasts, discarding the error. Now theytry/catchand show the real message viaerrorMessage()in a title + message toast. Warp keeps its existingVcsApplyErroralert.The server and client changes are complementary: the server makes the real message available in the response, and the client actually displays it. Success paths are unchanged.
How did you verify your code works?
Manually, in the TUI, against a build of this branch. I registered a workspace adapter whose
create()throws a recognizable error, then triggered a workspace creation so the adapter throws.opencode.jsonat it (absolute path):{ "$schema": "https://opencode.ai/config.json", "plugin": ["file:///absolute/path/to/fail-workspace-plugin.ts"] }ctrl+p→ Warp → under New workspace pick Test Fail. The adapter'screate()throws.Result:
ApiWorkspaceCreateError) → client (result.error) → toast.Screenshots / recordings
SmoothCapture_2026-05-24_215539.mp4
Checklist
If you do not follow this template your PR will be automatically rejected.