-
Notifications
You must be signed in to change notification settings - Fork 45
🤖 fix: navigate to workspace immediately after creation #1927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
#1896 regressed #1146 by awaiting sendMessage before calling onWorkspaceCreated. This caused the 'Creating workspace' splash to block until sendMessage resolved, which waits for init to complete. For devcontainer/SSH runtimes, init can take minutes. Restore the fire-and-forget pattern: navigate immediately after workspace.create() succeeds. Draft input/attachments are now cleared only after sendMessage succeeds (via .then()), preserving them if the send fails. Added regression test that verifies onWorkspaceCreated is called before sendMessage resolves (using a never-resolving promise mock).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3b31e2041
ℹ️ 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".
Await the initial send result in creation flows so we only report success once sendMessage completes. This keeps pending drafts intact when sendMessage fails (e.g., missing API key) while still navigating immediately after workspace.create(). Add a mounted guard to avoid clearing drafts on unmounted creation inputs, and cover the failure case in tests.
|
@codex review Addressed the draft-preservation issue by awaiting the initial send result while keeping early navigation, added a mounted guard for draft clears, and expanded tests for send failure + ordering. Static-check is green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2243ddf0d8
ℹ️ 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".
|
@codex review Surfaced creation send failures in workspace view and updated tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b1e2221f8
ℹ️ 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".
|
@codex review Replaced one-shot useEffect with usePersistedState subscription so late send errors (e.g., during slow devcontainer startup) still surface a toast. |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ 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". |
## Summary Fixes a regression where the "Creating workspace" splash blocked until `sendMessage` completed. For devcontainer/SSH runtimes, this could take minutes since `sendMessage` waits for init (container build) to finish. ## Background **Regressed in #1896** ("feat: support PDF attachments") which changed `void api.workspace.sendMessage(...)` (fire-and-forget) to `await api.workspace.sendMessage(...)` and moved `onWorkspaceCreated` after it. This undid the fix from **#1146** ("perf: exit splash screen immediately after workspace.create()"). ## Implementation - Move `onWorkspaceCreated` and `setIsSending(false)` to immediately after `workspace.create()` succeeds - Change `sendMessage` back to fire-and-forget with `void` - Clear draft input/attachments only after `sendMessage` succeeds (via `.then()`), preserving them if the send fails ## Validation - Added regression test that verifies `onWorkspaceCreated` is called before `sendMessage` resolves (using a never-resolving promise mock) - Existing tests pass - `make static-check` passes --- _Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high` • Cost: `$7.42`_ <!-- mux-attribution: model=anthropic:claude-opus-4-5 thinking=high costs=7.42 -->
## Summary Fixes a regression where the "Creating workspace" splash blocked until `sendMessage` completed. For devcontainer/SSH runtimes, this could take minutes since `sendMessage` waits for init (container build) to finish. ## Background **Regressed in #1896** ("feat: support PDF attachments") which changed `void api.workspace.sendMessage(...)` (fire-and-forget) to `await api.workspace.sendMessage(...)` and moved `onWorkspaceCreated` after it. This undid the fix from **#1146** ("perf: exit splash screen immediately after workspace.create()"). ## Implementation - Move `onWorkspaceCreated` and `setIsSending(false)` to immediately after `workspace.create()` succeeds - Change `sendMessage` back to fire-and-forget with `void` - Clear draft input/attachments only after `sendMessage` succeeds (via `.then()`), preserving them if the send fails ## Validation - Added regression test that verifies `onWorkspaceCreated` is called before `sendMessage` resolves (using a never-resolving promise mock) - Existing tests pass - `make static-check` passes --- _Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high` • Cost: `$7.42`_ <!-- mux-attribution: model=anthropic:claude-opus-4-5 thinking=high costs=7.42 -->
Summary
Fixes a regression where the "Creating workspace" splash blocked until
sendMessagecompleted. For devcontainer/SSH runtimes, this could take minutes sincesendMessagewaits for init (container build) to finish.Background
Regressed in #1896 ("feat: support PDF attachments") which changed
void api.workspace.sendMessage(...)(fire-and-forget) toawait api.workspace.sendMessage(...)and movedonWorkspaceCreatedafter it.This undid the fix from #1146 ("perf: exit splash screen immediately after workspace.create()").
Implementation
onWorkspaceCreatedandsetIsSending(false)to immediately afterworkspace.create()succeedssendMessageback to fire-and-forget withvoidsendMessagesucceeds (via.then()), preserving them if the send failsValidation
onWorkspaceCreatedis called beforesendMessageresolves (using a never-resolving promise mock)make static-checkpassesGenerated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high• Cost:$7.42