feat: support fast worktree-backed session flows

Add a directory-created fast path for worktree creation so session and send flows can continue once the target directory exists while Git attachment and bootstrap finish in the background.

Track bootstrap status explicitly in shared UI contracts, including pending, ready, and failed states. Background watchers now surface failures and timeouts, update stored worktree metadata, and keep web and VS Code runtime behavior in parity.

Move GitHub issue/PR worktree sessions and assistant-answer fork sessions onto the unified send path so provider, model, agent, and variant selections are preserved. The assistant-answer fork dialog can optionally create a worktree outside VS Code.

Make worktree deletion dialogs close after linked-session cleanup while removing the worktree in the background, and clean up failed fast-create artifacts safely without recursively deleting user or agent-written files.

Validation: bun test packages/ui/src/lib/worktrees/worktreeBootstrap.test.ts packages/ui/src/lib/worktrees/worktreeManager.test.ts; bun run type-check; bun run lint.
This commit is contained in:
Bohdan Triapitsyn
2026-06-06 23:25:39 +03:00
parent d4ef1fd8c0
commit e0113c637d
34 changed files with 901 additions and 264 deletions
+4
View File
@@ -766,6 +766,9 @@ export const dict: Record<I18nKey, string> = {
"gitView.empty.worktreeFeaturesUnavailable": "Las características de worktree no están disponibles en este modo de espacio de trabajo.",
"gitView.empty.worktreeSetupDescription": "Finalizando la configuración de worktree y preparando el estado del repositorio.",
"gitView.empty.worktreeSetupInProgress": "Configuración de worktree en progreso",
"worktree.bootstrap.toast.failed": "Error al configurar el worktree",
"worktree.bootstrap.toast.failedDescription": "El worktree se creó, pero la configuración en segundo plano no terminó.",
"worktree.bootstrap.toast.timeoutDescription": "El worktree se creó, pero la configuración en segundo plano agotó el tiempo de espera.",
"gitView.gitmoji.empty": "No se encontraron gitmojis",
"gitView.gitmoji.searchPlaceholder": "Buscar gitmojis...",
"gitView.gitmoji.title": "Insertar gitmoji",
@@ -1682,6 +1685,7 @@ export const dict: Record<I18nKey, string> = {
"chat.messageBody.actions.startNewMultiRun": "Iniciar nuevo multi-run desde esta respuesta",
"chat.messageBody.forkDialog.instructions.label": "Instrucciones",
"chat.messageBody.forkDialog.instructions.placeholder": "Añade instrucciones para la nueva sesión…",
"chat.messageBody.forkDialog.createWorktree": "Crear worktree",
"chat.generatedResult.actions.copy": "Copiar",
"chat.generatedResult.actions.copied": "Copiado",
"chat.generatedResult.commit.title": "Mensaje de commit generado",