You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Launch agent immediately; run git worktree in background #130
When creating a new branch session, the agent tab is not launched until the git worktree finishes being created. Worktree creation is not instant, so the user sits and waits before the agent starts. The perceived latency undermines the feel of "instant" branch sessions.
What would the solution look like?
Order should be:
Row is created in the sidebar (instant — already the case).
Agent tab opens (instant).
Agent process fires immediately against a temporary/placeholder cwd or is queued to swap cwd once the worktree is ready.
Git worktree creation runs in the background; the session rebinds to the real path when ready.
The user should never wait on the worktree to see the agent start. UI can show a subtle "preparing branch…" indicator on the session row until the rebind completes.
Alternatives you've considered
Pre-create a warm worktree pool per project — reduces latency but adds disk overhead and complexity.
Keep the current behavior but show a progress indicator — treats the symptom, not the cause.
Which area does this touch?
Agent / terminal nodes
Before submitting
I searched existing issues and this hasn't been requested yet
This is aligned with the direction in ROADMAP.md, or I've explained why it should be
changed the title [-]Agent launch should not wait on git worktree creation[/-][+][Feature]: Launch agent immediately; run git worktree in background[/+]on Sep 27, 2026
We've tried several approaches and none have cracked it. The tab opens instantly, but the xterm.js pane doesn't actually start the agent process until the git worktree finishes building.
What we've tried
Parallelize worktree add with session prep (commit 18c94c3) — helps a little on wall-clock, but the agent still doesn't fire in xterm until the worktree write settles.
Open the tab first, spawn agent second — tab shows immediately, but the PTY write / xterm attach path stalls behind the worktree op somewhere in the async chain.
Placeholder cwd, rebind later — attempted routing the agent at a temp dir and swapping cwd on ready. Either the agent didn't accept the swap cleanly, or xterm still waited on the same upstream await.
The mystery
The tab UI paints instantly. The agent PTY appears to be dispatched. But visually in xterm, nothing renders / no prompt streams until the worktree git worktree add returns. Feels like something in the Tauri command / PTY plumbing is serialized behind the worktree future even when we tokio::spawn it.
Where we suspect the block
Something in src-tauri/src/lib.rs around PTY session creation may be holding a lock or awaiting worktree completion.
Possibly xterm's onData / attach isn't wired until after the worktree resolves.
Could also be a frontend await in the branch-launch flow that we haven't isolated.
What would help
Fresh eyes on the branch-launch → PTY spawn → xterm attach chain.
A repro-and-fix PR, or even just a diagnosis of where the actual serialization happens.
Activity
[-]Agent launch should not wait on git worktree creation[/-][+][Feature]: Launch agent immediately; run git worktree in background[/+]gsvprharsha commentedon Sep 30, 2026
Status: stuck — help wanted
We've tried several approaches and none have cracked it. The tab opens instantly, but the xterm.js pane doesn't actually start the agent process until the git worktree finishes building.
What we've tried
18c94c3) — helps a little on wall-clock, but the agent still doesn't fire in xterm until the worktree write settles.The mystery
The tab UI paints instantly. The agent PTY appears to be dispatched. But visually in xterm, nothing renders / no prompt streams until the worktree
git worktree addreturns. Feels like something in the Tauri command / PTY plumbing is serialized behind the worktree future even when wetokio::spawnit.Where we suspect the block
src-tauri/src/lib.rsaround PTY session creation may be holding a lock or awaiting worktree completion.onData/ attach isn't wired until after the worktree resolves.What would help
Constraints (per project rules): don't modify core PTY infrastructure (
create_pty_session,write_to_pty, WorkspaceView PTY wiring) — only the consumer / launch flow.wip(branch-launch): push worktree add into create_pty_session
perf(branch-launch): parallelize worktree add with session prep