Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Switch to the workspace view as soon as workspace.create() succeeds, rather than waiting for sendMessage() to complete.

What changed

Before:

setIsSending(true)
await waitForGeneration()
await workspace.create(...)
await workspace.sendMessage(...)  ← blocked here
onWorkspaceCreated(metadata)
setIsSending(false)               ← splash exits

After:

setIsSending(true)
await waitForGeneration()
await workspace.create(...)
onWorkspaceCreated(metadata)      ← switch immediately
setIsSending(false)               ← splash exits
void workspace.sendMessage(...)   ← fire-and-forget

Why this is safe

  1. Stream errors handled by workspace UI: Once switched to the workspace view, the chat UI listens to stream-error events and displays them inline
  2. sendMessage returns quickly: The RPC just kicks off the stream in the background via processStreamWithCleanup() and returns
  3. No race conditions: Preferences are synced before switching, and the workspace store is updated atomically

This reduces perceived latency by eliminating the sendMessage RPC round-trip from the splash screen duration.


Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

Switch to the workspace view as soon as workspace.create() succeeds,
rather than waiting for sendMessage() to complete. The sendMessage RPC
is fired in the background since:

1. Stream errors are handled by the workspace UI via stream-error events
2. sendMessage returns quickly after kicking off the stream
3. The user can see the workspace UI while streaming starts

This reduces perceived latency by eliminating the sendMessage RPC
round-trip from the splash screen duration.
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@ammario ammario merged commit 200025b into main Dec 14, 2025
20 checks passed
@ammario ammario deleted the splash-screen-cyhc branch December 14, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants