* The implementation is complete. Here's a summary of all the changes made: ## Summary ### Files Created - `crates/db/migrations/20251206000000_add_parallel_setup_script_to_projects.sql` - Database migration ### Files Modified **Backend (Rust):** - `crates/db/src/models/project.rs` - Added `parallel_setup_script: bool` field to `Project`, `Option<bool>` to `CreateProject`/`UpdateProject`, updated all SQL queries - `crates/services/src/services/container.rs` - Modified `start_attempt()` to support parallel execution when `parallel_setup_script` is true - `crates/server/src/routes/projects.rs` - Updated create/update handlers to include new field - `crates/deployment/src/lib.rs` - Added field to auto-created projects **Frontend (TypeScript/React):** - `frontend/src/pages/settings/ProjectSettings.tsx` - Added checkbox UI for parallel setup script setting - `frontend/src/components/dialogs/projects/ProjectFormDialog.tsx` - Added field to create data - `frontend/src/components/tasks/TaskDetails/preview/NoServerContent.tsx` - Added field to update data **i18n:** - `frontend/src/i18n/locales/en/settings.json` - Added translation strings - `frontend/src/i18n/locales/es/settings.json` - Added Spanish translations - `frontend/src/i18n/locales/ja/settings.json` - Added Japanese translations - `frontend/src/i18n/locales/ko/settings.json` - Added Korean translations **SQLx Cache:** - `crates/db/.sqlx/` - Updated query cache files ### Behavior - When `parallel_setup_script` is `false` (default): Sequential execution (setup → coding agent → cleanup) - When `parallel_setup_script` is `true`: Setup script and coding agent start simultaneously, setup script failure does not stop the coding agent * update useConversationHistory to display multiple running conversation threads at once * The bug fix is complete. Here's a summary of the changes: ## Bug Fix Summary **Problem:** When running in parallel mode, if the setup script finishes before the coding agent, the task incorrectly moves to "InReview" status while the coding agent is still running. **Root Cause:** The `should_finalize()` method returned `true` when `next_action.is_none()`, which is the case for setup scripts in parallel mode. This caused premature task finalization. **Solution:** Modified `should_finalize()` to check if there are other running non-DevServer processes for the same task attempt before finalizing. ### Files Modified 1. **`crates/db/src/models/execution_process.rs`** - Added `has_running_non_dev_server_processes_excluding()` method that accepts an optional `exclude_id` parameter - Refactored existing `has_running_non_dev_server_processes()` to delegate to the new method 2. **`crates/services/src/services/container.rs`** - Changed `should_finalize()` from sync to async - Added check for other running processes before allowing finalization 3. **`crates/local-deployment/src/container.rs`** - Updated call site to use `.await` on the now-async `should_finalize()` * The bug fix is complete. Here's a summary of the changes: **Fixed files:** 1. **`crates/services/src/services/container.rs`** - Simplified `should_finalize()`: - Changed from `async fn` back to `fn` (non-async) - Removed the complex database check for other running processes - Added a simple check: if the run_reason is `SetupScript` AND `next_action.is_none()` (parallel mode), return `false` (don't finalize) 2. **`crates/local-deployment/src/container.rs`** - Removed `.await` from the `should_finalize()` call 3. **`crates/db/src/models/execution_process.rs`** - Cleaned up by removing the unused `has_running_non_dev_server_processes_excluding()` function and simplifying `has_running_non_dev_server_processes()` back to its original form **How the fix works:** - In **parallel mode**: Setup scripts have `next_action: None`, so the new check catches this case and prevents finalization - In **sequential mode**: Setup scripts have `next_action: Some(coding_agent)`, so they pass this check but won't finalize anyway because `next_action.is_none()` returns `false`
268 KiB
268 KiB