Skip to content

[Bug]: New worktree thread send waits on workspace.layoutCommands with no feedback (0.1.12) #43267

Done

Description

@SamuelZ12

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Use the desktop app connected to a remote environment (mine is a Mac mini over Tailscale).
  2. Open a project that starts threads in New worktree mode. Mine has no worktreeLayout commands in t3.json.
  3. Make the connection slow or lossy, so one response from the environment takes a few seconds.
  4. Type a prompt in a new draft and press Enter.

I didn't build a deterministic repro. My remote's internet drops for 2 to 6 seconds at a time, which triggers it several times an hour.

Expected behavior

The draft turns into the thread right away, like in 0.1.11, or shows that it is sending.

Actual behavior

The draft stays on screen with no change until workspace.layoutCommands answers. It looks like Enter did nothing. Pressing Enter again shows "Still sending your previous message. Send again once it goes through or fails." The first message does go through.

The wait is ensureWorktreeLayoutApproved in apps/web/src/components/chat/useComposerSend.ts, added in #42386. It sets sendInFlightRef and awaits the read before every worktree send, even when the project has no layout commands. The read has no timeout and its result isn't cached.

Impact

Minor bug or occasional failure

Version or commit

0.1.12, desktop app and server. Not present in 0.1.11.

Environment

macOS desktop app 0.1.12, remote environment is t3 serve 0.1.12 on a Mac mini over Tailscale, Pi provider.

Logs or stack traces

One send, same request on both sides:

client: EnvironmentRpc.request workspace.layoutCommands  durationMs 8388
server: ws.rpc.workspace.layoutCommands                  durationMs 2

orchestration.launchThread reached the server 8.4 s after Enter and took 62 ms. The toast was on screen for those 8 seconds.

Workaround

Press Enter once and wait.

Possible fix

Cache the layout-command read per project, or start the thread and let the server refuse unapproved commands, which the comment in worktreeLayoutApproval.ts says it already does. Showing a sending state in the draft would also cover it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions