6d5c8ac4867ae66554b3cc65bc15a3f73730912b
258 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6d5c8ac486 | chore: bump version to 0.0.150 | ||
|
|
20b99300fe |
Add session-level review endpoint with StartReviewDialog (Vibe Kanban) (#1849)
* All checks pass. Let me provide a summary of what was implemented:
I've implemented the review endpoint as planned. Here's what was created:
1. **`crates/executors/src/actions/review.rs`** - New action type with:
- `RepoReviewContext` struct (repo_id + commit_hashes)
- `ReviewRequest` struct (executor_profile_id, context, additional_prompt, working_dir)
- `Executable` trait impl that calls `executor.spawn_review()`
2. **`crates/server/src/routes/task_attempts/review.rs`** - Endpoint handler with:
- `StartReviewRequest` for the API
- `RepoReviewContext` (endpoint-specific copy)
- `ReviewError::ProcessAlreadyRunning`
- `start_review` handler that:
- Verifies no running processes on workspace
- Creates fresh session
- Builds ReviewRequest action
- Starts execution with `ExecutionProcessRunReason::CodingAgent`
1. **`crates/executors/src/executors/mod.rs`**:
- Added `spawn_review()` to `StandardCodingAgentExecutor` trait with default prompt-based implementation
- Added `build_review_prompt()` helper function
2. **`crates/executors/src/actions/mod.rs`**:
- Added `pub mod review;`
- Added `ReviewRequest` to `ExecutorActionType` enum
- Updated `base_executor()` match
3. **`crates/services/src/services/container.rs`**:
- Updated match in `try_start_next_action` to handle `ReviewRequest`
4. **`crates/server/src/routes/task_attempts.rs`**:
- Added `pub mod review;`
- Added `.route("/review", post(review::start_review))`
5. **`crates/server/src/bin/generate_types.rs`**:
- Added new types to export list
**`POST /task-attempts/{id}/review`**
Request:
```json
{
"executor_profile_id": { "executor": "CLAUDE_CODE", "variant": null },
"context": [{ "repo_id": "uuid", "commit_hashes": ["abc123"] }],
"additional_prompt": "Focus on security issues"
}
```
Response: `ExecutionProcess` on success, `ReviewError` on failure.
To add native review for an executor (e.g., Codex), just override `spawn_review()` in that executor's `StandardCodingAgentExecutor` impl. No changes needed to action or endpoint.
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
All checks pass now. The duplicate type issue is fixed - we're using a single `RepoReviewContext` type from the executors crate.
All checks pass now. Both frontend lint (ESLint) and backend lint (Clippy) are passing.
Found and fixed the real issue. The problem was in `crates/services/src/services/container.rs` - the log normalization was only set up for `CodingAgentInitialRequest` and `CodingAgentFollowUpRequest`. `ReviewRequest` was falling through to the default case and returning `None`, so no normalizer was started for review processes.
Fixed in two places:
1. **Line 787-791**: Added `ReviewRequest` handling in `stream_normalized_logs` (for historic logs)
2. **Line 1149-1151**: Added `ReviewRequest` handling in `start_execution` (for live logs)
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Backend changes for the `use_all_workspace_commits` flag are complete. Here's what was implemented:
Added `use_all_workspace_commits` flag to `StartReviewRequest` for automatically populating review context.
1. **`crates/db/src/models/execution_process_repo_state.rs`**
- Added `find_initial_commits_for_workspace()` - query to get the earliest `before_head_commit` for each repo in a workspace
2. **`crates/server/src/routes/task_attempts/review.rs`**
- Added `use_all_workspace_commits: bool` field to `StartReviewRequest` (defaults to `false`)
- When flag is `true` and `context` is `None`, auto-populates context with initial commits from workspace execution processes
3. **`crates/executors/src/executors/mod.rs`**
- Updated `build_review_prompt()` to detect single-commit context (indicating initial commit)
- When single commit per repo, prompts agent to "Review all changes made since the following base commit(s)" with git diff hint
4. **`crates/services/src/services/git.rs`**
- Added `get_commits_since_branch()` method (may be useful for future use)
5. **`shared/types.ts`**
- Generated TypeScript type includes `use_all_workspace_commits: boolean`
When frontend calls `POST /task-attempts/{id}/review` with:
```json
{
"executor_profile_id": { "executor": "CLAUDE_CODE", "variant": null },
"use_all_workspace_commits": true
}
```
The backend will:
1. Find the earliest execution process for the workspace
2. Get the `before_head_commit` for each repo (the commit before agents started making changes)
3. Pass that to the prompt builder which tells the agent to review all changes since that commit
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Frontend UI implementation is complete. Here's a summary of what was added:
Added simple frontend UI to test the review endpoint.
1. **`frontend/src/lib/api.ts`**
- Added `startReview` method to `attemptsApi`
- Imports `StartReviewRequest`, `ReviewError` types
2. **`frontend/src/hooks/useStartReview.ts`** (NEW)
- Hook that calls `attemptsApi.startReview` with `use_all_workspace_commits: true`
- Invalidates `processes` and `branchStatus` queries on success
3. **`frontend/src/hooks/index.ts`**
- Exports `useStartReview`
4. **`frontend/src/components/ui/actions-dropdown.tsx`**
- Added "Start Review" menu item in the attempt actions section
- Uses the user's default executor profile from config
- Shows loading state while starting review
5. **`frontend/src/i18n/locales/en/tasks.json`**
- Added translation keys: `startReview`, `startingReview`
From the workspace actions dropdown (three dots menu), click "Start Review" to start a code review session using all workspace commits as context.
Done! The fix has been implemented. The review endpoint now uses `Session::find_latest_by_workspace_id` to find an existing session for the workspace, and only creates a new session if none exists. This means review logs will now appear in the same conversation view as other coding agent runs.
**Change summary:**
- Modified `crates/server/src/routes/task_attempts/review.rs` (lines 79-93)
- Instead of always creating a new session, it now checks for an existing session first using `Session::find_latest_by_workspace_id`
- This matches the pattern used by dev server, setup scripts, and other similar endpoints
Done! The fix is now in place. The change adds `ReviewRequest` to the action type filter in `useConversationHistory.ts` so review processes are included in the conversation view, and handles the content extraction appropriately (using `additional_prompt` for reviews instead of `prompt`).
**Change summary:**
- Modified `frontend/src/hooks/useConversationHistory.ts` (lines 226-244)
- Added `ReviewRequest` to the action type filter
- Used conditional to extract content from `additional_prompt` for reviews (with fallback "Review the code changes") vs `prompt` for coding agent requests
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
Done! All fixes are now in place:
1. **`useConversationHistory.ts` - `flattenEntries()`** (line 177-184): Added `ReviewRequest` to the filter so review processes are included in the flattened entries
2. **`useConversationHistory.ts` - `flattenEntriesForEmit()`** (line 226-244): Already fixed earlier - handles `ReviewRequest` and extracts `additional_prompt` for user message content
3. **`ProcessesTab.tsx`** (line 223-228): Added `ReviewRequest` to the ProfileVariantBadge conditional so the agent badge shows for review processes
* Done. Changes made:
1. **`crates/executors/src/actions/review.rs`**: Added `prompt: String` field to `ReviewRequest`
2. **`crates/server/src/routes/task_attempts/review.rs`**:
- Import `build_review_prompt`
- Build the full prompt from context and additional_prompt before creating the action
3. **`frontend/src/hooks/useConversationHistory.ts`**: Simplified content extraction to just use `actionType.prompt` for all action types (since `ReviewRequest` now has a prompt field too)
4. **Regenerated TypeScript types** - `ReviewRequest` in `shared/types.ts` now includes the `prompt` field
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Done. Here's a summary of the changes:
**Backend:**
1. **`crates/executors/src/actions/review.rs`**:
- Added `CommitRange` enum with three variants: `FromBase`, `Specific`, and `Range`
- Updated `RepoReviewContext` to use `repo_name: String` and `commits: CommitRange` instead of `commit_hashes`
2. **`crates/executors/src/executors/mod.rs`**:
- Updated `build_review_prompt` to format output with repo names and handle all `CommitRange` variants
3. **`crates/server/src/routes/task_attempts/review.rs`**:
- Simplified `StartReviewRequest` (removed `context` field, kept `use_all_workspace_commits`)
- Updated handler to look up repo names via `Repo::find_by_ids` and use `CommitRange::FromBase`
4. **`crates/server/src/bin/generate_types.rs`**: Added `CommitRange` to exported types
**Frontend:**
- **`frontend/src/hooks/useStartReview.ts`**: Removed `context: null` since that field no longer exists
The prompt will now look like:
```
Please review the code changes.
Repository: vibe-kanban
Review all changes from base commit abc123 to HEAD.
Use `git diff abc123..HEAD` to see the changes.
```
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Codex review support (vibe-kanban e7996a18)
## Context
We've added a review endpoint (\`POST /task-attempts/{id}/review\`) that starts a code review session. Currently it uses a default prompt-based implementation via \`spawn\_review()\` on \`StandardCodingAgentExecutor\`, which builds a prompt and delegates to \`spawn()\`.
## Goal
Implement native Codex review support by overriding \`spawn\_review()\` in the Codex executor to use Codex's native review mechanism instead of the prompt-based approach.
## Current Implementation
### Backend Types
\*\*\`CommitRange\` enum\*\* (\`crates/executors/src/actions/review.rs\`):
\`\`\`rust
pub enum CommitRange {
FromBase { commit: String },
Specific { commits: Vec<String> },
Range { from: String, to: String },
}
\`\`\`
\*\*\`RepoReviewContext\`\*\*:
\`\`\`rust
pub struct RepoReviewContext {
pub repo\_id: Uuid,
pub repo\_name: String,
pub commits: CommitRange,
}
\`\`\`
### Trait Method
\*\*\`spawn\_review()\`\*\* in \`StandardCodingAgentExecutor\` trait (\`crates/executors/src/executors/mod.rs\`):
\`\`\`rust
async fn spawn\_review(
&self,
current\_dir: &Path,
context: Option<&[RepoReviewContext]>,
additional\_prompt: Option<&str>,
env: &ExecutionEnv,
) -> Result<SpawnedChild, ExecutorError> {
// Default: build prompt and delegate to spawn()
let prompt = build\_review\_prompt(context, additional\_prompt);
self.spawn(current\_dir, &prompt, env).await
}
\`\`\`
## Tasks
1. Research Codex's native review API/mechanism (if it has one)
2. Override \`spawn\_review()\` in \`CodexExecutor\` to use native review if available
3. Fall back to prompt-based approach if native review isn't supported
* Done. Here's a summary of the changes:
1. **Removed dead code** from `crates/executors/src/executors/codex/review.rs`:
- Deleted the `map_to_review_target()` function (was ~120 lines)
- Removed unused imports (`CommitRange`, `RepoReviewContext`)
2. **Codex now uses `ReviewTarget::Custom`** with the pre-built prompt, which ensures the displayed prompt matches what Codex actually receives.
The build passes and TypeScript types have been regenerated.
* Use custom review target for codex
* Done. Here's a summary of the changes:
## Summary
Moved the review endpoint from workspace-level to session-level:
### Changes
1. **Created `crates/server/src/routes/sessions/review.rs`**
- New review endpoint at `POST /sessions/{id}/review`
- Takes `Extension<Session>` instead of `Extension<Workspace>`
- Looks up `agent_session_id` from previous executions using `find_latest_coding_agent_turn_session_id()`
- Passes `agent_session_id` to `ReviewAction` for session resumption
2. **Updated `crates/server/src/routes/sessions/mod.rs`**
- Added `pub mod review;`
- Added route `.route("/review", post(review::start_review))`
3. **Updated `crates/server/src/routes/task_attempts.rs`**
- Removed `pub mod review;`
- Removed `.route("/review", post(review::start_review))`
4. **Deleted `crates/server/src/routes/task_attempts/review.rs`**
5. **Updated `crates/server/src/bin/generate_types.rs`**
- Changed path from `task_attempts::review` to `sessions::review`
### API Change
- **Old**: `POST /api/task-attempts/{workspace_id}/review`
- **New**: `POST /api/sessions/{session_id}/review`
This ensures vk sessions and agent sessions are 1:1:
- Existing session → resumes agent session if available
- New session → fresh agent session
* Done! Here's a summary of all the frontend changes:
- Added `startReview` to `sessionsApi` using new endpoint `POST /api/sessions/${sessionId}/review`
- Removed `startReview` from `attemptsApi`
- Changed parameter from `attemptId` to `sessionId` and added optional `workspaceId` for query invalidation
- Changed API call from `attemptsApi.startReview` to `sessionsApi.startReview`
- Added `MagnifyingGlassIcon` import
- Added `onStartReview` and `isReviewStarting` to `SessionProps` interface
- Added "Start Review" menu item in the session dropdown
- Added `useStartReview` hook import and usage
- Added `handleStartReview` callback function
- Passed `onStartReview` and `isReviewStarting` to `SessionChatBox`
- Removed `useStartReview` import
- Removed `useUserSystem` import (now unused)
- Removed `startReview` hook usage
- Removed `handleStartReview` function
- Removed "Start Review" menu item from the dropdown
* Done. The fix adds the `ReviewRequest` case to `latest_executor_profile_for_session()` in `crates/db/src/models/execution_process.rs:688-690`.
The backend check passes. Follow-ups after reviews should now work correctly since the executor profile can be extracted from `ReviewRequest` just like from the other request types.
* Done. Removed `CommitRange` enum entirely. Changes:
1. **`crates/executors/src/actions/review.rs`** - Deleted `CommitRange` enum, changed `RepoReviewContext.commits` to `RepoReviewContext.base_commit: String`
2. **`crates/server/src/routes/sessions/review.rs`** - Updated construction to use `base_commit: initial_commit` instead of `commits: CommitRange::FromBase { commit: initial_commit }`
3. **`crates/executors/src/executors/mod.rs`** - Simplified `build_review_prompt()` to directly use `repo.base_commit` instead of matching on the enum
4. **`crates/server/src/bin/generate_types.rs`** - Removed `CommitRange::decl()` from type exports
5. **`shared/types.ts`** - Regenerated, `CommitRange` type is now gone
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Done. Simplified the review context building:
**Changes:**
1. **`crates/db/src/models/execution_process_repo_state.rs`** - Replaced `find_initial_commits_for_workspace` with `find_initial_commit_for_repo` that takes a specific repo_id and uses ORDER BY + LIMIT 1 instead of GROUP BY/HAVING.
2. **`crates/server/src/routes/sessions/review.rs`** - Simplified the context building:
- Get workspace repos first (has repo names via `display_name`)
- For each repo, get initial commit
- Build context directly - no more HashMap joining, no more separate `Repo::find_by_ids` call
The new code is much easier to follow: get repos → for each, get initial commit → build context.
* Done. Addressed all 23 review comments:
1. Removed comment from `SessionChatBoxContainer.tsx` (line 161)
2. Removed doc comments from `RepoReviewContext` and `ReviewRequest` structs in `review.rs`
3. Removed module doc comment from `codex/review.rs`
4. Removed comment from `codex.rs` about Custom review target
5. Removed doc comments from `spawn_review` trait method in `mod.rs`
6. Removed doc comment from `build_review_prompt` function
7. Removed all comments from `sessions/review.rs` (doc comments and inline comments)
8. Removed unused `get_commits_since_branch` function from `git.rs` (~45 lines of dead code)
* Done. Added the review toggle button:
**Changes:**
1. **`SessionChatBox.tsx`**
- Added `ReviewModeProps` interface with `isActive`, `onToggle`, `isSubmitting`
- Added `reviewMode` prop to `SessionChatBoxProps`
- Added toggle button next to attach button (MagnifyingGlassIcon) - highlighted when active
- Updated placeholder to show "Enter review instructions..." when in review mode
- Removed old `onStartReview` and `isReviewStarting` from SessionProps
- Removed "Start Review" dropdown menu item
2. **`SessionChatBoxContainer.tsx`**
- Added `useState` for `isReviewMode`
- Updated `handleSend` to call `startReviewMutation` with `additionalPrompt` when in review mode
- Reset review mode after successful review start
- Pass `reviewMode` props to SessionChatBox
- Removed old `handleStartReview` callback
Now the user can:
1. Click the magnifying glass toggle next to attach
2. Enter review instructions in the text area
3. Click send → starts review with the prompt
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
TypeScript and Rust both compile. The changes are:
1. Button shows "Review" when review mode is active
2. Toggle icon uses `!text-accent-foreground` to force override the `text-low` class from the base component, along with `bg-accent rounded-sm` for the background highlight
Done. Changed `!text-accent-foreground` to `!text-normal` which uses the design system's proper text color for active/selected states. The `!` prefix forces the override of the base `text-low` class. Both TypeScript and Rust compile successfully.
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
All done. TypeScript and Rust compile successfully. Here's a summary of the changes:
**Created:**
- `frontend/src/components/dialogs/tasks/StartReviewDialog.tsx` - New dialog with:
- Agent/variant selection (using ExecutorProfileSelector)
- Review comments preview (if any)
- Additional instructions textarea
- Start Review / Cancel buttons
**Modified:**
- `frontend/src/components/dialogs/index.ts` - Added export for StartReviewDialog
- `frontend/src/components/ui-new/primitives/SessionChatBox.tsx`:
- Changed `ReviewModeProps` from toggle state to simple callback (`onReviewClick`, `isDisabled`)
- Removed toggle styling and review mode button text
- Button now just opens the dialog
- `frontend/src/components/ui-new/containers/SessionChatBoxContainer.tsx`:
- Removed `isReviewMode` state and `startReviewMutation`
- Added `handleReviewClick` callback that opens `StartReviewDialog`
- Disabled review button when in new session mode or no session exists
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
Done. TypeScript and Rust compile successfully. Summary of changes:
**`StartReviewDialog.tsx`:**
- Added "New Session" toggle (defaults ON when no session exists, disabled when no session to toggle from)
- Added conditional `AgentSelector` - only shown when creating a new session
- Always shows `ConfigSelector` for variant selection
- Handles session creation inline when toggle is on or no session exists
- Updated `onSuccess` callback to return new session ID when created
**`SessionChatBox.tsx`:**
- Removed `isDisabled` from `ReviewModeProps` interface
- Removed `reviewMode.isDisabled` from button disabled logic
**`SessionChatBoxContainer.tsx`:**
- Updated `handleReviewClick` to allow opening dialog without sessionId
- Updated `onSuccess` callback to select the new session if one was created
- Removed `isDisabled` from reviewMode prop
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
Done. Made `reviewMode` required and removed the conditional - the review button is now always shown.
Done. Now the StartReviewDialog:
- Shows `ExecutorProfileSelector` (Agent + Configuration side by side, like CreateAttemptDialog) when "New Session" toggle is ON
- Shows just `ConfigSelector` (variant only) when "New Session" toggle is OFF
TypeScript and Rust compile successfully. The Switch layout has been fixed to match the TaskFormDialog pattern:
- Switch is now on the LEFT of the label
- Uses `gap-2` instead of `justify-between`
- Has proper dark mode styling with `data-[state=checked]:bg-gray-900 dark:data-[state=checked]:bg-gray-100`
- Label has `cursor-pointer` for better UX
Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
Done. The Switch is now moved to the footer (bottom of the dialog), matching the TaskFormDialog pattern:
- Switch on the left side of the footer
- Cancel and Start Review buttons on the right side
- Added `disabled:opacity-50` for better visibility when disabled in dark mode
Done. All changes complete:
1. **Removed header** - No more "Start Review" title or description
2. **Removed labels from selectors** - `showLabel={false}` for both `ExecutorProfileSelector` and `ConfigSelector`
3. **Fixed footer layout** - Cancel button on left, Switch + "New Session" + "Start Review" button grouped on right (matching TaskFormDialog)
4. **TypeScript compiles** - Both frontend and backend checks pass
Done. Changes made:
1. **Moved selector to bottom** - Now the order is: Additional Instructions textarea → Review comments preview → Error → Profile/Config selector → Footer
2. **Fixed Switch visibility** - Changed from `data-[state=checked]:bg-gray-900 dark:data-[state=checked]:bg-gray-100` to `bg-muted-foreground/30 data-[state=checked]:bg-foreground` using semantic colors
3. **TypeScript compiles** - Both frontend and backend checks pass
Done. The Switch className now uses `!` important modifiers to override the component's hardcoded background colors:
- `!bg-muted-foreground/30` - visible gray background when unchecked (overrides `bg-input`)
- `data-[state=checked]:!bg-foreground` - foreground color when checked (overrides `bg-foreground`)
Done. Changed the Switch className to use `!bg-muted` which should provide better contrast against the dialog's `bg-primary` background.
Done. Changed the Switch className to use `!bg-border` which should provide some contrast against the dialog's `bg-primary` background (25% lightness vs 18% lightness).
* Fix duplicate routes
* I've analyzed the problem. Here's my understanding:
**The issue:** After rebasing, stored commit SHAs (`after_head_commit`) become invalid because rebasing rewrites history with new SHAs.
**Your suggestion (`git diff A^..B`):** This still has the same problem - after rebase, commit `A` doesn't exist with that SHA anymore. `A^` requires resolving commit `A` first.
**My recommended fix:** Instead of using stored commit SHAs, use the **branch name** as the base:
- `git diff {target_branch}..HEAD` instead of `git diff {commit_sha}..HEAD`
- This is always valid regardless of rebasing
- Matches user intent: "show all changes on this workspace branch vs base"
This would require changes to:
1. `review.rs` - use `workspace.target_branch` instead of querying `find_first_commit_for_repo`
2. `build_review_prompt` - update to use branch name
3. `RepoReviewContext` - change `base_commit` to `base_branch`
**Questions:**
1. Is using `target_branch` the right base? Or do you need something more granular like "changes since session X"?
2. Should we keep `before_head_commit`/`after_head_commit` for per-execution tracking, or simplify?
* Done. Here's a summary of the changes:
## Changes Made
### 1. `crates/services/src/services/git/cli.rs`
- Made `merge_base` method public (was `fn`, now `pub fn`)
### 2. `crates/services/src/services/git.rs`
- Added new public method `get_fork_point()` that wraps the CLI `merge_base` function
- This method uses `git merge-base --fork-point` which survives rebasing by consulting the reflog
### 3. `crates/server/src/routes/sessions/review.rs`
- Removed import of `ExecutionProcessRepoState` (no longer needed)
- Added `PathBuf` import
- Changed from querying stored `after_head_commit` SHAs to computing fork-point dynamically
- Now uses `WorkspaceRepo::find_repos_with_target_branch_for_workspace` to get per-repo target branches
- Computes `get_fork_point(repo_path, target_branch, workspace.branch)` for each repo
## How It Works Now
Instead of storing commit SHAs that become invalid after rebasing:
```rust
// Old (broken after rebase):
let base_commit = ExecutionProcessRepoState::find_first_commit_for_repo(...)
```
We now compute the fork-point dynamically:
```rust
// New (survives rebasing):
let base_commit = deployment.git().get_fork_point(
&repo_path,
&repo.target_branch, // e.g., "main"
&workspace.branch, // e.g., "vk/task-123"
)
```
This uses `git merge-base --fork-point` which consults the reflog to find where the branch originally diverged, regardless of subsequent rebases.
* Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Removed the unused `find_first_commit_for_repo` function. Everything still compiles.
* All comments removed and code still compiles.
* Fixed. The changes:
1. Added `effective_dir` method to `ReviewRequest` in `crates/executors/src/actions/review.rs`
2. Updated `container.rs` to use `request.effective_dir(&workspace_root)` instead of `workspace_root.clone()` for `ReviewRequest`
Now the log normalization for reviews will use the correct working directory, matching how the agent is actually spawned.
* Fixed. Now the workspace is re-fetched after `ensure_container_exists` to get the updated `container_ref`.
* Fixed. Now using the `container_ref` returned directly from `ensure_container_exists` instead of re-fetching the workspace.
* Fixed the naming:
- `workspace_path` - the container_ref path containing all repos
- `worktree_path` - the path to a specific repo's worktree within the workspace
* Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Done. I've added an "Include git context" checkbox to the StartReviewDialog:
- Added state `includeGitContext` defaulting to `true`
- Added a checkbox UI with label "Include git context"
- The checkbox value is passed to the API as `use_all_workspace_commits`
The checkbox appears after the error message area and before the executor profile selector. Users will see it checked by default, making it clear that git context is being included without needing to add it themselves in the prompt.
* I've completed the i18n task. Here's a summary of what was done:
1. **Added i18n support to `StartReviewDialog.tsx`**:
- Imported `useTranslation` from `react-i18next`
- Replaced all hardcoded strings with translation keys:
- "Additional Instructions (optional)" → `t('startReviewDialog.additionalInstructions')`
- "Review Comments (...)" → `t('startReviewDialog.reviewComments', { count: ... })`
- "Include git context" → `t('startReviewDialog.includeGitContext')`
- "New Session" → `t('startReviewDialog.newSession')`
- "Cancel" → `t('common:buttons.cancel')`
- "Starting..." / "Start Review" → `t('actionsMenu.startingReview')` / `t('actionsMenu.startReview')`
2. **Added translations to all locale files** (`en`, `es`, `ja`, `ko`, `zh-Hans`, `zh-Hant`):
- Added `startReviewDialog` object with `additionalInstructions`, `reviewComments`, `includeGitContext`, and `newSession` keys
- Added `actionsMenu.startReview` and `actionsMenu.startingReview` to all non-English locales
3. **Verified with i18n check script**: All checks pass - no new literal strings introduced, no duplicate keys, and translation keys are consistent across all locales.
* Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* All checks pass. I've added a description below the "Include git context" checkbox:
**English:** "Tells the agent how to view all changes made on this branch"
The description appears as smaller muted text below the checkbox, explaining to users what the option does - it instructs the agent how to see all the changes on this branch (via the git diff command we inject). This helps users understand they don't need to manually ask the agent about branch changes.
* Done. Here's a summary of the changes:
1. **Replaced conditional rendering** with always showing both `AgentSelector` and `ConfigSelector`
2. **Agent selector is disabled** when `createNewSession` is false (locked to the session's executor)
3. **Fixed the variant retention bug** by adding `handleNewSessionChange` that resets `selectedProfile` to `defaultProfile` when toggling "New Session" off - this ensures the variant matches the locked executor
* Types
* Removed the unused `useStartReview` hook and its export from `hooks/index.ts`.
* All checks pass. Here's a summary of the changes made:
**`frontend/src/components/ui-new/actions/index.ts`:**
1. Added `HighlighterIcon` to the Phosphor icons import (line 33)
2. Added `StartReviewDialog` import (line 49)
3. Added `StartReview` action definition (lines 293-304) with:
- `id: 'start-review'`
- `label: 'Start Review'`
- `icon: HighlighterIcon`
- `requiresTarget: true`
- Visibility when workspace exists
- Execute function that opens `StartReviewDialog`
**`frontend/src/components/ui-new/actions/pages.ts`:**
1. Added `{ type: 'action', action: Actions.StartReview }` as the first item in the `workspaceActions` page group (line 105)
The "Start Review" action with the highlighter icon will now appear in the workspace actions menu (accessed via CMD+K or the three-dots menu on a workspace).
* All checks pass. Done. Here's a summary of the additional change:
**`frontend/src/components/ui-new/primitives/SessionChatBox.tsx`:**
- Changed `MagnifyingGlassIcon` to `HighlighterIcon` in the import (line 12)
- Updated the `ToolbarIconButton` to use `HighlighterIcon` instead of `MagnifyingGlassIcon` (line 635)
The review button in the text input now shows the highlighter icon instead of the magnifying glass.
* All checks pass. Here's a summary of the changes:
**`frontend/src/components/ui-new/primitives/Toolbar.tsx`:**
- Added proper disabled styling to `ToolbarIconButton` (`opacity-40 cursor-not-allowed`)
**`frontend/src/components/ui-new/primitives/SessionChatBox.tsx`:**
- Removed `HighlighterIcon` import (no longer hardcoded)
- Added `Icon` type import
- Replaced `ReviewModeProps` with generic `ToolbarActionProps` interface (`icon`, `label`, `onClick`)
- Changed `reviewMode` prop to `toolbarActions?: ToolbarActionProps[]`
- Updated footer to render toolbar actions dynamically from the array
**`frontend/src/components/ui-new/containers/SessionChatBoxContainer.tsx`:**
- Added `HighlighterIcon` import
- Changed `reviewMode` prop to `toolbarActions` array with the review action
The button is now:
1. Generic - accepts any action with icon/label/onClick
2. Shows proper disabled state (opacity + cursor)
3. Extensible - you can add more toolbar actions by adding to the array
* All checks pass. Now toolbar actions work identically to navbar actions:
**Summary of changes:**
1. **`SessionChatBox.tsx`**:
- Changed `toolbarActions` prop from simple `{icon, label, onClick}[]` to `{actions, context, onExecuteAction}` structure
- Uses `ActionDefinition[]` from the actions system
- Uses `isActionEnabled()` to derive disabled state from action context
- Uses `isSpecialIcon()` to filter out non-standard icons
- Handles `label` being either a string or function
2. **`SessionChatBoxContainer.tsx`**:
- Added `useActions()` and `useActionVisibilityContext()` hooks
- Created `handleToolbarAction` callback that routes actions through `executeAction`
- Created `toolbarActionsList` array containing `Actions.StartReview`
- Passes the full action context to `SessionChatBox`
Now adding a new action to the conversation input works the same as navbar:
```typescript
// Just add to the array
const toolbarActionsList = useMemo(
() => [Actions.StartReview, Actions.SomeOtherAction],
[]
);
```
The action's `isVisible`, `isEnabled`, icon, label, and execute logic all come from the central `Actions` definition in `index.ts`.
* Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Done. The "Start Review" action with the highlighter icon now appears in both the navbar (left side) and the chat input toolbar.
* Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Done. Removed `StartReview` from the navbar and added `ToggleChangesMode` to the conversation input toolbar alongside `StartReview`.
* Done.
* Removed the review-specific branch so the handler is generic, matching other containers. The toolbar action now just respects `requiresTarget`.
Details and context:
- Simplified the action handler in `frontend/src/components/ui-new/containers/SessionChatBoxContainer.tsx:444` to rely solely on the generic `action.requiresTarget` path.
- This aligns with `frontend/src/components/ui-new/containers/NavbarContainer.tsx:66`, where all actions flow through the same generic logic.
Next steps:
1) If you want, I can run a quick lint/typecheck on the frontend (`pnpm run check`) to confirm.
* Aligned the chatbox to use the shared visibility system, like the navbar, so action availability is handled by the same logic and execution stays generic.
Details and context:
- Filtered `toolbarActionsList` through `isActionVisible` with the shared `actionCtx` so Start Review only appears when it’s supposed to.
- Kept the execution handler generic so it just respects `requiresTarget`.
Files:
- `frontend/src/components/ui-new/containers/SessionChatBoxContainer.tsx`
Next steps:
1) If you want me to run a quick frontend typecheck (`pnpm run check`), say the word.
* Cleanup script changes for workspace 38f8b607-9fdc-43dc-afa3-16e8f5e9cbd3
* Updated the Start Review dialog so it derives the active session and a default executor profile from workspace context + config, which restores preselection and enables the “new session” toggle when a session exists. This keeps the chatbox action generic while fixing the dialog behavior.
Details and context:
- Added workspace context awareness and default profile derivation (mirrors Create Attempt’s logic).
- Uses the resolved session id to enable/disable the toggle and to decide whether a new session is required.
- Keeps user selection override behavior intact.
File:
- `frontend/src/components/dialogs/tasks/StartReviewDialog.tsx`
If you want, I can also add a quick regression check or walk through the UI flow with you.
* Fixed the lint issue and clippy qa-mode compile warning, then reran the requested commands. The Start Review dialog now uses `resolvedSessionId` consistently in its callback, and review log normalization handles qa-mode without unused vars.
Files updated:
- `frontend/src/components/dialogs/tasks/StartReviewDialog.tsx`
- `crates/services/src/services/container.rs`
Commands run:
- `npm run lint`
- `npm run format`
- `npm run check`
* Renamed the match binding to `_request` so we don’t need the no-op line, and removed the comment you flagged.
Notes:
- The `let _ = request;` was only there to silence an unused-var warning under the `qa-mode` cfg. Using `_request` is the standard way to mark it intentionally unused.
Files:
- `crates/services/src/services/container.rs`
- `frontend/src/components/ui-new/containers/SessionChatBoxContainer.tsx`
Want me to rerun `npm run lint` since this touched the linted files?
* Split the `ReviewRequest` arm by cfg so qa-mode uses `_request` and non-qa uses `request` normally—no dummy line needed.
File:
- `crates/services/src/services/container.rs`
* Done. The fix adds `ReviewRequest` to the match statement that creates `CodingAgentTurn` records. Now when a review is started, a `coding_agent_turn` row will be created with the review prompt, and the `agent_session_id` will be stored when Codex reports it. Subsequent follow-ups will find this session ID and correctly use `CodingAgentFollowUpRequest` instead of starting a fresh session.
* Done. Now if a new `ExecutorActionType` variant is added, the compiler will error on this match and force the developer to decide whether it should create a `CodingAgentTurn` record.
* Adjusted `sessionsApi.startReview` to return the unwrapped payload like other session calls, and aligned the `handleApiResponse` generic so callers get an `ExecutionProcess` instead of a misleading `ApiResponse`. This fixes the runtime mismatch and keeps the API consistent.
Updated `frontend/src/lib/api.ts`.
If you want, I can:
1) run `pnpm run check` to validate types, or
2) scan for any other session APIs with inconsistent `handleApiResponse` generics.
* All checks pass. Summary of changes:
1. **Removed tooltip from dialog button** - Dialog buttons don't use tooltips in this codebase
2. **Added `getTooltip` to the `StartReview` action definition** in `actions/index.ts` - This is the pattern used for action tooltips ("Ask the agent to review your changes")
3. **Removed `submitTooltip` from all locale files** since it's no longer used
4. **Added missing `title` and `description` to zh-Hant locale**
* Done. Now when a new session is created, the dialog will call `selectSession(targetSessionId)` to switch to the newly created session before closing.
|
||
|
|
ddb92351f5 | update cursor-agent models (#1977) | ||
|
|
2c474d689c | chore: bump version to 0.0.149 | ||
|
|
8074d8f3f5 |
Fix QA mode lint warnings with conditional compilation attributes (Vibe Kanban) (#1958)
* All lint checks pass. Here's a summary of the fixes I made: **Fixed files:** 1. **`crates/executors/src/actions/coding_agent_follow_up.rs`**: - Made `ExecutorConfigs` import conditional with `#[cfg(not(feature = "qa-mode"))]` - Added `let _ = &approvals;` in qa-mode block to silence unused variable warning 2. **`crates/executors/src/actions/coding_agent_initial.rs`**: - Same fixes as above 3. **`crates/executors/src/executors/qa_mock.rs`**: - Changed `std::io::Error::new(std::io::ErrorKind::Other, e)` to `std::io::Error::other(e)` (clippy `io_other_error` lint) 4. **`crates/services/src/services/container.rs`**: - Made `ExecutorConfigs` import conditional with `#[cfg(not(feature = "qa-mode"))]` - Renamed `executor_profile_id` to `_executor_profile_id` to indicate it's conditionally used 5. **`crates/services/src/services/filesystem.rs`**: - Made imports conditional: `HashSet`, `WalkBuilder`, and `CancellationToken` are only needed in non-qa-mode - Added `#[cfg(not(feature = "qa-mode"))]` to helper functions: `get_directories_to_skip`, `list_git_repos_with_timeout`, `list_git_repos_inner` - Renamed parameters to `_path`, `_timeout_ms`, `_hard_timeout_ms`, `_max_depth` since they're not used in qa-mode - Removed needless `return` statements in qa-mode blocks 6. **`crates/services/src/services/qa_repos.rs`**: - Changed `&PathBuf` to `&std::path::Path` in function parameter (clippy `ptr_arg` lint) * Cleanup script changes for workspace 6fcb2b78-f418-451f-9a22-8d4381a538f0 * All lint checks pass. The fix now uses `#[cfg_attr(feature = "qa-mode", allow(unused_variables))]` which cleanly communicates that the variables are intentionally unused only in qa-mode, while keeping the normal parameter names. * All lint checks pass. Fixed by using `#[cfg_attr(feature = "qa-mode", allow(unused_variables))]` and keeping the proper variable name `executor_profile_id` (which is used in non-qa-mode). * All lint checks pass. The changes are now cleaner - using `#[cfg_attr(feature = "qa-mode", allow(unused_variables))]` on the function instead of `let _ = &approvals;` inside the qa-mode block. To summarize the cleanup: I replaced the inline `let _ = &approvals;` workaround in `coding_agent_initial.rs` and `coding_agent_follow_up.rs` with the cleaner `#[cfg_attr]` attribute on the function, which is consistent with how we handled it in `filesystem.rs` and `container.rs`. |
||
|
|
7de87e9b3a |
Add QA mode for automated testing with mock executor and hardcoded repos (Vibe Kanban) (#1940)
* The QA mode implementation is complete. Here's a summary of what was implemented:
## Summary
I've successfully implemented the QA mode feature for the vibe-kanban application. Here's what was created/modified:
### New Files
1. **`crates/services/src/services/qa_repos.rs`** - QA repos module that:
- Defines two hardcoded QA repo URLs (`internal-qa-1` and `internal-qa-2`)
- Clones repos to a persistent temp directory on first access using `git2`
- Returns `DirectoryEntry` compatible with existing API
2. **`crates/executors/src/executors/qa_mock.rs`** - Mock executor that:
- Implements `StandardCodingAgentExecutor` trait
- Performs random file operations (create, delete, modify)
- Streams 10 mock log entries in ClaudeJson format over 10 seconds
- Reuses Claude's log processor for normalization
### Modified Files
1. **Cargo.toml files** - Added `qa-mode` feature flags to:
- `crates/executors/Cargo.toml`
- `crates/services/Cargo.toml`
- `crates/server/Cargo.toml`
2. **`crates/executors/src/executors/mod.rs`** - Added:
- Conditional `qa_mock` module export
- `QaMock` variant to `CodingAgent` enum
- Updated `capabilities()` match arm
3. **`crates/executors/src/mcp_config.rs`** - Added `QaMock` handling
4. **`crates/services/src/services/filesystem.rs`** - Override `list_git_repos` and `list_common_git_repos` in QA mode
5. **`crates/services/src/services/container.rs`** - Override `normalize_logs` executor lookup in QA mode
6. **`crates/executors/src/actions/coding_agent_initial.rs`** - Override spawn in QA mode
7. **`crates/executors/src/actions/coding_agent_follow_up.rs`** - Override spawn in QA mode
8. **`vibe-kanban/package.json`** - Added QA build scripts:
- `backend:dev:qa`
- `backend:dev:watch:qa`
- `dev:qa`
### Usage
```bash
# Run backend in QA mode
cargo run --features qa-mode
# Or with pnpm
pnpm run dev:qa
```
When QA mode is enabled:
- `GitPanelCreate` will show only `internal-qa-1` and `internal-qa-2` as recent repos
- Starting any task will perform mock file operations and stream 10 logs over 10 seconds
- Logs follow the ClaudeJson format for compatibility with the existing log processor
* Cleanup script changes for workspace 15499061-ec87-4c1c-81b9-994e84d0e75b
* The TLS error fix is complete. I've replaced the `git2::Repository::clone` call with the `git` CLI approach in `qa_repos.rs`:
**Changes made:**
- Updated `clone_qa_repos_if_needed` function to use `Command::new("git")` with `["clone", "--depth", "1", url, path]` arguments instead of `git2::Repository::clone`
- Added `--depth 1` for shallow cloning (faster)
- Updated error handling to capture stderr output from the git command
The fix uses the git CLI which has reliable TLS support, avoiding the TLS configuration issues that git2 can have on some systems. This matches patterns used elsewhere in the codebase (e.g., `crates/remote/src/github_app/service.rs`).
You can now run `pnpm run backend:dev:qa` or `pnpm run dev:qa` and the QA repos should clone successfully.
* Cleanup script changes for workspace 15499061-ec87-4c1c-81b9-994e84d0e75b
* Done! I've made the mock logs strongly typed by:
1. **Added imports** for `ClaudeJson`, `ClaudeMessage`, `ClaudeContentItem`, and `ClaudeToolData` from the Claude executor
2. **Replaced `generate_mock_logs()`** to use strongly-typed structs:
- Each log entry is now a proper `ClaudeJson` enum variant
- Uses `ClaudeMessage` with proper fields (`id`, `message_type`, `role`, `model`, `content`, `stop_reason`)
- Uses `ClaudeContentItem` variants (`Thinking`, `ToolUse`, `ToolResult`, `Text`)
- Uses `ClaudeToolData` variants (`Read`, `Write`, `Bash`)
- Serializes to JSON using `serde_json::to_string()` for correct escaping
3. **Updated tests** to verify the logs deserialize back to `ClaudeJson` types
This ensures:
- All fields match what `ClaudeLogProcessor::process_logs()` expects
- No manual JSON escaping needed (serde handles it)
- Compile-time type checking prevents malformed logs
- Session IDs are consistent across all entries
* Cleanup script changes for workspace 15499061-ec87-4c1c-81b9-994e84d0e75b
* Done! I've fixed the log display issue by replacing the shell echo approach with a temp file approach:
**Changes made to `crates/executors/src/executors/qa_mock.rs`:**
1. **Write logs to a temp file** instead of embedding them in a shell script:
- Creates a temp file at `$TMPDIR/qa_mock_logs_{uuid}.jsonl`
- Writes all logs as newline-delimited JSON
2. **Use `IFS= read -r` to read the file** - this preserves exact content:
- `IFS=` prevents word splitting
- `-r` prevents backslash interpretation
- `echo "$line"` outputs the exact line content
3. **Clean up the temp file** after reading with `rm -f`
**Benefits:**
- No shell escaping needed - file contents are read verbatim
- Each line is output exactly as serialized by serde_json
- Avoids issues with single quotes, backslashes, and escape sequences
- Temp file is automatically cleaned up after use
This should fix the issue where logs were appearing as raw JSON or with corrupted content due to shell escaping issues.
* fix formatting
* Build succeeds. I've applied the same fix to the two remaining locations that had newlines in their content:
1. **Line 234** - README tool result: Changed `\n\n` to `\\n\\n`
2. **Line 302** - Bash tool result: Changed `\n` to `\\n`
This matches the pattern the user established in the assistant final message (line 318) where `\\n` is used instead of `\n` to ensure newlines are properly preserved through the serialization and display pipeline.
* Cleanup script changes for workspace 15499061-ec87-4c1c-81b9-994e84d0e75b
* simplify scripts
* update agents.md
|
||
|
|
bd09ba8bd0 | chore: bump version to 0.0.148 | ||
|
|
3ad03a0a99 | chore: bump version to 0.0.147 | ||
|
|
527febdc52 | Workspaces FE (#1733) | ||
|
|
fe2215ba85 | chore: bump version to 0.0.146 | ||
|
|
ae852b297f | chore: bump version to 0.0.145 | ||
|
|
cefb4fb0a2 | upgrade copilot cli (#1844) | ||
|
|
3749be636a |
WIP: use Opencode sdk (#1823)
Opencode ACP server is broken on windows. Using the Opencode HTTP SDK directly, works better. |
||
|
|
76feaefdfe |
feat: add Exa and Chrome DevTools as one-click MCP server options (Vibe Kanban) (#1801)
* I've added the Exa Code MCP server as a one-click install option. Here's what was configured: **Changes made to `crates/executors/default_mcp.json`:** 1. **Server configuration** (lines 23-33): - Command: `npx -y exa-mcp-server` - Tools enabled: `web_search_exa` and `get_code_context_exa` (as requested) - Environment variable: `EXA_API_KEY` (required for authentication) 2. **Metadata** (lines 53-58): - Name: "Exa" - Description: "Web search and code context retrieval powered by Exa AI" - URL: https://docs.exa.ai/reference/exa-mcp - Icon: `mcp/exa_logo.svg` (already exists) The Exa MCP server icon was already present in the frontend public assets at `frontend/public/mcp/exa_logo.svg`. * Done. I've added Chrome DevTools MCP as a one-click install option: **Server configuration** (lines 34-39): - Command: `npx chrome-devtools-mcp@latest` - No environment variables required **Metadata** (lines 65-70): - Name: "Chrome DevTools" - Description: "Browser automation, debugging and performance analysis with Chrome DevTools" - URL: https://github.com/ChromeDevTools/chrome-devtools-mcp - Icon: `mcp/chrome_devtools_logo.svg` * The issue was that `justify-center` and `gap-3` were interfering with Embla Carousel's scroll calculations. Embla uses a specific margin/padding system (`-ml-4` on the content container and `pl-4` on items) to handle spacing and scroll positions. Adding `justify-center` shifts items in a way that breaks the scroll math, making it impossible to scroll to the leftmost items. The fix removes these conflicting classes from `CarouselContent`. |
||
|
|
edef39c3fb | chore: bump version to 0.0.144 | ||
|
|
3d3f260e1c |
bump Opencode to v1.1.3 (#1798)
* bump opencode to v1.1.3 * use correct working workspace directory for normalize_logs use the same directory that was used during agent runtime to ensure make_relative_path works as expected |
||
|
|
17afc0cd03 |
Add composer-1 as a model for Cursor agent (#1786)
* Add composer-1 as a model for Cursor agent * fmt --------- Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com> |
||
|
|
2cd4c1b181 |
Bump Claude Code, Codex, and Gemini CLI versions (Vibe Kanban) (#1778)
* Done! I've updated the Claude Code version from `2.0.75` to `2.0.76` in `mission-control/crates/executors/src/executors/claude.rs:46`. * Updated Gemini CLI from version 0.21.1 to 0.22.5 in `mission-control/crates/executors/src/executors/gemini.rs:39`. * Updated Codex from version 0.75.0 to 0.77.0 in `mission-control/crates/executors/src/executors/codex.rs:213`. |
||
|
|
84efb885fb |
Update opencode-ai version to 1.0.223 (#1739)
Co-authored-by: Warp <agent@warp.dev> |
||
|
|
f99d2f06f2 | chore: bump version to 0.0.143 | ||
|
|
033ae2f1c6 | chore: bump version to 0.0.142 | ||
|
|
271fd9a19a |
Bump Claude Code to 2.0.75 + disallow AskUserQuestion tool (#1626)
* Done. I've bumped `@anthropic-ai/claude-code` from `2.0.54` to `2.0.75` in `vibe-kanban/crates/executors/src/executors/claude.rs:46`. * Auto deny AskUserQuestion tool * Revert "Auto deny AskUserQuestion tool" This reverts commit 09be71f13ac3ff6883bf98a9107959cc6ce96726. * Disallow AskUserQuestion |
||
|
|
bcbe7aca69 | chore: bump version to 0.0.141 | ||
|
|
ca2b578231 | chore: bump version to 0.0.140 | ||
|
|
2f5cef2dff |
Add agent working directory setting to run coding agents from repo directory (Vibe Kanban) (#1617)
* Done! The migration has been updated to copy `dev_script_working_dir` values to `agent_working_dir` for existing projects. The change: **`vibe-kanban/crates/db/migrations/20251219000000_add_agent_working_dir_to_projects.sql`**: ```sql -- Add column with empty default first ALTER TABLE projects ADD COLUMN agent_working_dir TEXT DEFAULT ''; -- Copy existing dev_script_working_dir values to agent_working_dir UPDATE projects SET agent_working_dir = dev_script_working_dir WHERE dev_script_working_dir IS NOT NULL AND dev_script_working_dir != ''; ``` This ensures that when the migration runs, existing projects will have their `agent_working_dir` automatically populated from their existing `dev_script_working_dir` setting. * Done! The migration has been updated to only copy `dev_script_working_dir` to `agent_working_dir` for single-repo projects. Multi-repo projects will keep `agent_working_dir` empty (None). The key change in the migration: ```sql UPDATE projects SET agent_working_dir = dev_script_working_dir WHERE dev_script_working_dir IS NOT NULL AND dev_script_working_dir != '' AND (SELECT COUNT(*) FROM project_repos WHERE project_repos.project_id = projects.id) = 1; ``` The subquery `(SELECT COUNT(*) FROM project_repos WHERE project_repos.project_id = projects.id) = 1` ensures only projects with exactly one repository get the default value copied. * Done! All tasks completed: 1. **Resolved the rebase conflict** in `task_attempts.rs` - removed the duplicate `follow_up` function since it was moved to `sessions/mod.rs` on main 2. **Updated `sessions/mod.rs`** with the `working_dir` changes - added the code to get `agent_working_dir` from project settings and pass it to both `CodingAgentFollowUpRequest` and `CodingAgentInitialRequest` 3. **Ran `npm run prepare-db`** - successfully prepared the database and updated sqlx cache 4. **Verified compilation** - all crates compile successfully The migration now only copies `dev_script_working_dir` to `agent_working_dir` for single-repo projects (projects with exactly 1 repo in `project_repos` table). Multi-repo projects will keep `agent_working_dir` empty. * Done. Removed all 6 comments as requested. * Done! The implementation is now complete: 1. **Database migration** - Copies `dev_script_working_dir` to `agent_working_dir` for single-repo projects at migration time 2. **Runtime backfill** - `backfill_repo_names()` in `container.rs` sets `agent_working_dir` for existing single-repo projects where it's still empty 3. **Project creation** - New single-repo projects automatically get `agent_working_dir` set to the repo name All three scenarios are now covered for setting `agent_working_dir` on single-repo projects. * Done! The frontend UI for `agent_working_dir` has been added: 1. Added `agent_working_dir: string` to `ProjectFormState` interface 2. Added `agent_working_dir` to `projectToFormState` function 3. Added `agent_working_dir` to the `handleSave` payload 4. Added the input field after the dev server working directory input * All tasks are complete. The implementation is finished: **Summary of changes:** 1. **Project model**: Renamed `agent_working_dir` to `default_agent_working_dir` - this is now a default value for new workspaces 2. **Workspace model**: Added `agent_working_dir` field - this captures the project's default at workspace creation time 3. **Workspace creation**: Updated `create_task_attempt` to fetch the project's `default_agent_working_dir` and pass it to the workspace 4. **Execution sites**: Updated all 4 locations to use `workspace.agent_working_dir` instead of `project.default_agent_working_dir`: - `container.rs` (start_workspace) - `container.rs` (start_queued_follow_up) - `sessions/mod.rs` (follow_up) - `task_attempts/pr.rs` (trigger_pr_description_follow_up) 5. **Frontend**: Updated `ProjectSettings.tsx` to use `default_agent_working_dir` 6. **Migrations**: Two migrations added - one to rename the project column and one to add the workspace column * Cleanup script changes for workspace a87cad74-ed7c-402b-b3f3-413a939a13a9 * Done. The migrations have been squashed into a single migration file `20251219000000_add_agent_working_dir_to_projects.sql` which now handles both the project and workspace table changes. The separate workspace migration file has been deleted and `npm run prepare-db` completes successfully. * Done. The i18n check passes with all checks passing: - No new literal strings introduced - No duplicate keys found in JSON files - Translation keys are consistent across locales (en, es, ja, ko, zh-Hans) * All checks pass: - `npm run check` ✅ (frontend TypeScript and backend Rust) - `npm run prepare-db` ✅ (migrations and sqlx query cache) * `npm run lint` passes now. * Done. I've added the logic to `crates/services/src/services/project.rs` in the `add_repository()` function. When a second repository is added to a project (repo count becomes exactly 2), the `default_agent_working_dir` field is automatically cleared by setting it to an empty string. * Cleanup script changes for workspace a87cad74-ed7c-402b-b3f3-413a939a13a9 * Both checks pass. The fix now correctly: 1. Counts repos **before** adding the new one 2. Only clears `default_agent_working_dir` if the previous count was exactly 1 (meaning we're going from 1 to 2 repos) * Done. The fix now: 1. Added a dedicated `Project::clear_default_agent_working_dir()` method in `crates/db/src/models/project.rs` that only updates the `default_agent_working_dir` field without touching other fields 2. Updated `add_repository()` in `crates/services/src/services/project.rs` to use this new method when the repo count goes from 1 to 2 |
||
|
|
d0bb5cdb75 |
chore: bump codex (#1615)
* bump codex * no codex default |
||
|
|
84ea4b71ee | chore: bump version to 0.0.139 | ||
|
|
4b4fdb9a60 |
Gemini 3 Flash (#1590)
* Gemini 3 Flash Upgrade gemini-cli to the latest version and update the flash preset to the latest flash model. * fmt |
||
|
|
fd210419cd | chore: bump version to 0.0.138 | ||
|
|
37af711712 | chore: bump version to 0.0.137 | ||
|
|
22ff27d8fd |
feat: multi repo projects (#1516)
* configure multiple repositories per project * Move repo selection to frontend for create PR (#1436) * Inline ensure worktree path (#1440) * Inline ensure_worktree_path in task_attempts * Inline ensure_worktree_path in images and setups, remove ensure_worktree_path * chore: use `find_repos_for_attempt` where possible (#1442) * use find_repos_for_attempt rather than find_repos_for_project where possible * remove Repo::find_by_attempt_id * change target branch backend (#1454) * feat: multi repo branch rename (#1456) * Rename branches * Update crates/services/src/services/git.rs Co-authored-by: Alex Netsch <alex@bloop.ai> --------- Co-authored-by: Alex Netsch <alex@bloop.ai> * Fix project display name being used as path (#1464) * Multi repo merge (#1470) * cleanup create PR * Merge for multi repo projects * Multi repo support for rebase (vibe-kanban) (#1472) * All tasks completed successfully. Here's a summary of the changes made: ## Summary Added multi-repo support for rebase, following the same pattern as merge (commit 483060e92). ### Files Modified **Backend:** 1. `crates/server/src/routes/task_attempts.rs`: - Added `repo_id: Uuid` field to `RebaseTaskAttemptRequest` struct (line 92) - Updated `rebase_task_attempt` function to: - Fetch specific `AttemptRepo` using `find_by_attempt_and_repo_id()` - Fetch the `Repo` using `Repo::find_by_id()` - Build `worktree_path` as `workspace_path.join(&repo.name)` - Use the specific repo's target branch - Update only that repo's target branch via `AttemptRepo::update_target_branch()` instead of `update_all_target_branches()` - Pass `worktree_path` to `rebase_branch()` instead of `workspace_path` **Frontend:** 2. `frontend/src/hooks/useRebase.ts`: - Added `repoId: string` to `RebaseMutationArgs` type - Pass `repo_id` in the request data 3. `frontend/src/components/tasks/Toolbar/GitOperations.tsx`: - Updated `handleRebaseWithNewBranchAndUpstream` to get `repoId` via `getSelectedRepoId()` and pass it to the rebase action **Auto-generated:** 4. `shared/types.ts` - Regenerated with `repo_id: string` in `RebaseTaskAttemptRequest` * All done. Both review comments have been addressed: 1. **Inlined `current_target_branch`** - Replaced the separate variable with `unwrap_or_else(|| attempt_repo.target_branch.clone())` calls directly 2. **Removed `update_all_target_branches`** - Deleted the unused function from `crates/db/src/models/attempt_repo.rs` since it's no longer needed after the multi-repo changes All checks pass. * Fix worktree name (#1483) * Add multi-repo support for rebase conflict handling (Vibe Kanban) (#1487) * All checks pass. Let me provide a summary of the changes made: I've added multi-repo support for the conflict handling (auto fix rebase) functionality. Here's what was changed: 1. Added `AbortConflictsRequest` struct with `repo_id: Uuid` field 2. Updated `abort_conflicts_task_attempt()` handler to: - Accept `repo_id` in the request body - Look up the specific repo by ID - Build the correct worktree path: `workspace_path.join(&repo.name)` - Pass the repo-specific worktree path to `abort_conflicts()` - Added `AbortConflictsRequest` to the list of exported types 1. **`frontend/src/lib/api.ts`**: - Updated `abortConflicts()` to accept `repoId` parameter and send it in the request body - Fixed `getBranchStatus()` return type from `BranchStatus[]` to `RepoBranchStatus[]` - Added `RepoBranchStatus` import, removed unused `BranchStatus` import 2. **`frontend/src/hooks/useAttemptConflicts.ts`**: - Added `repoId` parameter to the hook - Pass `repoId` to the API call 3. **`frontend/src/lib/conflicts.ts`**: - Added optional `repoName` parameter to `buildResolveConflictsInstructions()` - Added `repoName` parameter to `formatConflictHeader()` - Conflict resolution prompts now include repo context (e.g., "Rebase conflicts while rebasing 'branch' onto 'main' in repository 'my-repo'.") 4. **`frontend/src/components/tasks/follow-up/FollowUpConflictSection.tsx`**: - Updated `branchStatus` prop type from `BranchStatus[]` to `RepoBranchStatus[]` - Extract `repo_id` from first repo status and pass to `useAttemptConflicts()` 5. **`frontend/src/components/tasks/TaskFollowUpSection.tsx`**: - Pass `repo_name` to `buildResolveConflictsInstructions()` for multi-repo context in AI prompts Cleanup script changes for task attempt b833fb22-7a04-4c56-b82d-1afaa1074e78 * The type check passes. Now the `abortConflicts` API uses the generated `AbortConflictsRequest` type, which will catch any type mismatches if the backend type changes. * Done. Both components now find the first repo that actually has conflicts instead of just using the first repo in the array. The type check passes. * Done. Removed both comments as requested. * Multi-repo support for restoring commits (Vibe Kanban) (#1490) * I've successfully implemented multi-repo support for restoring commits. Here's a summary of the changes made: 1. **`crates/server/src/routes/execution_processes.rs`** - Added import for `ExecutionProcessRepoState` - Added new endpoint `get_execution_process_repo_states` that returns the per-repo commit states for an execution process - Added route `/repo-states` to the router 2. **`crates/server/src/bin/generate_types.rs`** - Added `ExecutionProcessRepoState::decl()` to export the type to TypeScript 3. **`frontend/src/lib/api.ts`** - Added import for `ExecutionProcessRepoState` - Added `getRepoStates` method to `executionProcessesApi` 4. **`frontend/src/components/dialogs/tasks/RestoreLogsDialog.tsx`** - Updated the `useEffect` hook to fetch repo states via the new API instead of trying to access `before_head_commit` directly from the execution process - Uses the first repo's `before_head_commit` for display (consistent with how merge handles multi-repo) 5. **`shared/types.ts`** - Auto-generated to include `ExecutionProcessRepoState` type The implementation follows the same pattern used for merge in commit 483060e92, where the first repo is selected for operations that need a single repo (like displaying commit information in the restore dialog). Cleanup script changes for task attempt fefd6bd6-25e3-4775-b6af-c11ad3c06715 Let me provide a summary of the changes made: I've implemented multi-repo support for the restore dialog. Here are the changes: 1. **`frontend/src/lib/api.ts`** - Changed `getBranchStatus` return type from `BranchStatus[]` to `RepoBranchStatus[]` (which includes `repo_id` and `repo_name` fields) - Removed unused `BranchStatus` import 2. **`frontend/src/hooks/useRetryProcess.ts`** - Changed `branchStatus` type in `RetryProcessParams` from `BranchStatus | undefined` to `RepoBranchStatus[] | undefined` - Updated caller to not pass `attemptId` (no longer needed) 3. **`frontend/src/components/NormalizedConversation/RetryEditorInline.tsx`** - Changed `branchStatus: branchStatus?.[0]` to `branchStatus: branchStatus` to pass the full array instead of just the first element 4. **`frontend/src/components/dialogs/tasks/RestoreLogsDialog.tsx`** - Changed `branchStatus` prop type from `BranchStatus | undefined` to `RepoBranchStatus[] | undefined` - Removed `attemptId` from props (no longer used) - Changed state from single `targetSha` to array `repoStates: ExecutionProcessRepoState[]` - Added `repoInfo` useMemo that joins repo states with branch status to get repo names - Added aggregated values: `anyDirty`, `totalUncommitted`, `totalUntracked`, `anyNeedsReset`, `repoCount` - Updated UI to display: - Title shows "(X repos)" when multiple repos - Lists each repo with its name and target commit SHA - Aggregated uncommitted/untracked counts across all repos - For single-repo projects: Works exactly as before, shows one commit SHA - For multi-repo projects: Shows all repos being restored with their respective target commits, e.g.: ``` Reset worktree (2 repos) Your worktrees will be restored to these commits. 🔀 repo-a: abc1234 🔀 repo-b: def5678 ``` - Uncommitted changes warnings aggregate across all repos Revert "Let me provide a summary of the changes made:" This reverts commit 14eea8717b422bdd913c9ef54def44e6297d2efe. * I've completed all the changes. The rebase conflict is resolved and the multi-repo support is implemented. Here's a summary: - Changed `getBranchStatus` return type from `BranchStatus[]` to `RepoBranchStatus[]` - Changed import from `BranchStatus` to `RepoBranchStatus` - Changed `branchStatus` in `RetryProcessParams` from `BranchStatus | undefined` to `RepoBranchStatus[] | undefined` - Removed `attemptId` from the dialog call - Changed `branchStatus: branchStatus?.[0]` to `branchStatus: branchStatus` to pass the full array - Changed `branchStatus` prop from `BranchStatus | undefined` to `RepoBranchStatus[] | undefined` - Removed `attemptId` from props (no longer needed) - Changed state from single `targetSha` to array `repoStates: ExecutionProcessRepoState[]` - Added `repoInfo` useMemo to join repo states with branch status by `repo_id` - Added aggregated values: `anyDirty`, `totalUncommitted`, `totalUntracked`, `repoCount` - Updated UI to show all repos with their target commits when `repoCount > 1` The TypeScript check couldn't run in this worktree due to the pnpm workspace setup, but the implementation follows the same pattern that was working before. The main change is that the dialog now shows all repos being restored instead of just the first one. * The frontend type check passes. All rebase conflicts have been resolved: 1. **`frontend/src/lib/api.ts`** - Resolved: Kept `AbortConflictsRequest` import and typed `abortConflicts` function; removed unused `BranchStatus` import 2. **`frontend/src/hooks/useAttemptConflicts.ts`** - Resolved: Uses `{ repo_id: repoId }` object parameter 3. **`frontend/src/components/tasks/TaskFollowUpSection.tsx`** - Resolved: Removed comment conflict marker, kept HEAD code 4. **`frontend/src/components/tasks/follow-up/FollowUpConflictSection.tsx`** - Resolved: Removed comment conflict marker, kept HEAD code The rebase completed successfully and the frontend type check passes. * All done! Here's a summary of the changes made to add multi-repo support for push and force push: (#1491) 1. **`crates/server/src/routes/task_attempts.rs`**: - Added `PushTaskAttemptRequest` struct with `repo_id: Uuid` field - Updated `push_task_attempt_branch` to accept `Json<PushTaskAttemptRequest>` and use the repo's worktree path - Updated `force_push_task_attempt_branch` to accept `Json<PushTaskAttemptRequest>` and use the repo's worktree path 2. **`crates/server/src/bin/generate_types.rs`**: - Added `PushTaskAttemptRequest::decl()` to export the type to TypeScript 3. **`frontend/src/lib/api.ts`**: - Updated `push()` and `forcePush()` to accept `PushTaskAttemptRequest` with `repo_id` 4. **`frontend/src/hooks/usePush.ts`**: - Added `PushParams` type with `repoId: string` - Updated mutation to accept params and pass `repo_id` to API - Added params to error callback for use in ForcePushDialog 5. **`frontend/src/hooks/useForcePush.ts`**: - Added `ForcePushParams` type with `repoId: string` - Updated mutation to accept params and pass `repo_id` to API 6. **`frontend/src/components/dialogs/git/ForcePushDialog.tsx`**: - Added `repoId` to props - Passes `repoId` to `forcePush.mutateAsync()` 7. **`frontend/src/hooks/useGitOperations.ts`**: - Updated push error handler to pass `repoId` to `ForcePushDialog.show()` 8. **`frontend/src/components/tasks/Toolbar/GitOperations.tsx`**: - Updated `handlePushClick` to get `repoId` and pass it to `git.actions.push()` Cleanup script changes for task attempt 7fea7193-f072-4b7d-8650-e85ef88f0e9f * Add multi-repo support for PR comments (Vibe Kanban) (#1500) * All tasks are complete. Here's a summary of the changes made: **`crates/server/src/routes/task_attempts/pr.rs`:** - Added import for `Query` from axum - Added new type `GetPrCommentsQuery { repo_id: Uuid }` - Modified `get_pr_comments` function to: - Accept `Query(query): Query<GetPrCommentsQuery>` parameter - Use `AttemptRepo::find_by_attempt_and_repo_id()` to look up the specific repo - Use `Repo::find_by_id()` to get the repo path - Use `repo.path` instead of `get_first_repo_path()` **`crates/server/src/bin/generate_types.rs`:** - Added `GetPrCommentsQuery::decl()` to export the type to TypeScript **`frontend/src/lib/api.ts`:** - Updated `getPrComments` to accept `repoId: string` parameter - Added query string `?repo_id=${encodeURIComponent(repoId)}` **`frontend/src/hooks/usePrComments.ts`:** - Added `repoId` parameter to hook and query key - Updated enabled condition to require both `attemptId` and `repoId` **`frontend/src/components/dialogs/tasks/GitHubCommentsDialog.tsx`:** - Added `repoId: string` to `GitHubCommentsDialogProps` - Pass `repoId` to `usePrComments` hook **`frontend/src/components/tasks/TaskFollowUpSection.tsx`:** - Extract `repoId` from `branchStatus?.[0]?.repo_id` - Pass `repoId` to `GitHubCommentsDialog.show()` - Added `branchStatus` to useCallback dependencies Cleanup script changes for task attempt 1fc865dd-4297-4eb6-9265-09f102b92252 * Extend merges to handel repo ID (vibe-kanban 3dd2880f) Incrates/db/src/models/merge.rs make sure mergerow and related structs have a repo\_id field to support multi repo projects. This is needed to support e.g. fetching PR comments correctly, see last few commits * The backend compiles successfully. The fix is complete. ## Summary Fixed the review comment by changing `get_pr_comments` to use `Merge::find_by_task_attempt_and_repo_id()` instead of `Merge::find_latest_by_task_attempt_id()`. This ensures the PR comments are fetched for the specific repo, not just the latest merge across all repos. * All done. Here's a summary of the changes: 1. **`crates/server/src/routes/task_attempts.rs`** - Updated `rename_branch` to check ALL repos for open PRs using `find_by_task_attempt_id` instead of just the latest merge 2. **`crates/db/src/models/merge.rs`** - Removed the `find_latest_by_task_attempt_id` function entirely * All done. The frontend now uses `useAttemptRepo` hook with `repos[0]?.id` for repo selection, matching the pattern used by merge, rebase, push, and other git operations in `GitOperations.tsx`. * Done. The changes: 1. Removed `firstRepoStatus = branchStatus?.[0]` (line 82) 2. Updated the merged PR check to iterate over ALL repos using `branchStatus?.some()` 3. Updated the useMemo dependency from `firstRepoStatus?.merges` to `branchStatus` * Done. Added the `getSelectedRepoId` helper function to `TaskFollowUpSection.tsx`, matching the pattern used in `GitOperations.tsx`. This makes it easier to add repo selection in the future - when that feature is added, only the helper function needs to be updated. * Done. The lint errors are fixed. Both the frontend and backend linting pass now. The `getSelectedRepoId` helper function is now wrapped in `useCallback` with `[repos]` as its dependency, matching the pattern used in `GitOperations.tsx`. * feat: override `ProjectRepos` (#1475) * override repos at a task_attempt level * simplify mcp * refer to repoIds on frontend; separate api call to register a repo obj * consolidate ProjectFormDialog * Move repo path migration to rust backend (#1507) * Add repo selection to git toolbar and fix project create loop (Vibe Kanban) (#1505) * Conflicts are resolved in both files. I’m going to `git add` them and continue the rebase using a non‑interactive editor (`GIT_EDITOR=true`) so it won’t hang. * **Rebase Complete** - Resolved conflicts in `frontend/src/hooks/useAttemptRepo.ts` by keeping the new repo‑selection API (`repos`, `selectedRepoId`, `setSelectedRepoId`) and typing the query as `RepoWithTargetBranch[]`. - Resolved conflicts in `frontend/src/lib/api.ts` by keeping both `RepoWithTargetBranch` and `RepositoryBranches` imports (no conflict markers left). - Continued the rebase non‑interactively with `GIT_EDITOR=true`; rebase finished successfully. - Ran `pnpm -C frontend run check`; fixed a post‑rebase TS error by re‑adding the missing `GitBranch` import used by `repoApi.getBranches` in `frontend/src/lib/api.ts`. - Typecheck now passes and `git status` is clean. If you want, I can run `pnpm -C frontend run lint` or a workspace test sweep next. * Done. I made three small UI tweaks to improve readability. **What Changed** - Removed the dropdown caret/arrow in the repo selector button: - `frontend/src/components/tasks/RepoSelector.tsx` - Dropped the `ArrowDown` icon and its import so the selector is just folder icon + repo name. - Removed the arrow separator that came right after the repo chip in the toolbar: - `frontend/src/components/tasks/Toolbar/GitOperations.tsx` - Deleted the first `ArrowRight` that was between the repo chip and task-branch chip. - Replaced the gear icon with a clearer “switch” icon, and added spacing before branches: - `frontend/src/components/tasks/Toolbar/GitOperations.tsx` - Swapped `Settings` → `ArrowLeftRight` for both repo-change and target-branch-change buttons. - Added `ml-2` to the task branch chip so there’s visible separation from the repo selector area. **Checks** - `pnpm -C frontend run check` passes. If you want a different icon (e.g., `ChevronsUpDown`, `Pencil`, `Repeat`), tell me which lucide icon you prefer and I’ll swap it. * Cleanup script changes for task attempt 24ce3817-354c-48f7-a66c-3fb9e6fd019a * That behavior lines up with a create‑loop in the project creation dialog. I found a likely culprit and patched it. **Root Cause** - `frontend/src/components/dialogs/projects/ProjectFormDialog.tsx` auto‑runs `handlePickRepo()` in a `useEffect` whenever `modal.visible` is true. - After the multi‑repo changes, the `createProject` mutation object was causing `handlePickRepo` to be re‑created on rerenders while the modal stayed visible. - Effect dependency `[modal.visible, handlePickRepo]` then retriggered repeatedly, spamming `createProject.mutate(...)` and creating tons of projects. **Fix** - Added a `hasStartedCreateRef` guard so we only call `handlePickRepo()` once per dialog open. - Reset the guard when the modal closes. - Narrowed the `handlePickRepo` deps to `createProject.mutate` (stable) instead of the whole mutation object. Patch is in `frontend/src/components/dialogs/projects/ProjectFormDialog.tsx`. **Status** - `pnpm -C frontend run check` passes. **What you should do now** - Try creating a project again; you should see exactly one POST. - If you want to clean up the 1500 accidental projects, tell me whether they’re local or remote and I can help script a safe bulk delete (with a dry‑run list first). * Adjusted to match what you described. **UI Tweaks** - Kept the right‑side icon (target branch change) as the original gear: - In `frontend/src/components/tasks/Toolbar/GitOperations.tsx`, the target‑branch change button now uses `Settings` again. - Changed only the icon after the project/repo chip to something more “selectable”: - Swapped that button to `ChevronsUpDown`, which reads more like a picker/change control. - Increased spacing between the project/repo area and the task/branch chips: - Bumped the task branch chip margin from `ml-2` → `ml-3`. **Checks** - `pnpm -C frontend run check` passes. If the spacing still feels tight on your screen size, tell me roughly how much more (e.g., “double it” / “a bit more”) and I’ll nudge to `ml-4` or add a `mr-*` on the repo group. * Cleanup script changes for task attempt 24ce3817-354c-48f7-a66c-3fb9e6fd019a * Ran lint and fixed the warning. **Lint Fix** - `pnpm -C frontend run lint` failed with a `react-hooks/exhaustive-deps` warning in `frontend/src/components/dialogs/projects/ProjectFormDialog.tsx:58`. - Cause: the `useCallback` referenced `createProject.mutate` but ESLint wanted the full `createProject` object as a dep. - Fix: pulled out a stable `createProjectMutate` variable and used that inside the callback/deps. Patch is in `frontend/src/components/dialogs/projects/ProjectFormDialog.tsx`. **Status** - `pnpm -C frontend run lint` now passes with zero warnings. * Done — task/branch group is now right‑aligned in horizontal layout. **Change** - In `frontend/src/components/tasks/Toolbar/GitOperations.tsx`, I split the left row into: - Left: repo chip + change button. - Right (horizontal only): task branch chip → arrow → target branch chip + gear. - Implemented by wrapping the branch chips in a container that uses `ml-auto` when `layout !== 'vertical'`. Vertical layout keeps the old left‑flow behavior. **Result** - Maximizes spacing between project/repo and task/branch selectors without changing their contents. - Icons remain: repo change uses `ChevronsUpDown`, target branch change keeps `Settings`. **Checks** - `pnpm -C frontend run check` passes. - `pnpm -C frontend run lint` passes. If you want the right group to wrap sooner/never wrap, I can tune the flex/whitespace classes. * Cleanup script changes for task attempt 24ce3817-354c-48f7-a66c-3fb9e6fd019a * Fixed — right‑alignment should now actually take effect. **What I changed** - In `frontend/src/components/tasks/Toolbar/GitOperations.tsx`, updated the horizontal grid template to give the left column flexible width: - `grid-cols-[auto_minmax(0,1fr)_auto]` - → `grid-cols-[minmax(0,1fr)_auto_auto]` - With that, the left “branch flow” container stretches, so the inner branch group’s `ml-auto` can push it to the right. **Checks** - `pnpm -C frontend run check` passes. - `pnpm -C frontend run lint` passes. Take another look in the UI; you should see the repo chip left and the branch chips snapped to the right with maximum space between. If still tight on narrow widths, I can add a wrap breakpoint so branches drop to a second line sooner. * Got it. I’ll make the branch group right‑align only in horizontal layout *and* when `repos.length > 1`. For a single repo, it’ll stay left‑flow with a small left margin. I’ll patch `frontend/src/components/tasks/Toolbar/GitOperations.tsx` accordingly and re-run check/lint. * Done. **Behavior now** - Horizontal layout: - If `repos.length > 1`: branch group uses `ml-auto` → right‑aligned. - If `repos.length <= 1`: branch group uses `ml-3` → stays left‑flow with a bit of spacing. - Vertical layout unchanged. Change is in `frontend/src/components/tasks/Toolbar/GitOperations.tsx`. **Checks** - `pnpm -C frontend run check` passes. - `pnpm -C frontend run lint` passes. * The `gh pr edit` call succeeded, but my body quoting was unsafe in bash (backticks triggered command substitution). I’m going to re‑apply the title/body using a `--body-file` heredoc so it’s exact. Proposed final content: **Title** Add repo selection to git toolbar and fix project create loop (Vibe Kanban) **Description** This PR completes the frontend side of multi‑repo support by letting users choose which repository an attempt operates on, and by ensuring branch/status UI uses that selection. It also fixes a regression where the create‑project dialog could fire repeatedly. - Added repo selection UX for git operations: - New `RepoSelectionContext` to share the selected repo across git‑related components. - New `RepoSelector` dropdown and `ChangeRepoDialog` modal for choosing a repo when an attempt has multiple repositories. - Updated `GitOperations`, `GitActionsDialog`, `TaskFollowUpSection`, and `ProjectTasks` to read/write the selected repo via the context and `useAttemptRepo`. - Disabled/enabled git buttons based on the selected repo’s branch status instead of aggregated status. - Made project branches multi‑repo aware: - `projectsApi.getBranches` now returns `RepositoryBranches[]` (per‑repo branches) instead of flattening into a single list. - `useProjectBranches` and `ProjectTasks` now select the branch list for the currently selected repo. - UI polish for clarity: - Simplified the repo picker chip, removed extra caret, and replaced the repo‑change icon with a clearer selector icon. - Tuned spacing and conditional right‑alignment of branch chips only when multiple repos exist. - Fixed create‑project spam regression: - Guarded the auto‑launching repo picker in `ProjectFormDialog` so it runs once per modal open, preventing repeated `createProject` mutations. - Adjusted hook deps to satisfy `eslint-plugin-react-hooks`. Multi‑repo attempts require users to choose which repo to rebase/merge/push against, and the UI must reflect branch/status information for that specific repo. Without a shared selection, components defaulted to the first repo or mixed aggregated data, causing incorrect button states and confusing branch display. The project‑creation guard addresses a rerender‑triggered loop introduced during this work. - Selection defaults to the first repo, but persists across git dialogs through the context. - The toolbar only shows repo selection controls when `repos.length > 1`. - Branch/status lookups use `repo_id` matching to keep all operations scoped correctly. This PR was written using [Vibe Kanban](https://vibekanban.com). I’ll update the PR now with a safe heredoc. * I switched the repo/project picker in the Git toolbar to an inline dropdown (no modal). **What I changed** - `frontend/src/components/tasks/Toolbar/GitOperations.tsx` - Removed the `ChangeRepoDialog` flow and its handler. - Rendered `RepoSelector` directly in the toolbar, so clicking the repo chip opens a dropdown. - Kept it visible for any attempt with repos, but the dropdown only matters when multiple repos exist; branch chips still right‑align only when `repos.length > 1`. - Disabled the selector while an attempt is running to match the old “can’t change mid‑run” behavior. - `frontend/src/components/tasks/RepoSelector.tsx` - Added optional `disabled` prop and wired it to the trigger button. - Cleaned up unused dialog: - Removed export in `frontend/src/components/dialogs/index.ts`. - Deleted `frontend/src/components/dialogs/tasks/ChangeRepoDialog.tsx`. **Checks** - `pnpm -C frontend run check` passes. - `pnpm -C frontend run lint` passes. **Note** You currently have uncommitted changes from this tweak (`git status` shows 4 modified/deleted files). I didn’t commit because you haven’t asked me to; once you’re happy, you can `git add`/`git commit`/`git push` and the PR will update. If you want me to also refactor `useAttemptRepo` into a shared selection (so picking a repo in the toolbar updates other panels), say so and I’ll tackle that next. * Done — both tweaks are in. **Repo selector icon** - `frontend/src/components/tasks/RepoSelector.tsx` - Added the `ChevronsUpDown` indicator back. - It only renders when `repos.length > 1`, so single‑repo attempts just show the repo chip without a dropdown cue. **Centered branch + status layout** - `frontend/src/components/tasks/Toolbar/GitOperations.tsx` - Reworked the horizontal layout to match your sketch: - Left: repo selector. - Center (flex‑1, `justify-center`): `[task branch] → [target branch]` followed immediately by git status chips. - Right: git action buttons. - Vertical layout is unchanged. - Extracted `branchChips` and `statusChips` into reusable nodes so the markup stays consistent. **Checks** - `pnpm -C frontend run check` passes. - `pnpm -C frontend run lint` passes. Give it a quick look in the UI; spacing/centering should now line up with `[repo] [task branch] [target branch] [git status] [git actions]`. * Cleanup script changes for task attempt 24ce3817-354c-48f7-a66c-3fb9e6fd019a * Fix branch selector repo state (vibe-kanban 0f20535c) When selecting a repo, the branch selector needs to update accordingly and only show branches available on the selected repo. Check the latest commits for relevant files and changes. * Fix branch selector repo state (vibe-kanban 0f20535c) When selecting a repo, the branch selector needs to update accordingly and only show branches available on the selected repo. Check the latest commits for relevant files and changes. * multi repo target selector (#1513) * feat: per repo git state (#1514) * multi repo target selector * per-repo pr state * query per iter * Move per-repo scripts from Project to ProjectRepo (Vibe Kanban) (#1515) * The implementation is complete. Here's a summary of all the changes made to move script fields from `Project` to `ProjectRepo`: - Created `crates/db/migrations/20251212111429_move_scripts_to_project_repos.sql` - Migrates script columns from `projects` to `project_repos` table and removes them from `projects` - **`crates/db/src/models/project_repo.rs`** - Added script fields (`setup_script`, `dev_script`, `cleanup_script`, `copy_files`, `parallel_setup_script`), `UpdateProjectRepo` struct, and `update()` method - **`crates/db/src/models/project.rs`** - Removed all script fields from `Project`, `CreateProject`, and `UpdateProject` - **`crates/services/src/services/container.rs`** - Updated `start_attempt()` to get scripts from project_repos and run them in parallel - **`crates/local-deployment/src/container.rs`** - Updated copy_files execution to be per-repo - **`crates/server/src/routes/projects.rs`** - Added `GET/PUT/DELETE` handlers for `/projects/{id}/repositories/{repo_id}` - **`crates/server/src/routes/task_attempts.rs`** - Updated setup/cleanup/dev script handlers to use per-repo scripts - **`crates/server/src/bin/generate_types.rs`** - Added `ProjectRepo` and `UpdateProjectRepo` type exports - **`frontend/src/lib/api.ts`** - Added `getRepository()` and `updateRepository()` methods - **`frontend/src/pages/settings/ProjectSettings.tsx`** - Completely updated to: - Separate project name editing from scripts editing - Add repo dropdown in Scripts card - Save scripts per-repository with dedicated save button - **`frontend/src/components/tasks/TaskDetails/preview/NoServerContent.tsx`** - Updated to save dev scripts to first repository - **`frontend/src/components/NormalizedConversation/NextActionCard.tsx`** - Updated to always show dev server button - **`frontend/src/components/panels/PreviewPanel.tsx`** - Updated to always show dev server button - **`frontend/src/components/tasks/TaskFollowUpSection.tsx`** - Updated to always allow running scripts - **`frontend/src/components/dialogs/projects/ProjectFormDialog.tsx`** - Removed script fields from create project * Cleanup script changes for task attempt ab6892e9-754c-4033-99e0-1bf13ea64df7 * Done! The fix is complete. The `cleanup_actions_for_repos` method now chains each cleanup script as a separate `ExecutorAction` using the `append_action()` method instead of combining them into one bash script with `join("\n\n")`. This ensures each script runs as its own distinct action in the execution chain. * Cleanup script changes for task attempt ab6892e9-754c-4033-99e0-1bf13ea64df7 * Done! The migrations have been squashed: 1. Deleted `20251212111429_move_scripts_to_project_repos.sql` 2. Modified `20251209000000_add_project_repositories.sql` to: - Add script columns (`setup_script`, `dev_script`, `cleanup_script`, `copy_files`, `parallel_setup_script`) to `project_repos` table creation - Copy scripts from `projects` to `project_repos` during the migration INSERT - Remove script columns from `projects_new` table creation 3. Regenerated SQLx cache 4. Verified compilation passes * Done! The `dev_script` has been successfully moved from `ProjectRepo` back to `Project`. All compilation passes. Here's a summary of the changes: **Migration** (`20251209000000_add_project_repositories.sql`): - `dev_script` stays on `projects` table (not moved to `project_repos`) **Backend changes:** - `Project` struct: Added `dev_script: Option<String>` field - `UpdateProject`: Made fields optional with `#[ts(optional)]` for TypeScript - `ProjectRepo`/`ProjectRepoWithName`/`UpdateProjectRepo`: Removed `dev_script` field - `start_dev_server`: Now uses `project.dev_script` instead of `first_project_repo.dev_script` **Frontend changes:** - `ProjectSettings.tsx`: Dev script is now in the project-level form, not per-repo scripts - `NoServerContent.tsx`: Saves dev script to project via `projectsApi.update()` * Done! Both review comments have been addressed: 1. **Migration file** - Removed the note comment `-- Note: dev_script stays on projects table (project-level, not per-repo)` 2. **container.rs** - Removed the confusing/incorrect comment. The old comment said "For simplicity, we still run these in parallel but they complete before next_action" which was misleading. Changed the comment to simply say "Sequential setup script - starts before coding agent" which accurately describes what happens (it starts before the coding agent is started, but doesn't block it). * Done! The fix is complete. Now sequential setup scripts properly use `next_action` chaining: **How it works now:** 1. **Parallel setup scripts** (`parallel_setup_script = true`): Started immediately with `next_action: None`, run independently alongside the coding agent 2. **Sequential setup scripts** (`parallel_setup_script = false`): Collected and chained via `next_action`: - Chain: `setup1 → setup2 → ... → coding_agent → cleanup` - Only one `start_execution` call with the first setup as root - Each step triggers the next via `try_start_next_action()` when it completes * Done! The refactoring is complete. Here's a summary of the changes: **Changes made:** 1. **`cleanup_actions_for_repos`** - Updated signature to take `&[ProjectRepoWithName]` instead of `&[(String, String)]`. Filters repos with cleanup scripts internally. 2. **`setup_action_for_repo`** - New helper method that builds a setup script action for a single repo (used for parallel execution). 3. **`build_sequential_setup_chain`** - New helper method that chains sequential setup scripts → coding agent via `next_action`. 4. **`start_attempt`** - Refactored to use the new helpers: - If ALL repos have `parallel_setup_script = true`: Start each setup independently, then start coding agent - If ANY repo has `parallel_setup_script = false`: Chain ALL setups → coding agent via `next_action` 5. **Updated call sites** in `local-deployment/container.rs` and `server/task_attempts.rs` to pass `&project_repos` directly instead of extracting tuples. * Done! The refactoring is complete. Here's a summary of the changes: **Changes made:** 1. **`cleanup_actions_for_repos`** - Changed return type from `Option<Box<ExecutorAction>>` to `Option<ExecutorAction>`. Callers now box when needed. 2. **`setup_actions_for_repos`** - New helper method that mirrors `cleanup_actions_for_repos` but for setup scripts with `ScriptContext::SetupScript`. 3. **Updated all call sites** to use `.map(Box::new)` when the action is used as `next_action`: - `start_attempt` in `container.rs` - `run_with_message` in `local-deployment/container.rs` - `run_with_message` in `task_attempts.rs` 4. **Refactored handlers** to use the new helpers instead of manually building action chains: - `run_setup_script` handler - now uses `setup_actions_for_repos` - `run_cleanup_script` handler - now uses `cleanup_actions_for_repos` This removes all the loosely-typed `Vec<(String, String)>` tuples and `(first_repo, first_script)` patterns in favor of using `ProjectRepoWithName` directly. * Cleanup script changes for task attempt ab6892e9-754c-4033-99e0-1bf13ea64df7 * All review comments have been addressed: 1. **NextActionCard.tsx** - Reverted `projectHasDevScript` to `Boolean(project?.dev_script)` 2. **PreviewPanel.tsx** - Reverted `projectHasDevScript` to `Boolean(project?.dev_script)` 3. **NoServerContent.tsx** - Removed the comment about dev_script being saved at project level 4. **TaskFollowUpSection.tsx** - Removed the comments and inlined `hasSetupScript`/`hasCleanupScript` to just `true`, simplified the dropdown menu items by removing the disabled states and tooltips * All 27 review comments have been addressed: **Summary of changes:** 1. **Removed `#[ts(export)]` and `#[ts(optional)]` annotations** from `UpdateProject` struct in `project.rs` 2. **Removed `#[ts(export)]`** from `ProjectRepo` struct in `project_repo.rs` 3. **Removed unnecessary comments** from: - `project.rs` - "First get the existing project to use as defaults" - `project_repo.rs` - doc comment about finding project repos, "First check if the project_repo exists", "Use existing values as defaults" - `local-deployment/container.rs` - 3 comments about getting project repos - `task_attempts.rs` - 4 comments about getting project repos, dev server, setup/cleanup scripts - `services/container.rs` - All doc comments on helper methods, intermediate comments 4. **Refactored `NoServerContent.tsx`** to use `useProjectMutations` hook instead of direct `queryClient` usage: - Replaced `useQueryClient()` with `useProjectMutations()` - Updated `handleSaveDevScript` to use `updateProject.mutate()` - Replaced `isSaving` state with `updateProject.isPending` 5. **Fixed TypeScript type compatibility** after removing `#[ts(optional)]`: - `NoServerContent.tsx` - Pass `name: null` when only updating `dev_script` - `ProjectSettings.tsx` - Use `|| null` instead of `|| undefined` * Done! The fix is complete. Now when you clear the `copy_files` field (or `setup_script` or `cleanup_script`) and save, it will properly clear to `null` instead of preserving the existing value. * Done! The implementation is complete: 1. **Added `find_by_repo_id` method** to `crates/db/src/models/project_repo.rs` - a reusable method to find all project_repos by repo_id 2. **Updated `backfill_repo_names`** in `crates/services/src/services/container.rs` to also prepend `cd ./repo_name &&` to dev_script for single-repo projects when backfilling repo names The backfill: - Uses the existing `__NEEDS_BACKFILL__` sentinel to trigger - Only updates single-repo projects (checks `all_repos.len() == 1`) - Transforms `dev_script` from `"npm run dev"` to `"cd ./repo_name && npm run dev"` - Works cross-platform (both bash and cmd.exe support `&&`) - Uses existing `Project::update` method rather than raw SQL * Cleanup script changes for task attempt ab6892e9-754c-4033-99e0-1bf13ea64df7 * Compiles cleanly. Fixed - now empty scripts are ignored and won't result in just `cd ./repo_name && ` being set. * Compiles cleanly. Fixed - now using proper let chains for a cleaner flow. * All 3 review comments have been addressed: 1. **Deleted `crates/db/bindings/` directory** - removed the generated ts-rs files that shouldn't be committed 2. **Used `#[sqlx(flatten)]` for `ProjectRepoWithName`** - refactored the struct to use flatten, which required: - Updating the struct definition - Updating all field accesses to use `project_repo.field` instead of `field` directly - Changing the query from `query_as!` macro to `query_as::<_, T>()` to work with flatten 3. **Added proper import for `ProjectRepoError`** - imported at the top of `error.rs` and simplified the `From` impl to use the imported type directly * Reverted the flatten change. The `ProjectRepoWithName` struct is back to having all fields directly, and the query uses the type-checked `query_as!` macro. * Cleanup script changes for task attempt ab6892e9-754c-4033-99e0-1bf13ea64df7 * Hide Open in IDE button for multi-repo projects (Vibe Kanban) (#1517) * All checks pass. Let me summarize the changes: ## Summary I've fixed the "Open project in IDE" button to: - **Show and work for single-repo projects** - **Hide for multi-repo projects** ### Changes made: 1. **`frontend/src/components/layout/Navbar.tsx`**: - Added `useQuery` import and `projectsApi` import - Added a query to fetch repositories when `projectId` is set - Added `isSingleRepoProject` check (`repos?.length === 1`) - Wrapped `OpenInIdeButton` in conditional rendering: only shows when `isSingleRepoProject` is true 2. **`frontend/src/components/projects/ProjectCard.tsx`**: - Added `useQuery` import - Added a query to fetch repositories for each project card - Added `isSingleRepoProject` check - Wrapped the "Open in IDE" dropdown menu item in conditional rendering: only shows when `isSingleRepoProject` is true * The changes are complete. Here's a summary: ## Summary Updated both files to use the existing `useBranches` hook instead of inline `useQuery` calls: ### `frontend/src/components/layout/Navbar.tsx` - Replaced `useQuery` import with `useBranches` hook import - Removed `projectsApi` import (no longer needed) - Replaced inline query with `useBranches(projectId)` - Button still only shows when `isSingleRepoProject` is true ### `frontend/src/components/projects/ProjectCard.tsx` - Removed `useQuery` import - Added `useBranches` hook import - Replaced inline query with `useBranches(project.id)` - Dropdown item still only shows when `isSingleRepoProject` is true * Done! I've successfully removed the unused `compare_commit_to_head` endpoint. Here's a summary of the changes: (#1520) ## Changes Made 1. **`crates/server/src/routes/task_attempts.rs`** - Removed `CommitCompareResult` struct - Removed `compare_commit_to_head` handler function - Removed route registration for `/commit-compare` 2. **`crates/server/src/bin/generate_types.rs`** - Removed `CommitCompareResult::decl()` from type exports 3. **`frontend/src/lib/api.ts`** - Removed `CommitCompareResult` import - Removed the entire `commitsApi` object 4. **`shared/types.ts`** (auto-generated) - `CommitCompareResult` type was automatically removed after running `pnpm run generate-types` All verification checks pass (`pnpm run check` including both frontend TypeScript and Rust cargo check). * Fix WebSocket events lost when creating execution processes (Vibe Kanban) (#1518) * The fix is complete. Here's a summary: **File**: `crates/db/src/models/execution_process.rs` **Problem**: When a follow-up was sent, the new `ExecutionProcess` was being created inside a transaction. The SQLite update hook would fire immediately after the INSERT (but before the transaction committed), spawning an async task that queried `find_by_rowid` on a **different database connection**. Since the transaction hadn't committed yet, this query couldn't see the row, causing it to return `None` and the WebSocket event to be lost. **Solution**: Split the operation so that the `execution_process` INSERT is committed immediately (without a transaction wrapper), making it visible to the update hook's async task. The `execution_process_repo_states` are then inserted in a separate transaction afterward. **Key changes**: 1. Removed the outer transaction that wrapped both inserts 2. Insert `execution_process` directly using `pool.execute()` - this auto-commits 3. Insert `execution_process_repo_states` in a separate transaction (only if there are any) 4. Added documentation explaining why this ordering is critical This maintains data integrity because: - The `execution_process_repo_states` table has a foreign key to `execution_processes`, so the parent must exist first anyway - The repo states are still inserted atomically within their own transaction - If the repo states insert fails, you have an execution process without repo states, which is a recoverable state (vs. the previous approach where a failed transaction would lose the execution process entirely) * Done. Here's the summary of the fix: **Changed files:** 1. `crates/db/src/models/execution_process.rs` - Removed transaction, added doc comment explaining why 2. `crates/db/src/models/execution_process_repo_state.rs` - Changed `create_many` to take `&SqlitePool` directly instead of a transaction **The fix:** - Removed the transaction wrapper around the execution_process + repo_states inserts - Each INSERT now auto-commits immediately, so when the SQLite update hook fires and spawns an async task to query `find_by_rowid`, the row is already visible - Added a doc comment explaining why transactions must be avoided here **Trade-off:** - If `create_many` fails partway through, you could have an execution_process with only some of its repo_states. This is a recoverable state (orphaned repo_states would just be ignored), vs. the previous bug where WebSocket events were silently lost. * remove junk files (#1528) * format, lint * Version back to 10.13.0 * Fix i18n check script failures (Vibe Kanban) (#1530) * The i18n check script now passes. Here's a summary of what I fixed: **1. Added missing translation keys to tasks.json** (es, ja, ko, zh-Hans): - `repos.changeRepo.dialog.*` - Dialog for changing repository - `repos.selector.*` - Repository selector translations - `repoBranchSelector.label` - Base branch label - `attemptRepoSelector.*` - Attempt repository selector translations **2. Internationalized FolderPickerDialog.tsx**: - Added `useTranslation` hook from react-i18next - Replaced 8 hardcoded strings with translation calls: - Legend text - "Enter path manually:" label - "Go" button - "Search current directory:" label - "Select Current" button - "git repo" badge - "Cancel" button - "Select Path" button **3. Added folderPicker translations** to common.json for all locales (en, es, ja, ko, zh-Hans) All three checks now pass: - ✅ No new literal strings introduced (134 violations in both base and PR) - ✅ No duplicate keys found in JSON files - ✅ Translation keys are consistent across locales * Cleanup script changes for task attempt f9e7896e-d9a5-4030-a968-f1d976fbf83e * Add analytics events for multi-repo projects (Vibe Kanban) (#1532) * The code compiles successfully. Let me provide a summary of the changes made: ## Summary I've implemented analytics tracking for multi-repo projects with the following changes: ### 1. Enhanced `task_attempt_started` event **File:** `crates/server/src/routes/task_attempts.rs:185-196` - Added `repository_count` property to track how many repos are involved when starting a task attempt ### 2. Added `project_repository_added` event **File:** `crates/server/src/routes/projects.rs:443-465` - New event fired when a repository is added to an existing project - Properties: `project_id`, `repository_id`, `repository_count`, `is_multi_repo` ### 3. Added `project_repository_removed` event **File:** `crates/server/src/routes/projects.rs:495-507` - New event fired when a repository is removed from a project - Properties: `project_id`, `repository_id` All changes follow the existing analytics patterns and use `track_if_analytics_allowed` to respect user consent settings. * Done. I've removed the `repo_count` and `is_multi_repo` properties from the `project_repository_added` event, and removed the comment from `delete_project_repository`. * Add comprehensive logging for multi-repo add/remove operations (Vibe Kanban) (#1531) * Done! I've added better logging for multi-repo actions. Here's a summary of the changes: **`crates/services/src/services/project.rs`:** - `add_repository()`: Added `debug!` at start and `info!` on success with project_id, repo_id, and path - `delete_repository()`: Added `debug!` at start and `info!` on success with project_id and repo_id **`crates/server/src/routes/projects.rs`:** - `add_project_repository()`: Added `debug!` at start, plus `warn!` for each error case (path not found, not a directory, not a git repo, duplicate name, duplicate path) - `delete_project_repository()`: Added `debug!` at start and `warn!` when repo not found * Cleanup script changes for task attempt dccec713-4282-499e-af6d-670db5d54aba * Let me provide a summary of the changes made: (#1529) I've added proper multi-repo support to the MCP task server (`crates/server/src/mcp/task_server.rs`). Here are the changes: 1. **Added `RepoSummary` struct** (lines 43-61) - A new type to expose repository information in MCP responses: - `id`: Repository UUID - `name`: Repository name (directory name) - `display_name`: Human-readable display name 2. **Updated `ProjectSummary`** (lines 63-87) - Now includes a `repositories` field: - Changed `from_project()` to `from_project_with_repos()` to accept repos - Projects now expose their associated repositories 3. **Added `McpRepoContext` struct** (lines 255-265) - Per-repository context info: - `repo_id`: Repository UUID - `repo_name`: Repository name - `repo_display_name`: Repository display name - `target_branch`: Target branch for this repo in this attempt 4. **Updated `McpContext`** (lines 267-279) - Added multi-repo support: - Added `attempt_repos: Vec<McpRepoContext>` field for per-repo target branches - Kept `attempt_target_branch` for backward compatibility (first repo's branch) 5. **Updated `fetch_context_at_startup`** (lines 306-391) - Now fetches repo details: - Makes additional API call to `/api/task-attempts/{id}/repos` - Populates `attempt_repos` with full repo info (name, display_name, target_branch) 6. **Updated `list_projects`** (lines 559-587) - Now fetches repositories for each project: - For each project, calls `/api/projects/{id}/repositories` - Includes repos in the `ProjectSummary` response 7. **Added `Deserialize` to `RepoWithTargetBranch`** (line 29) - Required for JSON deserialization in the MCP server - All changes are additive (new fields in responses) - `attempt_target_branch` is still populated with the first repo's branch - Existing MCP clients will continue to work rm bindings Cleanup script changes for task attempt 4f0c19cd-4d9c-42d6-a1fd-7d52063ff5d1 All done! Here's a summary of the final implementation based on your review feedback: 1. **Added `RepoSummary` struct** - Exposes repo `id`, `name`, `display_name` for MCP clients 2. **Updated `ProjectSummary`** - Added `repositories: Vec<RepoSummary>` field so `list_projects` returns repos 3. **Updated `McpContext`** - Replaced single `attempt_target_branch` with `attempt_target_branches: HashMap<Uuid, String>` mapping repo IDs to their target branches 4. **Simplified `fetch_context_at_startup`** - Builds the HashMap directly from `ctx.attempt_repos` (no additional API call needed) 5. **Updated `list_projects`** - Fetches repositories for each project 6. **Added `Deserialize` to `RepoWithTargetBranch`** - For consistency (though no longer used after simplification) Cleanup script changes for task attempt 4f0c19cd-4d9c-42d6-a1fd-7d52063ff5d1 Done! The implementation is now focused on just the multi-repo context support: 1. **Updated `McpContext`** - Replaced `attempt_target_branch: String` with `attempt_target_branches: HashMap<Uuid, String>` mapping repo IDs to their target branches 2. **Simplified `fetch_context_at_startup`** - Builds the HashMap directly from `ctx.attempt_repos` 3. **Reverted `list_projects`** - Back to original simple implementation (no repo fetching) 4. **Reverted `ProjectSummary`** - Removed `repositories` field 5. **Removed `RepoSummary`** - No longer needed 6. **Added `Deserialize` to `RepoWithTargetBranch`** - For consistency Done! The implementation now includes proper repo info alongside target branches. Here's what `McpContext.attempt_repos` will look like: ```json { "attempt_repos": [ { "repo_id": "uuid-1", "repo_name": "frontend", "target_branch": "main" }, { "repo_id": "uuid-2", "repo_name": "backend", "target_branch": "develop" } ] } ``` Done! The implementation now includes proper repo info alongside target branches. Here's what `McpContext.attempt_repos` will look like: ```json { "attempt_repos": [ { "repo_id": "uuid-1", "repo_name": "frontend", "target_branch": "main" }, { "repo_id": "uuid-2", "repo_name": "backend", "target_branch": "develop" } ] } ``` **Changes made:** 1. `crates/db/src/models/task_attempt.rs` - Changed `TaskAttemptContext.attempt_repos` from `Vec<AttemptRepo>` to `Vec<RepoWithTargetBranch>` and updated `load_context` to use `find_repos_with_target_branch_for_attempt` 2. `crates/server/src/mcp/task_server.rs` - Simplified `fetch_context_at_startup` to map directly from `ctx.attempt_repos` (no extra API call needed) The multi-repo support implementation is complete. Here's a summary of what was done: **Changes to `McpContext` (get_context tool):** - Added `McpRepoContext` struct with `repo_id`, `repo_name`, and `target_branch` - `McpContext.attempt_repos` is now `Vec<McpRepoContext>` providing full repo info for each repo in the attempt **Changes to `start_task_attempt` tool:** - Added `McpAttemptRepoInput` struct with `repo_id` and `base_branch` - Changed `StartTaskAttemptRequest` from single `base_branch: String` to `repos: Vec<McpAttemptRepoInput>` - Callers now specify the base branch per-repo **Changes to db layer:** - `TaskAttemptContext.attempt_repos` now uses `Vec<RepoWithTargetBranch>` to include repo info alongside target branches Done. Added the new `list_repos` MCP tool: - **New structs**: `McpRepoSummary`, `ListReposRequest`, `ListReposResponse` - **New tool**: `list_repos(project_id)` - returns repos for a given project - Uses the existing `/api/projects/{id}/repositories` endpoint The tool follows the same pattern as `list_tasks` - takes a `project_id` and returns a list with count. Done. Added `list_repos` to the server instructions. * Allow follow-ups after PR merge (Vibe Kanban) (#1534) * All checks pass. Let me summarize the changes made: ## Summary I've implemented the changes to allow follow-ups after PR merge while still preventing duplicate PRs/merges from the same branch. ### Changes Made: 1. **`frontend/src/components/tasks/TaskFollowUpSection.tsx`** - Removed the `hasMergedPR` check from `canTypeFollowUp` function (lines 337-345) - Removed the unused `Merge` type import - Now users can type and send follow-ups even after a PR has been merged for the selected repo 2. **`frontend/src/components/tasks/Toolbar/GitOperations.tsx`** - Removed `mergeInfo.hasMergedPR` from the rebase button's disabled condition (line 520) - The merge and PR/Push buttons still have `hasMergedPR` checks to prevent duplicate operations on the same branch - Users can now rebase to get latest changes and continue working after merge ### What's now allowed after PR merge: - ✅ Typing and sending follow-up messages - ✅ Rebasing to get latest changes from target branch ### What's still blocked after PR merge (for the same repo/branch): - ❌ Direct merge (can't merge again) - ❌ Create PR / Push to PR (can't create/push to a merged PR) * Cleanup script changes for task attempt 6f608351-a523-4137-a969-e717984fb7cc * use git worktree move to move to temp dir; cleanup temp after successful migration (#1541) * Refactor workspace cleanup and remove unused worktree_deleted field (Vibe Kanban) (#1537) * All done! Here's a summary of the refactoring: - Added `AttemptWithRef` struct with `attempt_id` and `container_ref` fields - Added `ContainerInfo` struct with `attempt_id`, `task_id`, and `project_id` fields (with `Serialize` and `TS` derives) - Renamed `find_by_worktree_deleted` → `find_by_workspace_deleted`, returns `Vec<AttemptWithRef>` - Updated `find_expired_for_cleanup` to return `Vec<AttemptWithRef>` with a simplified query (removed JOINs to `attempt_repos`/`repos`) - Updated `resolve_container_ref` to return `ContainerInfo` instead of tuple - Renamed `check_externally_deleted_worktrees` → `check_externally_deleted_workspaces` - Renamed `spawn_worktree_cleanup` → `spawn_workspace_cleanup` - Updated `cleanup_expired_attempt` to: - Take `&AttemptWithRef` instead of individual parameters - Fetch repos via `AttemptRepo::find_repos_for_attempt` (like `delete_inner`) - Use `WorkspaceManager::cleanup_workspace` instead of `WorktreeManager::cleanup_worktree` - Updated all log messages to use "workspace" terminology - Removed local `ContainerInfo` definition - Imported `ContainerInfo` from `db::models::task_attempt` - Updated handlers to use the struct directly The refactoring improves code clarity by: - Using named structs instead of anonymous tuples - Updating terminology from "worktree" to "workspace" where appropriate - Making the cleanup flow consistent with `delete_inner` (using `WorkspaceManager::cleanup_workspace`) Cleanup script changes for task attempt 28d13fd0-f4c3-4f33-9a9a-354f81d81d1a * All done. Here's a summary of all the changes made: 1. **Added new structs** to `crates/db/src/models/task_attempt.rs`: - `AttemptWithRef` - holds `attempt_id` and `container_ref` - `ContainerInfo` - holds `attempt_id`, `task_id`, `project_id` 2. **Updated cleanup methods** to return named structs instead of tuples: - `find_expired_for_cleanup` now returns `Vec<AttemptWithRef>` - `resolve_container_ref` now returns `ContainerInfo` 3. **Updated `container.rs`** to use `WorkspaceManager::cleanup_workspace` (matching `delete_inner` pattern) 4. **Updated `containers.rs`** route to import `ContainerInfo` from db crate 5. **Created migration** `20251215145026_drop_worktree_deleted.sql` to drop the column 6. **Removed `worktree_deleted`** from: - `TaskAttempt` struct - All SELECT queries - INSERT query in `create()` 7. **Removed `mark_worktree_deleted` method** entirely 8. **Removed `check_externally_deleted_workspaces`** function (no longer needed) 9. **Renamed `find_by_workspace_deleted`** to `find_with_container_ref` (now just filters by `container_ref IS NOT NULL`) 10. **Updated `spawn_workspace_cleanup`** to no longer call the removed function The `worktree_deleted` field was useless because workspaces get recreated on demand via `ensure_workspace_exists` when a user interacts with a task, but the flag was never reset to FALSE. Now cleanup just relies on `container_ref IS NOT NULL` and the 72-hour expiration logic. Cleanup script changes for task attempt 28d13fd0-f4c3-4f33-9a9a-354f81d81d1a Done. Removed the unused `find_with_container_ref` method. Done. Fixed all three issues: 1. Simplified the migration to just `ALTER TABLE task_attempts DROP COLUMN worktree_deleted;` 2. Removed the `TS` derive from `ContainerInfo` 3. Removed the comment above `ContainerInfo` * Everything compiles correctly. The refactoring is complete. Here's a summary of all the changes made: **Summary of cleanup workspace refactor:** 1. **Removed `worktree_deleted` field and related functionality** - The field was never reset to false after workspace recreation, making it useless. Removed: - `worktree_deleted` column via migration `20251215145026_drop_worktree_deleted.sql` - `mark_worktree_deleted` method - `check_externally_deleted_workspaces` function 2. **Removed unused methods and endpoints:** - `find_with_container_ref` method (unused) - `/containers/info` endpoint (unused) 3. **Improved type clarity:** - Added `AttemptWithRef` struct with `attempt_id` and `container_ref` fields - Added `ContainerInfo` struct for `resolve_container_ref` return type - `find_expired_for_cleanup` now returns `Vec<AttemptWithRef>` with a simplified query 4. **Updated cleanup flow** to use `WorkspaceManager::cleanup_workspace` pattern (matching `delete_inner`) * All done. Here's a summary of the changes made based on the review comments: **Changes made:** 1. **Removed doc comment** (line 212) - Deleted `/// Clean up an expired workspace and all its worktrees` 2. **Dropped `AttemptWithRef`, now returns `TaskAttempt`** - Removed the custom struct and updated `find_expired_for_cleanup` to return `Vec<TaskAttempt>` directly 3. **Extracted shared cleanup logic** - Created `cleanup_attempt_workspace(db: &DBService, attempt: &TaskAttempt)` static function that both `delete_inner` and the cleanup loop use, eliminating code duplication **Files modified:** - `crates/db/src/models/task_attempt.rs` - Removed `AttemptWithRef`, updated `find_expired_for_cleanup` return type - `crates/local-deployment/src/container.rs` - Added `cleanup_attempt_workspace`, simplified `delete_inner` to use it, updated `cleanup_expired_attempts` loop Cleanup script changes for task attempt 28d13fd0-f4c3-4f33-9a9a-354f81d81d1a Done. Added `clear_container_ref` method and call it after cleanup. Now cleanup will: 1. Clean up the workspace files 2. Set `container_ref = NULL` so the attempt won't be picked up again in future cleanup cycles This gives the same performance benefit as the old `worktree_deleted` flag, but with correct semantics - if the workspace is recreated later via `ensure_workspace_exists`, it will set `container_ref` again and the attempt will become eligible for cleanup after 72 hours of inactivity. Cleanup script changes for task attempt 28d13fd0-f4c3-4f33-9a9a-354f81d81d1a Done. Now `ensure_container_exists` will call `create()` if `container_ref` is NULL, which regenerates the workspace using the stored `task_attempt.branch`. The branch is preserved in the database so it stays the same. * All tasks are complete. The implementation now includes: 1. **`ensure_project_files_impl`** in `copy.rs` - Like `copy_project_files_impl` but skips files that already exist at target with same size 2. **`ensure_images_by_task`** in `image.rs` - Like `copy_images_by_task_to_worktree` but skips images that already exist 3. **`ensure_project_files`** wrapper in `container.rs` - Private async method with timeout that calls `ensure_project_files_impl` 4. **Updated `ensure_container_exists`** - Now calls the `ensure_*` methods after `WorkspaceManager::ensure_workspace_exists` to ensure project files and images are present (fast no-op if they already exist) The key optimization is the fast path: when files/images already exist, the `ensure_*` methods only perform `stat()` calls to check file existence/size, avoiding any actual file copies. This keeps `ensure_container_exists` fast for the common case while fixing the bug where recreated workspaces (after cleanup set `container_ref = NULL`) wouldn't have their project files and images re-copied. Done. Here's a summary of the refactoring: **Changes made:** 1. **`crates/local-deployment/src/copy.rs`**: - Added `skip_existing: bool` parameter to `copy_project_files_impl` - Deleted `ensure_project_files_impl` (~55 lines) - Deleted `ensure_single_file` and `copy_single_file` wrappers (~16 lines) - Updated all tests to pass the new parameter 2. **`crates/services/src/services/image.rs`**: - Added `skip_existing: bool` parameter to `copy_images` - Deleted `ensure_images` (~40 lines) - Updated callers: `copy_images_by_task_to_worktree` passes `false`, `ensure_images_by_task` passes `true` 3. **`crates/local-deployment/src/container.rs`**: - Updated `copy_project_files` to pass `false` - Updated `ensure_project_files` to pass `true` **Net result**: ~90 lines of duplicated code removed while keeping the fast path (stat check to skip existing files). Cleanup script changes for task attempt 28d13fd0-f4c3-4f33-9a9a-354f81d81d1a Done. Here's a summary of the refactoring: **Changes made:** 1. **`crates/local-deployment/src/copy.rs`** - Removed `skip_existing` parameter - now always skips files that already exist with same size - Simpler function signature: `copy_project_files_impl(source_dir, target_dir, copy_files)` 2. **`crates/services/src/services/image.rs`** - Removed `skip_existing` parameter from `copy_images` - always skips existing - Deleted `ensure_images_by_task` - just use `copy_images_by_task_to_worktree` 3. **`crates/db/src/models/attempt_repo.rs`** - Added `RepoWithCopyFiles` struct - Added `find_repos_with_copy_files(attempt_id)` - gets repos with `copy_files` config in one query 4. **`crates/local-deployment/src/container.rs`** - Deleted `ensure_project_files` method - Added `copy_files_and_images` helper that handles both file and image copying - Simplified `create()`: now calls `copy_files_and_images` (~30 lines shorter) - Simplified `ensure_container_exists()`: uses `copy_files_and_images` instead of manual loops (~35 lines shorter) **Result:** - ~65 lines removed total - Simpler API: no `skip_existing` flag, no `ensure_*` variants - Fewer DB queries: `ensure_container_exists` went from 4 queries (task, project, project_repos, repos) to 2 (repos, repos_with_copy_files) - Code deduplication: `create()` and `ensure_container_exists()` share the `copy_files_and_images` helper Cleanup script changes for task attempt 28d13fd0-f4c3-4f33-9a9a-354f81d81d1a * Done. The fix is cleaner: 1. **Removed the `create()` call** when `container_ref` is NULL 2. **Regenerate workspace path deterministically** using the same logic as `create()` - `dir_name_from_task_attempt(attempt_id, task_title)` 3. **Use `ensure_workspace_exists`** which handles existing branches properly (doesn't try to create them) 4. **Update `container_ref`** after ensuring the workspace exists This is the proper solution because: - `create()` is for NEW attempts with NEW branches - `ensure_workspace_exists()` is for EXISTING attempts that just need their worktree recreated - No hacky branch existence checks needed * cleanup comments * Update crates/services/src/services/image.rs Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Update crates/services/src/services/image.rs Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Revert rename --------- Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Inline delete_inner into ContainerService delete method (Vibe Kanban) (#1544) * Done. Here's a summary of the changes: **Changes made:** 1. **`crates/services/src/services/container.rs`:** - Removed `delete_inner` trait method declaration - Added `cleanup_attempt_workspace` as a new trait method - Modified `delete` to call `self.cleanup_attempt_workspace(task_attempt).await` instead of `self.delete_inner(task_attempt).await` 2. **`crates/local-deployment/src/container.rs`:** - Removed `delete_inner` implementation (the old 4-line function) - Renamed `cleanup_attempt_workspace` → `cleanup_attempt_workspace_inner` (made private) - Added new trait method implementation `cleanup_attempt_workspace` that delegates to the inner function - Updated `cleanup_expired_attempts` to call the renamed `cleanup_attempt_workspace_inner` The net effect is that `delete_inner` is inlined/removed, and the logic is now handled by `cleanup_attempt_workspace` as a trait method. * Done. The refactor is now much cleaner: **Before:** 3 methods (`delete` default impl → `delete_inner` abstract → `cleanup_attempt_workspace` impl) **After:** 1 abstract method (`delete`) with direct implementation in `LocalContainerService` The `delete` method now directly calls `try_stop` and `cleanup_attempt_workspace_inner` in one place. * Done. Renamed `cleanup_attempt_workspace_inner` back to `cleanup_attempt_workspace` in all 3 places. Build passes. * update copy for scripts (#1535) * Fix orphan cleanup to properly handle workspaces containing multiple worktrees (Vibe Kanban) (#1545) * All done. Here's a summary of the changes made: Fixed the orphan cleanup bug by moving the logic from `LocalContainerService` to `WorkspaceManager` and properly handling workspaces (which contain multiple worktrees). 1. **`crates/services/src/services/workspace_manager.rs`**: - Added `cleanup_orphan_workspaces()` - public method that scans the workspace base directory for orphaned workspaces and cleans them up - Added `cleanup_workspace_without_repos()` - helper method that cleans up a workspace by discovering worktrees (subdirectories with `.git` files) and cleaning each one properly using `WorktreeManager::cleanup_worktree()` 2. **`crates/local-deployment/src/container.rs`**: - Removed the broken `cleanup_orphaned_worktrees()` method (was incorrectly treating workspaces as worktrees) - Updated `spawn_workspace_cleanup()` to call `WorkspaceManager::cleanup_orphan_workspaces()` instead - Removed unused imports (`WorktreeCleanup`, `WorktreeManager`) The old code was passing workspace paths (e.g., `/worktrees/abc-task-title/`) directly to `WorktreeManager::cleanup_worktree()`, which expected individual worktree paths (e.g., `/worktrees/abc-task-title/repo-name/`). The new code correctly: 1. Identifies orphaned **workspaces** by checking if the workspace path exists in any task attempt's `container_ref` 2. For each orphaned workspace, scans its subdirectories for worktrees (directories with `.git` files) 3. Cleans up each worktree properly using `WorktreeManager::cleanup_worktree()` 4. Finally removes the workspace directory itself * Done. I've added `cleanup_suspected_worktree()` to `WorktreeManager` and updated `cleanup_workspace_without_repos()` in `WorkspaceManager` to use it. This keeps the worktree detection and cleanup logic in the appropriate manager. * Comments * lint * invalidate project queries on add or delete repo (#1557) --------- Co-authored-by: Alex Netsch <alex@bloop.ai> |
||
|
|
7f9f1433af |
Store binaries in Cloudflare R2 instead of bundling in npm package (Vibe Kanban) (#1554)
* All changes are complete. Let me provide a summary of what was implemented:
## Summary
I've implemented the Cloudflare R2 binary storage feature. Here are the changes:
### Files Created
- **`npx-cli/bin/download.js`** - New module that handles downloading binaries from R2 with:
- SHA-256 checksum verification
- Progress reporting
- Redirect handling
- Local caching in `~/.vibe-kanban/bin/{version}/{platform}/`
### Files Modified
1. **`npx-cli/bin/cli.js`**
- Converted to async for on-demand downloads
- Downloads binaries from R2 instead of using bundled files
- Non-blocking update check shows notice if newer version available
- Caches binaries locally per version/platform
2. **`npx-cli/package.json`**
- Removed `"dist"` from `files` array (package now ~15KB instead of ~150MB)
3. **`.github/workflows/pre-release.yml`**
- Added new `upload-to-r2` job that:
- Downloads all platform packages from artifacts
- Generates manifest.json with SHA-256 checksums for each binary
- Uploads binaries to R2 at `binaries/v{version}/{platform}/{binary}.zip`
- Updates global manifest with latest version
- Modified `create-prerelease` job to:
- Depend on `upload-to-r2` instead of `package-npx-cli`
- Inject R2 public URL into download.js via `sed`
- No longer download/bundle binaries in the npm package
### Required GitHub Secrets
You'll need to add these secrets to your repository:
- `R2_BINARIES_ACCESS_KEY_ID`
- `R2_BINARIES_SECRET_ACCESS_KEY`
- `R2_BINARIES_ENDPOINT` (e.g., `https://<account_id>.r2.cloudflarestorage.com`)
- `R2_BINARIES_BUCKET`
- `R2_BINARIES_PUBLIC_URL` (the public URL for your R2 bucket, e.g., custom domain or public R2 URL)
### R2 Bucket Structure
```
binaries/
manifest.json # {"latest": "0.0.135"}
v0.0.135/
manifest.json # Per-version manifest with checksums
linux-x64/
vibe-kanban.zip
vibe-kanban-mcp.zip
vibe-kanban-review.zip
...
```
* Done! I've updated the implementation to use full tags (with timestamps) instead of just version numbers. Here's a summary of what changed:
## Changes Made
1. **`npx-cli/bin/download.js`**:
- Added `BINARY_TAG` constant (placeholder `__BINARY_TAG__`)
- Changed `ensureBinary()` to use `BINARY_TAG` instead of accepting version as parameter
- Cache paths now use the tag: `~/.vibe-kanban/bin/{tag}/{platform}/`
2. **`npx-cli/bin/cli.js`**:
- Updated to import `BINARY_TAG` from download.js
- Cache directory now uses `BINARY_TAG` instead of `CLI_VERSION`
- Updated `ensureBinary()` call to not pass version
3. **`.github/workflows/pre-release.yml`**:
- `upload-to-r2` job now uses `new_tag` instead of `new_version` for R2 paths
- Binaries are stored at `binaries/{tag}/{platform}/{binary}.zip`
- Global manifest stores the full tag: `{"latest": "v0.0.135-20251215122030"}`
- `create-prerelease` job now injects both `__R2_PUBLIC_URL__` and `__BINARY_TAG__`
This allows multiple pre-releases to coexist in R2 (e.g., `v0.0.135-20251215122030` and `v0.0.135-20251215100000`), making rollbacks easy.
* chore: bump version to 0.0.136
---------
Co-authored-by: GitHub Action <action@github.com>
|
||
|
|
e16602cc0f | Downgrade version | ||
|
|
8a623ee924 |
Larger runner (#1552)
* Use a larger ubuntu runner * chore: bump version to 0.0.136 --------- Co-authored-by: Solomon <abcpro11051@disroot.org> Co-authored-by: GitHub Action <action@github.com> |
||
|
|
5710cc3371 | chore: bump version to 0.0.135 | ||
|
|
0e57cf3440 |
Approvals for ACP-based executors (#1511)
* Approvals for ACP-based executors Gemini, Qwen, and Opencode * set all permissions to "ask" * use `normalize_unified_diff` in other log normalizers |
||
|
|
bb2404e199 |
upgrade codex sdk (#1504)
* update codex sdk * show context-compacted message |
||
|
|
dffa4d9621 | chore: bump version to 0.0.134 | ||
|
|
5d5d882b8e | gpt-5.2 (#1503) | ||
|
|
b37672a475 | chore: bump version to 0.0.133 | ||
|
|
84d80659b3 | normalize tool display; remove backticks (#1482) | ||
|
|
d0392e6d5e | chore: bump version to 0.0.132 | ||
|
|
aee6ac35b8 |
Opencode ACP (#1471)
* Opencode ACP switch opencode to ACP. Simplifies the implementation and adds fork/retry support. * display relative file path for read tool * remove empty assitant messages |
||
|
|
1ee05ea862 | normalize cursor todo items (#1473) | ||
|
|
0b1af7e38a | Bump Copilot-cli version (#1469) | ||
|
|
08d8848346 | remove redundant or unused deps (#1462) | ||
|
|
e28e25720a | add opus variant for claude code (#1452) | ||
|
|
7da884bc3a |
Add environment variables to executor profiles (#1444)
* The implementation is complete. Here's a summary of what was done:
Successfully added environment variable configuration support to executor profiles. Users can now configure env vars like this:
```json
{
"CLAUDE_CODE": {
"DEFAULT": {
"CLAUDE_CODE": {
"env": {
"ANTHROPIC_AUTH_TOKEN": "...",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"API_TIMEOUT_MS": "3000000",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.6"
}
}
}
}
}
```
1. **`crates/executors/src/command.rs`**:
- Added `env: Option<HashMap<String, String>>` to `CmdOverrides` struct
- Added `apply_env_vars()` helper function
2. **Updated all executors to apply env vars**:
- `claude.rs` - `spawn_internal()`
- `codex.rs` - `spawn()`
- `amp.rs` - `spawn()` and `spawn_follow_up()`
- `droid.rs` - module-level `spawn()` function
- `copilot.rs` - both spawn methods
- `cursor.rs` - both spawn methods
- `opencode.rs` - both spawn methods
- `acp/harness.rs` - `spawn_with_command()` and `spawn_follow_up_with_command()` (used by Gemini/Qwen)
3. **Type Generation**: All JSON schemas and TypeScript types now include the `env` field
This allows users to set environment variables for all supported coding agents (Claude Code, Codex, Gemini, Amp, Droid, Copilot, Cursor, OpenCode, Qwen) through profile configuration, eliminating the need for external tools like claude-code-router.
* The implementation is complete. Here's a summary of what was done:
## Summary
### Backend Changes
- Added `env: Option<HashMap<String, String>>` field to `CmdOverrides` struct in `crates/executors/src/command.rs`
- Created `apply_env_vars()` helper function to inject env vars into `tokio::process::Command`
- Updated all 9 executors to apply env vars during spawn:
- claude.rs, codex.rs, amp.rs, droid.rs, copilot.rs, cursor.rs, opencode.rs
- gemini.rs and qwen.rs (via ACP harness)
- Modified ACP harness signature to accept `Option<&CmdOverrides>`
### Frontend Changes
- Created `KeyValueField.tsx` - custom RJSF field for editing key-value pairs
- Registered the field in `theme.ts`
- Added `uiSchema` to `ExecutorConfigForm.tsx` to use the custom field for `env`
### Generated Files
- `shared/types.ts` - TypeScript types updated with `env` field
- `shared/schemas/*.json` - All 9 executor schemas include `env` property
The environment variables UI will now appear in Settings > Agent Settings as a key-value editor with "Environment Variables" label and description. Users can add/remove/edit env vars that will be passed to the CLI execution environment.
* cleanup env structs
* fix form
* fmt
* remove mise.toml
* fmt
* Seprate config form per selected variant
---------
Co-authored-by: Louis Knight-Webb <louis@bloop.ai>
Co-authored-by: Solomon <abcpro11051@disroot.org>
|
||
|
|
e1c9c15f43 | chore: bump version to 0.0.131 | ||
|
|
d72ec43d3b | Auto approve in plan mode (#1450) |