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
fix: New Workspace session hangs — WorktreeState never transitions to ready #1073
Problem — Selecting "New workspace" in the session picker creates the worktree and session, but the prompt is held by waitForWorktree which blocks on WorktreeState.wait(). Nothing ever calls Worktree.ready(), so the state stays "pending" indefinitely — the message appears in the UI (optimistic) but never reaches the server, and no agent responds.
Approach — Overlay submit.ts to remove the fragile WorktreeState.pending → wait state machine. After client.worktree.create() succeeds, immediately create the session scoped to the worktree directory and send the prompt — no waiting, matching the robust pattern from amicode_session tool handler (Slice 1, #1060). Add a 30s timeout on worktree.create() itself and surface errors as toasts.
Scope — in: overlay of packages/app/src/components/prompt-input/submit.ts, removal of WorktreeState.pending/wait usage in the new-session worktree path · out: the WorktreeState utility itself (may still be used elsewhere), amicode_session tool changes
Acceptance Criteria
An overlay file exists at packages/app-bundle/overlay/packages/app/src/components/prompt-input/submit.ts
When worktreeSelection === "create", the handler creates the worktree, then immediately creates the session scoped to the worktree directory and sends the prompt — no WorktreeState.pending() or waitForWorktree blocking
Worktree creation failure shows an error toast and aborts (no silent fallback)
The sendFollowupDraftbefore: waitForWorktree guard is removed (or bypassed) for the new-workspace path so the prompt sends immediately
Existing behavior for worktreeSelection === "main" and existing-worktree paths is unchanged
The overlay file is added to manifest.json with classification M
Prior Art
packages/app-bundle/.materialized/packages/app/src/components/prompt-input/submit.ts — the upstream file to overlay
packages/app-bundle/.materialized/packages/app/src/utils/worktree.ts — the WorktreeState utility (the broken state machine)
packages/extension/src/amicode_tools_core.ts lines 1996+ — the amicode_session handler with the robust worktree flow
packages/app-bundle/overlay/packages/app/src/components/prompt-input/ — existing overlays in the same directory
Activity
fix(app): remove broken WorktreeState wait from new-workspace submit …
Revert "fix(app): remove broken WorktreeState wait from new-workspace…
feat: agent-initiated workspace isolation — wire amicode_session to t…