fix(web): surface error when adding a workspace by path fails - #1236
Conversation
Previously, addWorkspaceByPath swallowed any error from the daemon and created a local-only workspace that could not host sessions and vanished on reload, so an invalid absolute path appeared to succeed but never took effect. Now the error is reported to the user and no fake workspace is added.
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 284f34ff38
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } catch (err) { | ||
| pushOperationFailure('addWorkspace', err); |
There was a problem hiding this comment.
Preserve pending prompts when workspace add fails
When this is reached from App.vue's handleAddWorkspace after a user submits a prompt with no selected workspace, that handler has already closed the dialog, then clears pendingWorkspaceSubmit after await client.addWorkspaceByPath(root) and only sends if activeWorkspaceId was set. This new catch swallows daemon rejections and returns normally, so an invalid path now drops the user's pending prompt instead of letting the caller keep or retry it. Return a success signal or rethrow after surfacing the error so the pending submission is not cleared on failure.
Useful? React with 👍 / 👎.
addWorkspaceByPath now returns a boolean success signal. handleAddWorkspace only clears pendingWorkspaceSubmit and sends the prompt on success, so a daemon-rejected path no longer drops the user's pending submission; they can retry with a valid path.
🦋 Changeset detectedLatest commit: 3c9c708 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20bb624f70
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const added = await client.addWorkspaceByPath(root); | ||
| // Keep the pending submission when the daemon rejects the path so the user | ||
| // can retry with a valid one instead of losing their prompt. | ||
| if (!added) return; |
There was a problem hiding this comment.
Keep the workspace picker open after add failures
When addWorkspaceByPath returns false, the dialog has already been hidden and this early return leaves pendingWorkspaceSubmit populated. In the no-workspace submit flow the composer clears the user's text before emitting, so a rejected path closes the only retry UI; if the user later adds any workspace, the stale prompt is silently sent there. Keep the picker open on failure, or clear the pending submit when closing it.
Useful? React with 👍 / 👎.
Move closing the add-workspace dialog until after a successful add. On a daemon-rejected path the picker now stays open with the user's input intact, so they can correct the path and retry; the pending submission is consumed by a successful retry or dropped only when the user explicitly closes the picker.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4817c6d09b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Keep the picker open (and the pending submission intact) when the daemon | ||
| // rejects the path so the user can retry with a valid one. Closing via | ||
| // Escape goes through handleCloseAddWorkspace, which drops the pending prompt. | ||
| if (!added) return; |
There was a problem hiding this comment.
Show the add-workspace error above the dialog
When addWorkspaceByPath returns false for an invalid daemon path, this early return leaves AddWorkspaceDialog mounted. The only feedback is the global pushOperationFailure toast, but the dialog backdrop is z-index: 200 while WarningToasts is z-index: 60, so the error toast is rendered behind the modal/backdrop and may auto-dismiss before the user can see or interact with it. This makes the rejected-path case still look like a no-op unless the user closes the picker; surface an inline error or render the toast above/inside the dialog while keeping it open.
Useful? React with 👍 / 👎.
When the daemon rejects a path, the global warning toast rendered behind the picker's backdrop (z-index 60 vs 200) and could auto-dismiss unseen. Surface the failure as an inline error inside the dialog instead, so it is visible and persists until the user retries or closes. addWorkspaceByPath now returns a boolean and leaves surfacing to the caller; the picker shows a localized inline message.
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
None.
Problem
In the web UI, adding a workspace by typing an absolute path could silently fail. When the daemon rejected the path (for example because it does not exist on the daemon's filesystem), the error was swallowed and a local-only workspace was fabricated instead. That workspace could not host sessions and disappeared after a reload, so the add looked like it succeeded but never took effect, with no feedback to the user.
What changed
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.