Recreate deleted worktrees for followups and log-normalization (#512)

This commit is contained in:
Solomon
2025-08-18 15:27:26 +01:00
committed by GitHub
parent 0ca4b6e219
commit 9b4b91284c
2 changed files with 14 additions and 0 deletions

View File

@@ -148,6 +148,12 @@ pub async fn follow_up(
) -> Result<ResponseJson<ApiResponse<ExecutionProcess>>, ApiError> {
tracing::info!("{:?}", task_attempt);
// Ensure worktree exists (recreate if needed for cold task support)
deployment
.container()
.ensure_container_exists(&task_attempt)
.await?;
// Get session_id with simple query
let session_id = ExecutionProcess::find_latest_session_id_by_task_attempt(
&deployment.db().pool,

View File

@@ -295,6 +295,14 @@ pub trait ContainerService {
}
};
if let Err(err) = self.ensure_container_exists(&task_attempt).await {
tracing::warn!(
"Failed to recreate worktree before log normalization for task attempt {}: {}",
task_attempt.id,
err
);
}
let current_dir = self.task_attempt_to_current_dir(&task_attempt);
let executor_action = if let Ok(executor_action) = process.executor_action() {