diff --git a/crates/local-deployment/src/container.rs b/crates/local-deployment/src/container.rs index 30fb055b..10002d17 100644 --- a/crates/local-deployment/src/container.rs +++ b/crates/local-deployment/src/container.rs @@ -465,6 +465,11 @@ impl LocalContainerService { format!("vk-{}-{}", short_uuid(attempt_id), task_title_id) } + pub fn git_branch_from_task_attempt(attempt_id: &Uuid, task_title: &str) -> String { + let task_title_id = git_branch_id(task_title); + format!("vk/{}-{}", short_uuid(attempt_id), task_title_id) + } + async fn track_child_msgs_in_store(&self, id: Uuid, child: &mut AsyncGroupChild) { let store = Arc::new(MsgStore::new()); @@ -720,9 +725,12 @@ impl ContainerService for LocalContainerService { .await? .ok_or(sqlx::Error::RowNotFound)?; - let task_branch_name = + let worktree_dir_name = LocalContainerService::dir_name_from_task_attempt(&task_attempt.id, &task.title); - let worktree_path = WorktreeManager::get_worktree_base_dir().join(&task_branch_name); + let worktree_path = WorktreeManager::get_worktree_base_dir().join(&worktree_dir_name); + + let git_branch_name = + LocalContainerService::git_branch_from_task_attempt(&task_attempt.id, &task.title); let project = task .parent_project(&self.db.pool) @@ -731,7 +739,7 @@ impl ContainerService for LocalContainerService { WorktreeManager::create_worktree( &project.git_repo_path, - &task_branch_name, + &git_branch_name, &worktree_path, &task_attempt.base_branch, true, // create new branch @@ -766,7 +774,7 @@ impl ContainerService for LocalContainerService { ) .await?; - TaskAttempt::update_branch(&self.db.pool, task_attempt.id, &task_branch_name).await?; + TaskAttempt::update_branch(&self.db.pool, task_attempt.id, &git_branch_name).await?; Ok(worktree_path.to_string_lossy().to_string()) } diff --git a/frontend/src/pages/project-tasks.tsx b/frontend/src/pages/project-tasks.tsx index 63af549e..7139b4f2 100644 --- a/frontend/src/pages/project-tasks.tsx +++ b/frontend/src/pages/project-tasks.tsx @@ -68,6 +68,7 @@ export function ProjectTasks() { queryKey: ['taskAttempts', selectedTask?.id], queryFn: () => attemptsApi.getAll(selectedTask!.id), enabled: !!selectedTask?.id, + refetchInterval: 5000, }); // Selected attempt logic