Skip to content

Conversation

@ethanndickson
Copy link
Member

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

#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).
@github-actions github-actions bot added the bug label Jan 26, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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.
@ethanndickson
Copy link
Member Author

@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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Surfaced creation send failures in workspace view and updated tests.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Replaced one-shot useEffect with usePersistedState subscription so late send errors (e.g., during slow devcontainer startup) still surface a toast.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ 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".

@ethanndickson ethanndickson added this pull request to the merge queue Jan 26, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 26, 2026
## 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 -->
github-merge-queue bot pushed a commit that referenced this pull request Jan 26, 2026
## 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 -->
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 26, 2026
@ethanndickson ethanndickson merged commit c8b9bb5 into main Jan 26, 2026
23 checks passed
@ethanndickson ethanndickson deleted the devcontainer-cap0 branch January 26, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant