518 Commits

Author SHA1 Message Date
Anthony Mahé
9766f9930d feat(i18n): add French (FR) language support (#2113)
* feat(i18n): add French (FR) language support

- Add Fr variant to UiLanguage enum in Rust backend
- Create French locale directory with 5 translation files:
  - common.json: Common UI elements (buttons, states, navigation)
  - settings.json: Settings pages translations
  - projects.json: Project management strings
  - tasks.json: Task-related strings
  - organization.json: Organization management strings
- Update languages.ts with FR mapping and Français endonym
- Update config.ts to import and register French resources

Follows the pattern established by PR #994 (Korean) and PR #795 (Spanish)

* fmt

* fix i18n

* types

* fix(i18n): add missing customise key to fr/common.json

* fix(i18n): add missing customise key to fr/common.json

---------

Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com>
2026-01-18 09:13:50 +00:00
GitHub Action
d1d0b7eacd chore: bump version to 0.0.155 2026-01-17 09:43:17 +00:00
GitHub Action
4ffd7c92b9 chore: bump version to 0.0.154 2026-01-16 17:57:36 +00:00
Louis Knight-Webb
d941e9a5e0 Add integrated terminal with PTY backend and xterm.js frontend (Vibe Kanban) (#2104)
* integrated terminal

* ci

* persist terminal

* Done! I've moved the TerminalPanelContainer from the main panel area to the right sidebar. Here's a summary of the changes:

- Added `isTerminalVisible: boolean` to global state (defaults to `true`)
- Added `toggleTerminal()` and `setTerminalVisible(value)` actions
- Added `isTerminalVisible` to the persisted state and the `useWorkspacePanelState` hook

- Imported `TerminalPanelContainer` and `useUiPreferencesStore`
- Restructured the component to always include a terminal section at the bottom (when not in create mode and `isTerminalVisible` is true)
- Dynamic flex ratios:
  - With upper content + terminal: flex-4 (content) / flex-2 (git) / flex-4 (terminal)
  - Without upper content + terminal: flex-3 (git) / flex-7 (terminal)
  - When terminal is hidden: original ratios preserved

- Removed the `TerminalPanelContainer` import
- Removed the TERMINAL case from the right main panel rendering

- Added `isTerminalVisible` to `ActionVisibilityContext` interface
- Updated `ToggleTerminalMode` action to use `toggleTerminal()` and check `isTerminalVisible`

- Added `isTerminalVisible` from `panelState` to the visibility context

The terminal now appears permanently at the bottom of the right sidebar (when visible), and the toggle button collapses/expands just the terminal section within the sidebar. The visibility state is persisted to localStorage.

* Frontend ESLint passes with no errors. The backend Rust error (`crates/utils/src/shell.rs:31`) is a pre-existing issue in the codebase, not related to my changes.

* `cargo check` passes now. The fix was adding `.to_path_buf()` to convert the `&Path` reference to an owned `PathBuf`.

* The code compiles. Done! I've added three environment variables in `crates/local-deployment/src/pty.rs:73-75`:

1. `ZDOTDIR=/nonexistent` - prevents zsh from loading `~/.zshrc`
2. `PS1="$ "` - sets the bash prompt
3. `PROMPT="$ "` - sets the zsh prompt

The terminal prompt will now show just `$ ` instead of `lkw@Louiss-MacBook-Pro vibe-kanban %`. Run `pnpm run dev:qa` and open the terminal panel to verify.

* Cleanup script changes for workspace 928e696e-5f40-4603-9227-798f0520e07f

* Done! The fix is simpler - using `cmd.arg("-f")` to tell zsh/bash to skip loading config files. This:

1. Removes the `ZDOTDIR=/nonexistent` that was causing errors
2. Adds `-f` flag which skips `.zshrc`/`.bashrc` loading
3. Keeps `PS1` and `PROMPT` env vars which will now be respected

Run `pnpm run dev:qa` and open the terminal to verify the prompt shows `$ `.

* Cleanup script changes for workspace 928e696e-5f40-4603-9227-798f0520e07f

* I've implemented the terminal theme integration. Here's a summary of the changes:

## Changes Made

**1. Created `frontend/src/utils/terminalTheme.ts`**
- `hslToHex()` function to convert HSL CSS variable format (`"210 40% 98%"`) to hex colors
- `getCssVariable()` helper to read CSS variables from the `.new-design` element
- `getTerminalTheme()` function that builds an xterm.js `ITheme` object from CSS variables:
  - Uses `--console-background` and `--console-foreground` for main colors
  - Uses `--console-success` and `--console-error` for green/red ANSI colors
  - Provides appropriate ANSI color palettes for both light and dark modes

**2. Updated `frontend/src/components/ui-new/terminal/XTermInstance.tsx`**
- Imported `useTheme` hook and `getTerminalTheme` utility
- Replaced hardcoded Tokyo Night theme with dynamic `getTerminalTheme()` call
- Added effect to update terminal theme when app theme changes (`terminal.options.theme = getTerminalTheme()`)

The terminal will now:
- Initialize with colors matching the current theme
- Automatically update colors when switching between light and dark mode
- Use the console color variables defined in `index.css`

* Cleanup script changes for workspace 928e696e-5f40-4603-9227-798f0520e07f

* Now I understand the issue clearly. Here are the relevant variables:

| Variable | Light Mode | Dark Mode | Purpose |
|----------|------------|-----------|---------|
| `--_primary` | `0 0% 5%` (dark) | `240 4.8% 95.9%` (light) | Button background - **inverted** |
| `--_console-background` | `0 0% 100%` (white) | `0 0% 0%` (black) | Terminal background - **correct** |
| `--_console-foreground` | `0 0% 5%` (dark) | `210 40% 98%` (light) | Terminal text - **correct** |
| `--bg-primary` | `0 0% 100%` (white) | `0 0% 13%` (dark gray) | Page background |

The code was changed to use `--primary` but that's the wrong variable. For the terminal, you should use:
- `--console-background` / `--_console-background` for the background
- `--console-foreground` / `--_console-foreground` for the text

Or if you prefer to match other UI elements:
- `--bg-primary` for background
- `--text-high` for foreground text

Which approach would you prefer? The original `--console-*` variables were specifically designed for terminal styling, or we can use `--bg-primary`/`--text-high` to match the general UI background.

* Cleanup script changes for workspace 928e696e-5f40-4603-9227-798f0520e07f

* Done. The terminal will now use `--bg-primary` for the background and `--text-high` for the foreground text. This means:

- **Light mode**: White background (`0 0% 100%`) with dark text (`0 0% 5%`)
- **Dark mode**: Dark gray background (`0 0% 13%`) with light text (`0 0% 96%`)

* Done. The terminal will now use `--bg-secondary` for the background and `--text-high` for the foreground text. This means:

- **Light mode**: Light gray background (`0 0% 95%`) with dark text (`0 0% 5%`)
- **Dark mode**: Darker gray background (`0 0% 11%`) with light text (`0 0% 96%`)

* Let me know if you find any issues during testing or need adjustments!

* Cleanup script changes for workspace 928e696e-5f40-4603-9227-798f0520e07f

* terminal

* sidebar cleanup

* fix chat collapse

Amp-Thread-ID: https://ampcode.com/threads/T-019bc754-8db9-712a-a915-58d74d210cad
Co-authored-by: Amp <amp@ampcode.com>

* for the terminal on windows we need to default to powershell if avalibale for the pty  (vibe-kanban 049dbf73)

only if powershell.exe cannot be resolved, we should use cmd.

* he colour theme used for the terminal ui isn't visible enough in light mode (vibe-kanban 5f50878a)

t I think we either don't override the ANSI colour mapping with our own, or it's not contrasted enough

* fmt

---------

Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Solomon <abcpro11051@disroot.org>
2026-01-16 17:56:28 +00:00
Solomon
10f6a9171a feat: display context usage in UI for Codex and Claude Code (#1775)
* feat: display context usage in UI for Codex executor

- Extract token usage data from Codex execution logs.
- Track usage state within the `EntriesContext`.
- Display a context usage progress bar in the next action card.

* Add claude-code context token usage

* fix type issue

---------

Co-authored-by: Louis Knight-Webb <louis@bloop.ai>
2026-01-16 17:41:36 +00:00
Alex Netsch
ee212c5e61 Add Claude Code Stop hook for uncommitted changes check (Vibe Kanban) (#2049)
* The implementation is complete. Here's a summary of the changes:

## Summary

I added a check for commits made by the coding agent during execution. If commits were made, the cleanup script will now run.

### Changes Made

**File: `crates/local-deployment/src/container.rs`**

1. **Added new method `has_commits_from_execution`** (lines 314-344): This method compares the `before_head_commit` (captured at execution start) with the current HEAD for each repo to detect if any commits were made during execution.

2. **Updated the `should_start_next` logic** (lines 477-490): The decision to run the cleanup script now checks both:
   - Whether uncommitted changes were just committed (`changes_committed`)
   - Whether the agent made any commits during execution (`has_commits_from_execution`)

   If either condition is true, the cleanup script runs.

### How It Works

- Before: Cleanup script only ran if `try_commit_changes()` returned `true` (i.e., if there were uncommitted changes to commit)
- After: Cleanup script runs if `try_commit_changes()` returned `true` **OR** if `has_commits_from_execution()` returns `true` (i.e., HEAD changed from what it was at execution start)

This ensures that if a coding agent makes commits during its execution but leaves no uncommitted changes, the cleanup script will still run.

* feat: add Claude Code hooks for cleanup scripts in worktrees

When a workspace is created with repos that have cleanup scripts configured,
automatically create .claude/settings.local.json with a "Stop" hook that
runs the cleanup scripts when the agent finishes.

- Add create_claude_hooks_config() to create .claude/hooks/run-cleanup.sh
- Handle single-repo (agent in repo dir) vs multi-repo (agent in workspace root)
- Also add has_commits_from_execution() to run cleanup when agent made commits

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* All tests pass. The fix is complete - the Claude Code hooks will now always be created regardless of whether repos have cleanup scripts configured.

* Cleanup script changes for workspace bf914d08-cb51-49a4-89b9-ba56108c841a

* Done. I've implemented the simplified `check-git-status.sh` hook using `include_str!`:

1. Created `crates/local-deployment/src/scripts/check-git-status.sh` - the script that checks for uncommitted changes and blocks the agent until they commit

2. Updated `crates/local-deployment/src/container.rs`:
   - Added `const CHECK_GIT_STATUS_SCRIPT: &str = include_str!("scripts/check-git-status.sh");` to embed the script at compile time
   - Simplified `create_claude_hooks_config()` to only write this one hook script (removed all the cleanup script logic)

The hook will now be created in `.claude/hooks/check-git-status.sh` and configured in `.claude/settings.local.json` as a "Stop" hook for Claude Code workspaces.

* Done. I've implemented the Stop hook via the protocol in `claude.rs`:

**Summary of changes:**

1. **Created** `crates/executors/src/scripts/check-git-status.sh` - The script that checks for uncommitted changes

2. **Modified** `crates/executors/src/executors/claude.rs`:
   - Added `const CHECK_GIT_STATUS_SCRIPT` using `include_str!` to embed the script at compile time
   - Updated `get_hooks()` to always include a Stop hook with the script (using `shlex::try_quote` for proper escaping)
   - The Stop hook is now sent via `protocol_peer.initialize(hooks)` alongside any PreToolUse hooks

3. **Removed** from `crates/local-deployment/src/container.rs`:
   - Deleted `create_claude_hooks_config()` function
   - Deleted the const and call to create hooks
   - Deleted the `scripts/` directory

Now the hook is sent via the protocol, so no files are created in the workspace that would show up as untracked.

* Done. I've updated the implementation to use `settings.local.json` with the script inlined via `bash -c`:

**Summary of changes:**

1. **Reverted `crates/executors/src/executors/claude.rs`**:
   - Removed `CHECK_GIT_STATUS_SCRIPT` const
   - Restored `get_hooks()` to only return PreToolUse hooks (no Stop hook)

2. **Moved script to `crates/local-deployment/src/scripts/check-git-status.sh`**

3. **Added `shlex = "1.3.0"` to `crates/local-deployment/Cargo.toml`**

4. **Updated `crates/local-deployment/src/container.rs`**:
   - Added `CHECK_GIT_STATUS_SCRIPT` const using `include_str!`
   - Added `create_claude_hooks_config()` function that:
     - Only runs for single-repo workspaces
     - Creates `.claude/settings.local.json` with the script inlined via `bash -c` using `shlex::try_quote` for proper escaping
     - No `.claude/hooks/` directory is created (script is fully inline)
   - Called from `create_workspace_config_files()`

Since `settings.local.json` is already gitignored by Claude Code, this approach avoids the untracked file issue while keeping the script in a separate file for maintainability.

* Cleanup script changes for workspace bf914d08-cb51-49a4-89b9-ba56108c841a

* Done. The Claude hooks setup now only runs for Claude Code executor.

**Changes made to `crates/local-deployment/src/container.rs`:**

1. Removed the call to `create_claude_hooks_config()` from `create_workspace_config_files()` (and changed parameter back to `_agent_working_dir`)

2. Added the hooks setup in `start_execution_inner()` with a check for Claude Code executor:
   ```rust
   if let Some(BaseCodingAgent::ClaudeCode) = executor_action.base_executor() {
       Self::create_claude_hooks_config(
           &current_dir,
           workspace.agent_working_dir.as_deref(),
       )
       .await?;
   }
   ```

Now the `settings.local.json` with the Stop hook will only be created when running with the Claude Code executor, not for other executors like Codex, Gemini, etc.

* Cleanup script changes for workspace bf914d08-cb51-49a4-89b9-ba56108c841a

* Done. The implementation now explicitly checks the repo count:

**Changes to `crates/local-deployment/src/container.rs`:**

1. **Updated call site in `start_execution_inner()`:**
   ```rust
   if let Some(BaseCodingAgent::ClaudeCode) = executor_action.base_executor() {
       let repos = WorkspaceRepo::find_repos_for_workspace(&self.db.pool, workspace.id).await?;
       if repos.len() == 1 {
           if let Some(agent_dir) = &workspace.agent_working_dir {
               Self::create_claude_hooks_config(&current_dir.join(agent_dir)).await?;
           }
       }
   }
   ```

2. **Simplified `create_claude_hooks_config()`:**
   - Now takes just `repo_dir: &Path` (the full path to the repo directory)
   - Removed the `agent_working_dir` parameter and internal check
   - The caller is responsible for ensuring this is only called for single-repo workspaces

* Cleanup script changes for workspace bf914d08-cb51-49a4-89b9-ba56108c841a

* Done. I've successfully implemented the Stop hook via protocol callbacks instead of the file-based approach. Here's a summary of the changes:

## Summary

**Files modified:**
1. `crates/executors/src/executors/claude/client.rs`:
   - Added `working_dir: PathBuf` field to `ClaudeAgentClient`
   - Added `STOP_GIT_CHECK_CALLBACK_ID` constant
   - Updated `on_hook_callback()` to handle Stop git check callbacks
   - Added `check_git_status()` async function that checks for uncommitted changes
   - Added `find_git_repo_in_subdirs()` helper for multi-repo fallback

2. `crates/executors/src/executors/claude.rs`:
   - Updated `get_hooks()` to always include a Stop hook with callback ID
   - Passed `working_dir` to `ClaudeAgentClient::new()` in `spawn_internal()`
   - Added import for `STOP_GIT_CHECK_CALLBACK_ID`

3. `crates/local-deployment/src/container.rs`:
   - Removed `CHECK_GIT_STATUS_SCRIPT` constant
   - Removed `create_claude_hooks_config()` function
   - Removed the call to create file-based hooks in `start_execution_inner()`

4. `crates/local-deployment/Cargo.toml`:
   - Removed `shlex` dependency

**Files deleted:**
- `crates/local-deployment/src/scripts/check-git-status.sh`
- `crates/local-deployment/src/scripts/` (empty directory)

**Benefits of the new approach:**
- No files created in the workspace (avoids untracked file issues)
- Git status check runs dynamically via protocol callback
- Supports single-repo workspaces with fallback to checking subdirectories
- More portable - no dependency on bash or external scripts

* Cleanup script changes for workspace bf914d08-cb51-49a4-89b9-ba56108c841a

* Done. I've fixed the Stop hook response format. The changes:

1. **`check_git_status()`** now returns the correct format for Stop hooks:
   - When allowing stop: returns `{}` (empty object)
   - When blocking stop: returns `{"continue": false, "stopReason": "..."}`

2. **`on_hook_callback()`** now returns the Stop hook result directly without wrapping it in `hookSpecificOutput`

The implementation now follows the Claude SDK documentation for Stop hooks, which use top-level `continue` and `stopReason` fields rather than the `hookSpecificOutput` wrapper used by PreToolUse hooks.

* Done. I've updated the Stop hook response format to use `{"decision": "approve"}` or `{"decision": "block", "reason": "..."}` which matches the SDK callback format documented at code.claude.com/docs/en/hooks.

* Fixed. Removed the unused `_agent_working_dir` parameter from `create_workspace_config_files` and updated both call sites.

* Done. I've implemented the `RepoContext` struct to properly pass repository information from local-deployment to executors. Here's a summary of the changes:

**Files modified:**

1. **`crates/executors/src/env.rs`**:
   - Added `RepoContext` struct with `workspace_root` and `repo_names` fields
   - Added `repo_paths()` method to get full paths to all repos
   - Added `repo_context: RepoContext` field to `ExecutionEnv` (required field)
   - Updated `ExecutionEnv::new()` to take `RepoContext` as parameter

2. **`crates/executors/src/executors/claude/client.rs`**:
   - Replaced `working_dir: PathBuf` with `repo_context: RepoContext` in `ClaudeAgentClient`
   - Updated `check_git_status()` to iterate over all repos and check each for uncommitted changes
   - Removed `find_git_repo_in_subdirs()` helper (no longer needed)

3. **`crates/executors/src/executors/claude.rs`**:
   - Updated `spawn_internal()` to pass `env.repo_context` to `ClaudeAgentClient`

4. **`crates/local-deployment/src/container.rs`**:
   - Added import for `RepoContext`
   - In `start_execution_inner()`: Load repos, build `RepoContext`, pass to `ExecutionEnv::new()`

* Done. I've added the `commit_reminder` setting to `ClaudeCode`:

1. **Added `commit_reminder: Option<bool>` field** to the `ClaudeCode` struct in `claude.rs`
2. **Made the Stop hook conditional** - it now only registers when `commit_reminder` is `true` (defaults to `false`/off)
3. **Regenerated TypeScript types** so the frontend knows about the new field

Users can enable the commit reminder by adding `"commit_reminder": true` to their profile configuration in `~/.config/vibe-kanban/profiles.json`.

* Done. Removed all 10 obvious comments as requested.

* Done. Now synthetic User messages (like the Stop hook feedback) will be rendered as `SystemMessage` entries in the logs. The implementation:

1. Added `is_synthetic: bool` field to `ClaudeJson::User` variant (with `#[serde(default, rename = "isSynthetic")]`)
2. When `is_synthetic` is true, any Text content in the message gets rendered as a `SystemMessage` entry

* Fix tests

* No findings in the latest commits I reviewed (048e3e1b5, 723ff78bd, c1caa1f73, 4af28b855, ad1334b94). Residual risk: I didn’t run tests, and the review is based on reading diffs only.

Open questions / assumptions:
- Assuming it’s intentional that the Stop hook is now opt-in via `commit_reminder` in `crates/executors/src/executors/claude.rs`.
- Assuming workspaces always populate repo names; otherwise the Stop hook in `crates/executors/src/executors/claude/client.rs` will auto-approve when none are configured.

Change summary:
- Added repo context plumbed into executor env and multi-repo git status checks in `crates/executors/src/env.rs`, `crates/executors/src/executors/claude.rs`, `crates/executors/src/executors/claude/client.rs`, and `crates/local-deployment/src/container.rs`.
- Introduced `commit_reminder` config and schema/types updates in `crates/executors/src/executors/claude.rs`, `shared/schemas/claude_code.json`, and `shared/types.ts`.
- Render synthetic user messages as system log entries in `crates/executors/src/executors/claude.rs`.

* Lint

* Done. I've added the `commit_reminder` beta setting to the global Config:

1. **Backend Config** (`v8.rs`) - Added `commit_reminder: bool` field (defaults to `false`)
2. **Removed from ClaudeCode** - Removed per-profile field, now uses global setting
3. **ExecutionEnv** - Added `commit_reminder` field to pass setting to executors
4. **Container** - Reads setting from config and passes to `ExecutionEnv`
5. **Claude executor** - Uses `env.commit_reminder` when building hooks
6. **Frontend UI** - Added checkbox in Beta Features section
7. **i18n** - Added translation keys for all 6 locales (en, es, ja, ko, zh-Hans, zh-Hant)
8. **TypeScript types** - Regenerated via `pnpm run generate-types`

Users can now enable the commit reminder feature from Settings > General > Beta Features.

* All tests pass. Both `pnpm run lint` and `cargo test --workspace` complete successfully.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:32:27 +00:00
Solomon
daa2690500 Fix command builder whitespace handling (#2018)
* Fix command builder whitespace handling

Add a seprate command for parameters that need to be split on whitespace boundaries, and default to not splitting.

The previous behaviour always split parameters, which caused copilot CLI to fail when a project had whitespace in the repository directory name; `error: too many arguments. Expected 0 arguments but got 1;.

The issue was not specific to copilot altough it only occured in copilot due to an implementation detail for copilot where it recevied a directory name which happened to contain the project name.

* make extend_shell_params private
2026-01-15 20:08:09 +00:00
Alex Netsch
82a5dbecbc Done. I've bumped the Claude Code version from 2.1.2 to 2.1.7 in crates/executors/src/executors/claude.rs:47. (#2074) 2026-01-15 18:02:29 +00:00
Gabriel Gordon-Hall
b9c961a666 All changes have been completed successfully. Let me provide a summary of what was fixed: (#2068)
## Summary

I've fixed the MCP tool description parameter mismatches reported in Issue #1942.

### Changes Made

**1. `crates/server/src/mcp/task_server.rs`** - Fixed 4 issues:

- **`update_task`** (line 753): Removed incorrect `project_id` requirement from description
- **`delete_task`** (line 802): Removed incorrect `project_id` requirement from description
- **`get_task`** (line 820): Removed incorrect `project_id` requirement from description
- **`StartWorkspaceSessionRequest.executor`** (line 223): Added missing executors (`AMP`, `QWEN_CODE`, `COPILOT`, `DROID`) to the description

**2. `docs/integrations/vibe-kanban-mcp-server.mdx`** - Updated documentation:

- Added `list_repos` tool to the Project Operations table
- Added new "Context" section with `get_context` tool
- Renamed `start_task_attempt` to `start_workspace_session` (the actual tool name)
- Updated `start_workspace_session` parameters to show `repos` array instead of single `base_branch`
- Updated example JSON to demonstrate correct parameter format

The cargo check passes, confirming all Rust changes compile correctly.
2026-01-15 17:59:12 +00:00
Louis Knight-Webb
ede1511a50 fix: ScriptFixerDialog no longer overwrites unrelated scripts (Vibe Kanban) (#2078)
* All tasks are complete. Here's a summary of the changes made:

## Summary

Fixed the issue where `ScriptFixerDialog.tsx` was replacing cleanup and setup scripts with `null` when editing a dev server script.

### Changes Made:

1. **Added `serde_with` dependency** (`Cargo.toml` and `crates/db/Cargo.toml`)
   - Added `serde_with = "3"` to enable the double option pattern

2. **Updated `UpdateRepo` struct** (`crates/db/src/models/repo.rs`)
   - Changed all fields from `Option<T>` to `Option<Option<T>>` with the `double_option` serde helper
   - Added `#[ts(optional, type = "...")]` annotations for proper TypeScript type generation

3. **Updated `Repo::update` method** (`crates/db/src/models/repo.rs`)
   - Now properly handles three states:
     - `None` = field absent → preserve existing value
     - `Some(None)` = explicitly null → set to NULL
     - `Some(Some(v))` = has value → update to value

4. **Updated `ScriptFixerDialog.tsx`** (`frontend/src/components/dialogs/scripts/ScriptFixerDialog.tsx`)
   - Changed `handleSave` and `handleSaveAndTest` to only send the field being edited
   - Removed `repos` from the dependency arrays since it's no longer used in the save functions

5. **Regenerated TypeScript types**
   - `UpdateRepo` now has all fields as optional: `field?: type | null`

### Result:
The API now supports true partial updates. Clients can send only the fields they want to update, and existing values are preserved for omitted fields. Sending `null` explicitly will clear a field to NULL.

* Done. All Rust code has been formatted.
2026-01-15 15:49:01 +00:00
Gabriel Gordon-Hall
a2ccc49ca4 Add MCP_HOST and MCP_PORT environment variables for MCP server configuration (Vibe Kanban) (#2063)
* Done. Here's a summary of the fix:

## Summary

**Issue #1937** is legitimate - Windows users cannot connect MCP tools when `HOST=0.0.0.0` because Windows doesn't allow client connections to that address.

**Fix applied** in `crates/server/src/bin/mcp_task_server.rs`:

Added `MCP_HOST` and `MCP_PORT` environment variables that override `HOST` and `BACKEND_PORT`/`PORT` for MCP client connections.

**Priority order:**
- Host: `VIBE_BACKEND_URL` > `MCP_HOST` > `HOST` > `127.0.0.1`
- Port: `VIBE_BACKEND_URL` > `MCP_PORT` > `BACKEND_PORT` > `PORT` > port file

**Usage for Windows users with LAN access:**
```bash
HOST=0.0.0.0 MCP_HOST=127.0.0.1 pnpm run dev
```

The change is minimal (4 lines modified) and backwards compatible - existing setups without `MCP_HOST`/`MCP_PORT` work exactly as before.

* Done. I've added `MCP_HOST` and `MCP_PORT` to the Environment Variables table in the README with descriptions explaining their purpose and the Windows use case.
2026-01-15 12:24:06 +00:00
Britannio Jarrett
9106c8223a feat: Add Zed remote SSH support (Vibe Kanban) (#1666)
* Done. Added Zed remote SSH support using the `zed://ssh/` protocol URL format.

**Generated URL format**: `zed://ssh/{user}@{host}{path}`

Examples:
- `zed://ssh/192.168.1.10/home/user/.vimrc`
- `zed://ssh/brit@scepcy/home/brit/projects/scepsy/`

* Restored the comment.

* Done. Added Zed to the frontend condition so the remote SSH host/user fields now appear when Zed is selected as the editor.

* add antigravity as an option in settings

* use early return for zed case to remove extra match statement
2026-01-15 12:22:03 +00:00
GitHub Action
7b465cbae6 chore: bump version to 0.0.153 2026-01-15 10:58:39 +00:00
Alex Netsch
3902cc953d Fix hardcoded shell paths to support NixOS and non-FHS systems (#2046)
Store the actual shell path in each UnixShell variant (as PathBuf)
instead of hardcoding /bin/* paths. Now when $SHELL is e.g.
/nix/store/.../zsh, the actual path is preserved and used.

Also filter fallback shells in get_fresh_path() to skip non-existent
paths on systems where /bin/* shells don't exist.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 10:56:15 +00:00
Gabriel Gordon-Hall
5ca8b9852a success for empty json responses (#2058) 2026-01-15 10:46:32 +00:00
Louis Knight-Webb
ea5954c8f5 Refactor WorkspacesLayout (#2052)
* init refactor

* changes context

* wip

* logs context

* workspaces layout context breakdown

* sidebar context

* move diffs to workspace context

* compress workspaces layout

* refactors

* types

* always show archived
2026-01-14 22:07:00 +00:00
Gabriel Gordon-Hall
4071993561 remove rogue files (#2048) 2026-01-14 21:42:21 +00:00
Solomon
b24be51d0a bump gemini-cli to 0.23 (#2037) 2026-01-14 15:39:33 +00:00
Gabriel Gordon-Hall
b7a0e04474 fix (#2041) 2026-01-14 14:52:14 +00:00
Alex Netsch
add92d94f4 Fix PR creation remote/branch resolution for forks (Vibe Kanban) (#1976)
* So `git-url-parse` can give us `owner()` and `repo()` through the provider. That's cleaner than manual string parsing.

Let me present the options to you:

**Option 1: `git-url-parse` crate**
- Pros: Specifically designed for git URLs, gives owner/repo directly via provider
- Cons: New dependency (though small)

**Option 2: `gix-url` crate**
- Pros: Part of gitoxide (well-maintained), robust parsing
- Cons: New dependency, still need to extract owner/repo from path

**Option 3: Keep current approach but improve it**
- Use the `url` crate we already have for HTTPS URLs
- Handle SSH URLs as a special case (they use `:` instead of `/`)
- Less string magic, more structured

**Option 4: Use `gh` CLI to parse**
- `gh repo view <url> --json owner,name`
- Pros: No new deps, `gh` handles all edge cases
- Cons: Requires network/auth, slower

Which approach would you prefer? I'd recommend **Option 1 (`git-url-parse`)** since it's purpose-built for this exact use case.

* Cleanup script changes for workspace a07fdbcf-0608-4a84-a012-53d4fee6d115

* Let me provide a summary of all the changes made:

## Summary

Fixed the hardcoded remote handling to support fork workflows. Here's what changed:

### 1. `crates/services/src/services/git.rs`
- **`default_remote_name()`**: Now prefers "origin" (git's convention) instead of arbitrarily picking the first remote
- **`get_remote_url()`**: New helper to get the URL of a specific remote by name
- **`get_remote_url_from_branch_or_default()`**: New helper that gets the remote URL for a branch, falling back to default remote

### 2. `crates/services/src/services/git/cli.rs`
- **`default_remote_name()`**: Same fix as above - prefers "origin"
- **`get_remote_url()`**: New method to get remote URL by name

### 3. `crates/services/src/services/git_host/github/cli.rs`
- **`get_repo_info_from_url()`**: New method that uses `gh repo view <url> --json owner,name` to parse owner/repo from a remote URL (no string magic!)

### 4. `crates/services/src/services/git_host/github/mod.rs`
- **`get_repo_info_from_url()`**: Async wrapper for the new CLI method
- **`create_pr()`**: Now uses `get_repo_info_from_url()` with the `remote_url` parameter to determine which repo to create the PR against

### 5. `crates/server/src/routes/task_attempts/pr.rs`
- **Key fix**: Now extracts the target remote URL from the `target_branch` (e.g., `upstream/main`) instead of from `workspace.branch` (your task branch)
- This enables fork workflows: push to your fork (`origin`), but create PR against upstream (the target branch's remote)

### How fork workflows now work:
1. User selects target branch like `upstream/main`
2. Code pushes task branch to `origin` (your fork)
3. Code extracts remote URL from `upstream` remote (the upstream repo)
4. PR is created against the upstream repo using `gh pr create --repo upstream-owner/repo`

* Cleanup script changes for workspace a07fdbcf-0608-4a84-a012-53d4fee6d115

* Build passes. The response structs are now at module level alongside the other `Gh*` response types, which is cleaner and more consistent with the existing code style.

* Build passes. Now `gh repo view <url>` is run from the repo directory, which helps with GitHub Enterprise authentication context.

* Done. Removed all the redundant comments.

* Build passes.

* Build passes. Now the default remote logic follows git's behavior:

1. Check `remote.pushDefault` config first (user's explicit preference)
2. Fall back to "origin" if it exists (git's convention from `git clone`)
3. Fall back to first remote if no "origin"
4. Default to "origin" if no remotes exist

* I've fixed the bug in `check_remote_branch_exists` at `git.rs:1454-1484`. The issue was that when checking if a remote branch exists, the function was:

1. Using `default_remote_name()` (which returns "origin") to strip the prefix from branch names like `upstream/main`
2. Looking up the URL from the default remote instead of the actual remote the branch belongs to

Now the function:
1. For remote branches (like `upstream/main`), extracts the actual remote name from the branch using `get_remote_name_from_branch_name()`
2. Strips the correct prefix (`upstream/` not `origin/`)
3. Uses the correct remote's URL for the `git ls-remote` check

This allows fork workflows where you select `upstream/main` as the target branch - it will now correctly check if `main` exists on the `upstream` remote's URL.

* Cleanup script changes for workspace a07fdbcf-0608-4a84-a012-53d4fee6d115

* Fix cross-fork PR creation by formatting head branch with fork owner

When creating a PR from a fork to upstream, GitHub requires the head branch
to be formatted as "owner:branch" (e.g., "LSRCT:vk/feature-branch").
Added head_repo_url to CreatePrRequest and updated GitHubProvider to
compare owners and prefix the head branch accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Refactor PR remote handling: simplify by moving logic to caller

- Delete check_remote_branch_exists() from GitService (caller now composes
  the check directly using GitCli)
- Add default_remote_name_for_path() convenience method
- Rewrite pr.rs remote handling to be explicit and linear:
  1. Get push_remote and target_remote names
  2. Get their URLs
  3. Strip prefix to get base_branch
  4. Check, push, create PR

The string split happens once, visibly at the call site.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove origin preference in default_remote_name

Use first available remote instead of preferring "origin". The fallback
to "origin" only applies when there are no remotes configured at all.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix PR creation when target branch not fetched locally

When the target branch doesn't exist as a local remote-tracking ref
(e.g., user types a branch name that exists on remote but isn't fetched),
fall back to using the push remote instead of failing with BranchNotFound.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Reject cross-fork PRs for Azure DevOps

Azure DevOps fork PRs require different handling (--fork-id parameter).
Return a clear error instead of silently failing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove get_repo_info, always use explicit URL

The parameterless get_repo_info relied on gh CLI guessing the repo from
local git config. This is wrong for fork workflows where we need to
operate on a specific remote's repo. Now list_prs_for_branch and
get_pr_comments use the remote_url they're passed instead of ignoring it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Format git service default remote helper

* Fix clippy collapsible-if warnings

* Route remote branch checks through git service

* Remove Azure PR comment

* Consolidate git remote helpers

* Consolidate git remote resolution helpers

* Remove unnecessary comments

* Fix git service error match for remote check

* Remove unused GitCli::default_remote_name

GitService::default_remote_name (using git2) is used instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Refactor unused vars

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:46:43 +00:00
Daniel Ehrhardt
0ccb1ecd0a feat: added Google Antigravity (#1726)
* feat: added Google Antigravity

* Update types.ts

* Update IdeIcon.tsx
2026-01-14 12:13:21 +00:00
GitHub Action
c861de8b29 chore: bump version to 0.0.152 2026-01-14 11:12:48 +00:00
William Reed
4a48233cff perf: fix database query performance bottlenecks (#1982)
* perf: fix database query performance bottlenecks

- Add composite index on workspace_repos(workspace_id, repo_id) to optimize lookup queries that were taking up to 5 seconds
- Add composite index on merges(merge_type, pr_status) to optimize status filtering queries that were taking 2+ seconds
- Fix N+1 query pattern in workspace_repos.create_many by wrapping inserts in a transaction
- Fix N+1 query pattern in get_task_attempt_branch_status by batch fetching all merges upfront instead of querying per repo

These changes address significant performance bottlenecks identified in production logs where simple lookup queries were experiencing multi-second latencies.

* cargo fmt

* run sqlx prepare

---------

Co-authored-by: Solomon <abcpro11051@disroot.org>
2026-01-14 11:04:22 +00:00
Yang Feng
3ea8bf1e45 fix(services): support git worktree repo paths (#2015)
* fix(services): support git worktree repo paths

* inline tests

* remove reduntant else

---------

Co-authored-by: pengyujie <pengyujie@nbbsw.com>
Co-authored-by: Alex Netsch <alex@bloop.ai>
2026-01-14 09:46:30 +00:00
GitHub Action
d17c41a73d chore: bump version to 0.0.151 2026-01-13 18:32:23 +00:00
Gabriel Gordon-Hall
8244308835 fix compile error (#2019) 2026-01-13 18:30:41 +00:00
Alex Netsch
08a466c1d4 Fix VSCode extension by restoring /containers/info endpoint (Vibe Kanban) (#1884)
* The code compiles. The fix is complete. Here's a summary of what was changed:

**File: `crates/server/src/routes/containers.rs`**

1. Added `use uuid::Uuid;` import
2. Added `ContainerInfo` struct with `project_id`, `task_id`, and `attempt_id` fields
3. Added `get_container_info` handler that resolves the container reference and maps `workspace_id` → `attempt_id` for VSCode extension compatibility
4. Registered the `/containers/info` route

The VSCode extension can now call `GET /api/containers/info?ref={folder_path}` to auto-detect workspaces when opening a folder.

* Moved the doc comment to the route registration where it's more visible.

* Everything compiles. Let me summarize the logic:

**How the fix works:**

| Scenario | `container_ref` in DB | Path VSCode opens | Lookup method |
|----------|----------------------|-------------------|---------------|
| Multi-repo | `/workspaces/abc123` | `/workspaces/abc123` | Exact match ✓ |
| Single-repo | `/workspaces/abc123` | `/workspaces/abc123/my-repo` | Prefix match ✓ |

The `resolve_container_ref_by_prefix` method:
1. First tries exact match (handles multi-repo case)
2. Falls back to prefix match using SQLite GLOB: `path GLOB container_ref || '/*'` (handles single-repo case where path is a subfolder)

This should handle both cases correctly. The confidence is higher now because we've accounted for how "Open in IDE" behaves differently based on repo count.

* Everything compiles. Now the query handles both:
- Unix paths: `/workspaces/abc123/repo-name` matches `/workspaces/abc123` via `/*`
- Windows paths: `C:\workspaces\abc123\repo-name` matches `C:\workspaces\abc123` via `\*`

* Use std::path for cross-platform parent directory lookup

Instead of doing path prefix matching in SQL (which doesn't handle
Windows backslashes), we now:
1. Try exact match on the path
2. If not found, try the parent directory (handles single-repo case)

This uses std::path::Path::parent() which handles path separators
correctly on all platforms.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 18:13:05 +00:00
Gabriel Gordon-Hall
7bc8ece068 workspace file search (#2002) 2026-01-13 18:01:33 +00:00
Louis Knight-Webb
82a4e0fccf Workspace onboarding (#2013)
* cleanup navbar

* re-enable dev server from command bar

* Add the ability to open the command bar from the `NavbarContainer.tsx` : (vibe-kanban 58189151)

- dots-three-outline icon
- position next to settings

`vibe-kanban/frontend/src/components/ui-new/containers/NavbarContainer.tsx`

* `NavbarContainer.tsx` button to go back to old UI should navigate back to task rather than attempt (vibe-kanban 2b6f4c76)

`index.ts` 

`vibe-kanban/frontend/src/components/ui-new/containers/NavbarContainer.tsx`

`vibe-kanban/frontend/src/components/ui-new/actions/index.ts`

* Add new setting: beta\_workspaces, and beta\_workspaces\_invitation\_sent (vibe-kanban e2e73cb9)

- Stored in the `mod.rs`
- This defaults to 'false'
- If a user is considered an active user (they have created more than 50 task attempts), they should be proactively invited to join the beta of workspaces
- The invite will be displayed as dialog in the old UI, triggered when the user opens the `TaskAttemptPanel.tsx`
- The setting can be changed later in the `GeneralSettings.tsx` , right at the bottom in a section for beta features
- When the user has beta\_workspaces set to true:
- Previously when they open a task in the `TaskKanbanBoard.tsx` it would open a task attempt or task, now it will always open a task
- And when clicking on a task attempt in the `TaskPanel.tsx` it will open in the new workspaces view (/workspaces/[WORKSPACE\_ID])

`vibe-kanban/frontend/src/components/panels/TaskAttemptPanel.tsx`

`vibe-kanban/frontend/src/pages/settings/GeneralSettings.tsx`

`vibe-kanban/crates/services/src/services/config/mod.rs`

`vibe-kanban/frontend/src/components/tasks/TaskKanbanBoard.tsx`

`vibe-kanban/frontend/src/components/panels/TaskPanel.tsx`

* Introduce a way to give feedback (vibe-kanban 463fbf1d)

- Icon in `NavbarContainer.tsx` next to settings
- Also triggerable from command bar
- Using posthog client, already installed

`vibe-kanban/frontend/src/components/ui-new/containers/NavbarContainer.tsx`

* Create a new dialog that shows when users use workspaces (ui-new) for the first time. It should (vibe-kanban b0e8344a)

explain the features of workspaces. The component will consist of a popup with topics in a sidebar on the left and content (text and images) in a main section to the right. It does not use the existing Dialog component.

It is accessible by clicking a help icon in the `NavbarContainer.tsx`  and from the command bar via `pages.ts` 

Create the component and some seed content that I will edit:

1. Welcome to workspaces, here are some tips to get started
2. Use the command bar to navigate
3. Create workspaces in the sidebar, also view all your workspaces and the status of each here
4. Workspaces can be created with multiple repos
5. You can create multiple sessions for each workspace
6. Preview changes
7. View diffs, comment on them
8. If any any point you want to go back to the old UI, you can turn off workspaces in settings

`vibe-kanban/frontend/src/components/ui-new/containers/NavbarContainer.tsx`

`vibe-kanban/frontend/src/components/ui-new/actions/pages.ts`

* Update `WorkspacesGuideDialog.tsx` : (vibe-kanban b4c5d731)

- Make 600px height
- Add new section: Context Bar

> The context bar lets you switch between panes quickly. Drag it wherever works best for you.

`vibe-kanban/frontend/src/components/ui-new/dialogs/WorkspacesGuideDialog.tsx`

![Context Bar.png](.vibe-images/5adcf127-da1c-457a-9444-dc3c913c52f7.png)

* The `WorkspacesGuideDialog.tsx` appears every time I reload the page, it doesn't seem that we're (vibe-kanban 7fd9e0c8)

saving that the user has already seen it once and it should no longer be auto shown

`vibe-kanban/frontend/src/components/ui-new/dialogs/WorkspacesGuideDialog.tsx`

* Please run `check-i18n.sh` and fix the issue (vibe-kanban d3323397)

`vibe-kanban/scripts/check-i18n.sh`
2026-01-13 18:00:57 +00:00
Gabriel Gordon-Hall
cdfb081cf8 feat: copy-file autocomplete (#2004)
* add repo file search endpoint and use for copy-file autocomplete

* address feedback and fix i18n errors

* remove unused i18n
2026-01-13 17:34:54 +00:00
Solomon
5502a4cad6 bump claude code to v2.1 (#2005)
* bump claude code to v2.1

* fix unkown json
2026-01-13 16:52:44 +00:00
Alex Netsch
d27006be58 The fix compiles. The change is simple: when a worktree directory exists on disk but has no corresponding entry in .git/worktrees/, the function now returns Ok(false) (needs recreation) instead of throwing an error. This allows the recreation flow to clean up and properly reinitialize the worktree. (#2003) 2026-01-13 16:51:36 +00:00
Alex Netsch
5d84e0b2a1 The fix is complete. Here's a summary of the changes: (#1954)
Fixed gh CLI compatibility for older versions (e.g., v2.4.0) when creating pull requests.

**`crates/services/src/services/git_host/github/cli.rs`:**
- Added `repo_path: &Path` parameter to `create_pr()` method
- Added documentation explaining the compatibility requirement
- Changed `self.run(args, None)` to `self.run(args, Some(repo_path))` to execute the `gh pr create` command from within the git repository

**`crates/services/src/services/git_host/github/mod.rs`:**
- Threaded `repo_path` through the async closure to the CLI call
- Added `repo_path_buf` variable to convert the path reference to an owned `PathBuf` for the spawned blocking task

Older `gh` CLI versions (like v2.4.0 found on Ubuntu 22.04) require running `gh pr create` from within a git repository, even when the `--repo` flag is explicitly provided. By passing the `repo_path` as the working directory, the command now works correctly on all gh CLI versions.

Cleanup script changes for workspace 05a586e1-4195-4b66-b5ec-b626094910f8
2026-01-13 15:49:28 +00:00
Louis Knight-Webb
33419c95f7 Improve the preview functionality (vibe-kanban) (#2010)
* preview styles

* All tasks are complete. Let me provide a summary of the changes made:

## Summary

I've implemented the preview functionality improvements as requested:

### Changes Made

**1. Rust Types (`crates/db/src/models/scratch.rs`)**
- Renamed `PreviewUrlOverrideData` → `PreviewSettingsData`
- Added new fields: `screen_size`, `responsive_width`, `responsive_height`
- Updated `ScratchPayload` and `ScratchType` enum to use `PreviewSettings`

**2. New Hook (`frontend/src/hooks/usePreviewSettings.ts`)**
- Created new `usePreviewSettings` hook (replaced `usePreviewUrlOverride`)
- Manages both URL override and screen size settings
- Persists screen size via the scratch system (per-workspace)
- Exports `ScreenSize` and `ResponsiveDimensions` types

**3. PreviewBrowserContainer (`frontend/src/components/ui-new/containers/PreviewBrowserContainer.tsx`)**
- Added URL controls (input, copy, open in new tab, refresh, clear override)
- Added stop button and related handlers
- Added screen size state management
- Added responsive dimensions resize handlers

**4. PreviewBrowser View (`frontend/src/components/ui-new/views/PreviewBrowser.tsx`)**
- Added floating toolbar above the iframe with:
  - URL input with action buttons
  - Screen size toggle (Desktop/Mobile/Responsive icons)
  - Dimensions display for responsive mode
  - Stop button
- Implemented three screen modes:
  - **Desktop**: Full width/height (current behavior)
  - **Mobile**: 390×844px centered with shadow
  - **Responsive**: Draggable resize handles on right, bottom, and corner edges

**5. PreviewControls View (`frontend/src/components/ui-new/views/PreviewControls.tsx`)**
- Simplified to show only logs
- Removed URL input row and all control buttons
- Renamed section header to "Dev Server Logs"

**6. PreviewControlsContainer (`frontend/src/components/ui-new/containers/PreviewControlsContainer.tsx`)**
- Removed all URL-related state and handlers
- Now only manages logs display and process tab switching

All type checks pass. The screen size preference is persisted per-workspace using the existing scratch system.

* Cleanup script changes for workspace dd65dbe3-2e31-4897-8aa4-b2f8f7971ab7

* All ESLint and TypeScript checks pass. The implementation is complete.

## Summary of Changes

**Files Modified:**

1. **`crates/db/src/models/scratch.rs`** - Renamed `PreviewUrlOverrideData` → `PreviewSettingsData` with new fields for screen size persistence

2. **`crates/server/src/bin/generate_types.rs`** - Updated type export to use new name

3. **`shared/types.ts`** - Regenerated with new types (`PreviewSettingsData`, `ScratchType.PREVIEW_SETTINGS`)

4. **`frontend/src/hooks/usePreviewSettings.ts`** (new) - Replaces `usePreviewUrlOverride.ts`, adds screen size management

5. **`frontend/src/hooks/usePreviewUrlOverride.ts`** - Deleted

6. **`frontend/src/components/ui-new/containers/PreviewBrowserContainer.tsx`** - Added URL controls, stop button, and resize state management

7. **`frontend/src/components/ui-new/views/PreviewBrowser.tsx`** - Added floating toolbar with:
   - URL input with copy/open/refresh/clear buttons
   - Screen size toggle (Desktop/Mobile/Responsive icons)
   - Responsive resize handles
   - Stop button

8. **`frontend/src/components/ui-new/containers/PreviewControlsContainer.tsx`** - Simplified to logs only

9. **`frontend/src/components/ui-new/views/PreviewControls.tsx`** - Simplified to logs only

* Cleanup script changes for workspace dd65dbe3-2e31-4897-8aa4-b2f8f7971ab7

* All checks pass. Here's a summary of the changes made:

## Summary of Changes

### 1. Fixed infinite loop bug (`usePreviewSettings.ts`)
- Added `useMemo` to stabilize the `responsiveDimensions` object reference
- This prevents the useEffect in the container from re-triggering on every render

### 2. Updated toolbar to always show with floating style (`PreviewBrowser.tsx`)
- Toolbar is now always visible (not conditional on `isServerRunning && hasUrl`)
- Changed styling from `border-b border-border` to `rounded-md shadow-md m-base` for a floating appearance
- URL input and action buttons are disabled (with `opacity-50 cursor-not-allowed`) when no URL is available
- Start/Stop button in toolbar changes based on server state:
  - Shows "Start" button when server is not running
  - Shows "Stop" button when server is running
- Simplified the empty state content area to just show a message pointing to the toolbar's Start button

* All checks pass. The fix:

1. **Changed from state to refs** for `isResizing` and `resizeDirection` - these now don't trigger re-renders when they change
2. **Added `localDimensionsRef`** to capture the current dimensions for the `handleEnd` callback without adding it to the effect's dependency array
3. **Effect now only depends on `setResponsiveDimensions`** (a stable callback), so event listeners are registered once on mount and cleaned up on unmount
4. **No more race conditions** - the same event handlers persist throughout the entire drag operation

The resize should now:
- Stop immediately when you release the mouse
- Be smooth without choppiness (no effect re-runs during drag)

* The responsive resize fix is complete. Here's a summary of the changes made:

**In `PreviewBrowserContainer.tsx`:**
1. Added `isResizing` state to track when resizing is active (for UI purposes)
2. Added `setResponsiveDimensionsRef` to store the callback in a ref, preventing the resize effect from re-running when the callback identity changes
3. Changed the resize effect to use an empty dependency array (`[]`) since all external values are now accessed via refs
4. Updated `handleResizeStart` to set `isResizing(true)`
5. Updated `handleEnd` to set `isResizing(false)` and use `setResponsiveDimensionsRef.current`
6. Passed `isResizing` prop to the `PreviewBrowser` view

**In `PreviewBrowser.tsx`:**
1. Added `isResizing` prop to the interface and destructured it
2. Applied `pointer-events-none` class to the iframe when `isResizing` is true - this prevents the iframe from capturing mouse events during resize, ensuring smooth dragging

These changes fix both issues:
- **Resize not stopping**: The effect no longer re-registers listeners when `setResponsiveDimensions` changes
- **Choppy dragging**: The iframe no longer captures mouse events during resize

* All checks pass. The fix is complete. The resize now uses delta-based calculation:

1. **`startPosRef`**: Captures the mouse position when resize starts
2. **`startDimensionsRef`**: Captures the iframe dimensions when resize starts
3. **`handleMove`**: Calculates delta (current position - start position) and applies it to the starting dimensions
4. **`handleEnd`**: Clears both refs when resize ends

This approach works regardless of where the iframe is positioned in the container, fixing both:
- The mouse jump offset (no longer tries to position based on container edge)
- The 50% distance issue (delta is 1:1 with mouse movement)

* Cleanup script changes for workspace dd65dbe3-2e31-4897-8aa4-b2f8f7971ab7

* Done. The resize should now move at 1:1 with the cursor. Since the centered element grows on both sides equally, doubling the delta ensures the edge under the cursor moves the full distance you drag.

* Done! I've added a minimal dark phone frame around the iframe when in mobile mode. The changes:

- **Mobile mode** now wraps the iframe in a phone skeleton with:
  - Dark bezel (`bg-gray-900`)
  - Rounded outer corners (`rounded-[3rem]`)
  - Padding for bezel width (`p-3`)
  - Shadow (`shadow-xl`)
  - Rounded inner screen area (`rounded-[2.5rem]`)

- **Desktop and responsive modes** remain unchanged

You can test it by running `pnpm run dev:qa` and switching to mobile view in the preview browser.

* styles

* I've completed the implementation. Here's a summary of the changes:

## Summary

Created two new reusable button components and updated PreviewBrowser.tsx to standardize button styles:

### New Components

1. **`IconButton.tsx`** (`frontend/src/components/ui-new/primitives/IconButton.tsx`)
   - Standalone icon button with consistent styling
   - Supports `default` and `tertiary` variants
   - Includes proper hover states (`bg-secondary/50`), disabled states, and transitions

2. **`IconButtonGroup.tsx`** (`frontend/src/components/ui-new/primitives/IconButtonGroup.tsx`)
   - Container component for grouped icon buttons with shared border
   - `IconButtonGroupItem` for individual buttons with `active` state support
   - Consistent styling with border, padding, and hover/active states

### Updated PreviewBrowser.tsx

- **URL action buttons** (Clear, Copy, Open in new tab, Refresh): Now use `IconButton` component with consistent hover backgrounds
- **Screen size toggle** (Desktop, Mobile, Responsive): Now uses `IconButtonGroup` and `IconButtonGroupItem` with proper active state styling
- **Start/Stop button**: Kept using `PrimaryButton` (already consistent)

### Visual Consistency Achieved

All toolbar buttons now share:
- Consistent padding (`p-half`)
- Consistent hover states (`bg-secondary/50` background)
- Consistent active states (`bg-secondary` background) for toggles
- Consistent disabled states (`opacity-40 cursor-not-allowed`)
- Consistent icon sizing (`size-icon-sm`) with `weight="bold"`
- Consistent border radius (`rounded-sm`)

* Done. The URL action buttons (Copy, Open in new tab, Refresh) are now grouped in an `IconButtonGroup` with a shared border, matching the visual style of the screen size toggle group.

The toolbar now has three visually consistent button groups:
1. **URL input** with optional clear override button
2. **URL actions group** (Copy, Open in new tab, Refresh) - bordered group
3. **Screen size toggle group** (Desktop, Mobile, Responsive) - bordered group
4. **Start/Stop button** (PrimaryButton)

* Done. All changes have been implemented:

1. **Added `iconClassName` prop to `IconButtonGroupItem`** - Supports passing custom classes to the icon (e.g., `animate-spin` for the spinner)

2. **Moved Clear button into URL Actions group** - The Clear Override button (X icon) is now inside the `IconButtonGroup` with Copy, Open, and Refresh buttons

3. **Replaced Pause button with `IconButtonGroupItem`** - The stop/pause button now uses the same `IconButtonGroup` styling as the other toolbar buttons, with spinner animation support when stopping

The toolbar now has consistent visual styling with three button groups:
- **URL Actions**: Clear (conditional), Copy, Open in new tab, Refresh
- **Screen Size Toggle**: Desktop, Mobile, Responsive
- **Stop button**: Pause icon (when server is running)
- **Start button**: Kept as `PrimaryButton` since it has a text label

* Cleanup script changes for workspace dd65dbe3-2e31-4897-8aa4-b2f8f7971ab7

* Done. The Start/Stop button is now a single `IconButtonGroup` with one `IconButtonGroupItem` that:
- Shows Play icon when server is stopped, Pause icon when running
- Shows Spinner icon with animation when starting or stopping
- Has the same size as all other toolbar button groups

* Cleanup script changes for workspace dd65dbe3-2e31-4897-8aa4-b2f8f7971ab7

* Done. Fixed the spinning Play icon bug by making the `iconClassName` logic match the icon selection logic exactly. Now `animate-spin` is only applied when actually showing the `SpinnerIcon`.

* Done. The entire toolbar (URL input, URL actions, screen size toggle) is now disabled when the dev server isn't running. Only the Play/Start button remains enabled so users can start the server.

* The changes compile correctly. Here's a summary of what was fixed:

## Summary

Fixed the "Fix Script" button showing at the wrong time in `PreviewBrowser.tsx`.

**Changes made:**

1. **`PreviewBrowser.tsx`** - Added `hasFailedDevServer?: boolean` prop and updated the condition on line 345 from `{handleFixDevScript && (` to `{hasFailedDevServer && handleFixDevScript && (`

2. **`PreviewBrowserContainer.tsx`** - Added failed dev server detection logic (lines 45-51) that checks for processes with `status === 'failed'` or `status === 'completed'` with non-zero exit code, and passed the `hasFailedDevServer` prop to the view

The "Fix Script" button will now only appear when the last dev server process actually failed, not when it was successful or killed.

* update styles

* All tasks completed. Here's a summary of the changes made:

## Summary

### 1. `IconButtonGroup.tsx` (lines 3, 50-65)
- Added import for `Tooltip` component
- Modified `IconButtonGroupItem` to wrap buttons with `<Tooltip>` when `title` prop is provided
- Removed native `title` attribute from button (tooltip handles it now)

### 2. `en/tasks.json` (lines 125-134)
Added new i18n keys under `preview.toolbar`:
- `clearUrlOverride`: "Clear URL override"
- `desktopView`: "Desktop view"
- `mobileView`: "Mobile view (390x844)"
- `responsiveView`: "Responsive view (resizable)"
- `startDevServer`: "Start dev server"

Added new `preview.loading` section:
- `startingServer`: "Starting dev server..."
- `waitingForServer`: "Waiting for server..."

### 3. `PreviewBrowser.tsx` (lines 160-254, 342-344)
Replaced all hardcoded strings with i18n translations using `t()`:
- URL action buttons (clear override, copy, open in tab, refresh)
- Screen size toggle buttons (desktop, mobile, responsive)
- Start/stop server button
- Loading state messages

All icon buttons now have proper accessible tooltips via the `Tooltip` component instead of native browser `title` attributes, and all strings are internationalized.

* style

* All i18n issues have been fixed. Here's a summary of the changes made:

**1. Added missing translation keys to all non-English locales (es, ja, ko, zh-Hans, zh-Hant):**
- `preview.loading.startingServer`
- `preview.loading.waitingForServer`
- `preview.toolbar.clearUrlOverride`
- `preview.toolbar.desktopView`
- `preview.toolbar.mobileView`
- `preview.toolbar.responsiveView`
- `preview.toolbar.startDevServer`

**2. Fixed hardcoded strings in `PreviewBrowser.tsx`:**
- Replaced dimension separator `x` with HTML entity `&times;`
- Internationalized the "no dev script" setup message with 3 new i18n keys:
  - `preview.noServer.setupTitle`
  - `preview.noServer.editDevScript`
  - `preview.noServer.learnMore`

**3. Added the 3 new keys to all locale files (en, es, ja, ko, zh-Hans, zh-Hant)**

The `check-i18n.sh` script now passes with:
- 128 violations (down from 131 on main - a net improvement!)
- No duplicate keys
- Translation keys consistent across all locales
2026-01-13 14:55:57 +00:00
T Savo
34e1b688b1 Support CODEX_HOME environment variable (#1755)
* fix: run gh pr create from repo directory for old CLI compatibility

Older versions of the GitHub CLI (e.g., v2.4.0 on Ubuntu 22.04) require
running inside a git repository even when --repo is specified. This
change adds a repo_path parameter to create_pr that sets the working
directory when invoking gh, ensuring compatibility with older versions.

Changes:
- Add run_in_dir helper to GhCli for running commands in a specific directory
- Update create_pr to accept optional repo_path parameter
- Pass repo_path from the PR creation route where it's already available

Fixes #1665

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: address review comments

- Remove redundant repo_path clone (use repo_path.clone() directly in closure)
- Use worktree_path instead of repo_path for gh pr create (consistent with git push)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Support CODEX_HOME environment variable for custom config location

Add a `codex_home()` helper function that checks the CODEX_HOME
environment variable first, then falls back to ~/.codex. This allows
users who have configured a custom Codex home directory to use
vibe-kanban without issues.

Fixes:
- Follow-up sessions not finding rollout files when CODEX_HOME is set
- MCP config not being detected from custom location
- Auth and installation detection checking wrong paths

Includes unit tests and documentation for the new feature.

Closes #1648

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Revert "fix: address review comments"

This reverts commit 44986bc6818f946834e5d4fe2196e1e06397c424.

* Revert "fix: run gh pr create from repo directory for old CLI compatibility"

This reverts commit b9e54e3c09b1ca86bc3624961c36880f58a8943f.

* address review feedback

* remove tests

---------

Co-authored-by: T Savo <tsavo@nightfall.ai>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Solomon <abcpro11051@disroot.org>
2026-01-13 12:15:28 +00:00
Gabriel Gordon-Hall
57e802e2c9 per-repo diff stats (#1961) 2026-01-13 09:32:16 +00:00
Louis Knight-Webb
4a0fad03c2 Display GitHub PR comments inline in diff view (Vibe Kanban) (#1991)
* The GitHub comments integration is now complete. Here's a summary of what was implemented:

## Summary

The GitHub PR comments integration for the new UI (ui-new) is now complete. All tasks have been implemented:

### Files Modified:
1. **`useUiPreferencesStore.ts`** - Added persistence key for `showGitHubComments` toggle
2. **`WorkspaceContext.tsx`** - Extended with PR comments data, helpers (`getGitHubCommentsForFile`, `gitHubFileCommentCounts`), and toggle state
3. **`CommentCard.tsx`** (new) - Shared primitive for displaying comments with three variants: `user`, `github`, `input`
4. **`GitHubCommentRenderer.tsx`** (new) - Read-only renderer for GitHub comments with GitHub logo, author, timestamp, and external link
5. **`ReviewCommentRenderer.tsx`** - Refactored to use `CommentCard` primitive
6. **`CommentWidgetLine.tsx`** - Refactored to use `CommentCard` primitive
7. **`DiffViewCardWithComments.tsx`** - Integrated GitHub comments into diff view, showing both user and GitHub comments with separate counts in the header
8. **`FileTreeNode.tsx`** - Added GitHub comment badge showing count next to files
9. **`FileTree.tsx`** - Added toggle button in header to show/hide GitHub comments
10. **`FileTreeContainer.tsx`** - Wired up the context to pass toggle state and comment counts to FileTree
11. **`common.json`** (i18n) - Added translation keys for show/hide GitHub comments

### Features:
- GitHub PR comments displayed inline next to relevant code in diff views
- Toggle button in file tree to show/hide GitHub comments (persisted)
- Comment count badges on files in the file tree
- Visual differentiation: user comments have orange styling (`bg-brand/20 border-brand`), GitHub comments have neutral styling (`bg-secondary border-border`)
- User comments take priority when both exist on the same line

* Cleanup script changes for workspace 881e2956-9cca-406d-835f-7ea8acbe550e

* All checks pass. Let me show a summary of the changes made:

## Summary of Fixes

All code review feedback has been addressed:

| # | Fix | File | Change |
|---|-----|------|--------|
| 1 | Date parsing | `GitHubCommentRenderer.tsx:9-27` | Replaced `try/catch` with `isNaN(date.getTime())` check |
| 2 | Comment priority | `DiffViewCardWithComments.tsx:258-260` | Added comment explaining user comments take priority |
| 3 | SplitSide.new | `WorkspaceContext.tsx:163-165` | Added comment explaining why `SplitSide.new` is correct |
| 4 | Multi-repo TODO | `WorkspaceContext.tsx:133-134` | Added TODO about supporting multiple repos |
| 5 | Loading state | `FileTreeContainer.tsx`, `FileTree.tsx` | Passed `isGitHubCommentsLoading` prop and added `opacity-50 animate-pulse` to button |

Type checks pass. Ready for commit.

* Fixed! The `FileTree.tsx` now uses the correct `Tooltip` component from `@/components/ui-new/primitives/Tooltip` instead of the old `@/components/ui/tooltip`.

Changes made:
- Updated import to use `import { Tooltip } from '../primitives/Tooltip'`
- Simplified the tooltip usage from the compound component pattern (`Tooltip` + `TooltipTrigger` + `TooltipContent`) to the simpler API (`<Tooltip content="...">...</Tooltip>`)

* The path matching bug has been fixed. Here's a summary of the changes:

## Summary of Bug Fix

**Problem**: GitHub comments weren't displaying because paths didn't match.
- GitHub API returns paths like: `frontend/src/components/ui-new/actions/index.ts`
- Diff paths are prefixed with repo name: `vibe-kanban/frontend/src/components/ui-new/actions/index.ts`

**Solution**: Use `endsWith` matching instead of exact string equality.

### Files Changed:

1. **`WorkspaceContext.tsx`**:
   - Added `pathMatches` helper function that checks if paths match using `endsWith`
   - Updated `getGitHubCommentsForFile` to use `pathMatches`
   - Replaced `gitHubFileCommentCounts: Record<string, number>` with `getGitHubCommentCountForFile: (filePath: string) => number` function that also uses `pathMatches`

2. **`FileTree.tsx`**:
   - Changed prop from `fileCommentCounts?: Record<string, number>` to `getGitHubCommentCountForFile?: (filePath: string) => number`
   - Updated usage from `fileCommentCounts?.[node.path]` to `getGitHubCommentCountForFile?.(node.path)`

3. **`FileTreeContainer.tsx`**:
   - Updated to pass the new `getGitHubCommentCountForFile` function instead of `gitHubFileCommentCounts` Record

* Cleanup script changes for workspace 881e2956-9cca-406d-835f-7ea8acbe550e

* Fixed! The `renderExtendLine` function now includes a null check for `lineData.data` to prevent the TypeError when switching diff modes. The fix adds:

```typescript
// Guard against undefined data (can happen when switching diff modes)
if (!lineData.data) return null;
```

This prevents the crash when the `@git-diff-view` library passes undefined data during mode transitions.

* Done! GitHub comments will now be shown by default. The change was a simple one-liner in `WorkspaceContext.tsx`:

```typescript
// Before:
false // Default to hidden

// After:
true // Default to shown
```

* The proper fix is complete. Here's a summary of the changes:

## Summary: Comments on deleted lines fix

**Problem**: GitHub comments on deleted lines weren't showing because we were placing all comments on `SplitSide.new`.

**Solution**: Pass through the `side` field from GitHub's API which indicates whether the comment is on the "LEFT" (old/deleted) or "RIGHT" (new/added) side.

### Files Changed:

1. **`crates/services/src/services/git_host/types.rs`**
   - Added `side: Option<String>` field to `UnifiedPrComment::Review` variant

2. **`crates/services/src/services/git_host/github/mod.rs`**
   - Pass `c.side` through when creating `UnifiedPrComment::Review`

3. **`crates/services/src/services/git_host/azure/cli.rs`**
   - Added `side: None` to Azure DevOps (doesn't have this info)

4. **`shared/types.ts`** (regenerated)
   - Now includes `side: string | null` in the review comment type

5. **`frontend/src/contexts/WorkspaceContext.tsx`**
   - Updated normalization to use `comment.side === 'LEFT' ? SplitSide.old : SplitSide.new`

6. **`frontend/src/components/ui-new/containers/DiffViewCardWithComments.tsx`**
   - Updated `extendData` building to place GitHub comments on the correct side (`oldFileData` or `newFileData`) based on `comment.side`

* The refactoring is complete. Here's a summary of the changes:

**Created new file:** `frontend/src/hooks/useGitHubComments.ts`
- Contains the `NormalizedGitHubComment` interface
- Contains all GitHub comments logic: fetching, toggle state, normalization, path matching helpers

**Updated:** `frontend/src/contexts/WorkspaceContext.tsx`
- Removed ~70 lines of GitHub comments logic
- Now imports and uses `useGitHubComments` hook
- Re-exports `NormalizedGitHubComment` type for consumers that import it from the context

The context file is now smaller and more focused on workspace management, while the GitHub comments functionality is encapsulated in its own dedicated hook.

* Cleanup script changes for workspace 881e2956-9cca-406d-835f-7ea8acbe550e

* Done. Removed the duplicate `formatRelativeTime` function from `GitHubCommentRenderer.tsx` and replaced it with an import from the existing `@/utils/date` utility.

* The i18n check now passes. All translation keys are consistent across locales. I added the missing `showGitHubComments` and `hideGitHubComments` translations to:
- Spanish (es)
- Japanese (ja)
- Korean (ko)
- Simplified Chinese (zh-Hans)
- Traditional Chinese (zh-Hant)
2026-01-12 23:47:53 +00:00
Louis Knight-Webb
c7cf72a57f Allow manual URL override in dev server preview (Vibe Kanban) (#1989)
* The implementation is complete and tested. Here's a summary of the changes made:

I've implemented an editable URL bar in the Preview Controls that allows users to override the auto-detected dev server URL on a per-workspace basis.

| File | Changes |
|------|---------|
| `crates/db/src/models/scratch.rs` | Added `PreviewUrlOverrideData` struct and `PreviewUrlOverride` variant to `ScratchPayload` enum |
| `crates/server/src/bin/generate_types.rs` | Registered `PreviewUrlOverrideData::decl()` for TypeScript type generation |
| `shared/types.ts` | Auto-generated with new `PreviewUrlOverrideData` type and updated `ScratchPayload` union |
| `frontend/src/hooks/usePreviewUrlOverride.ts` | **New file** - Custom hook for managing URL override persistence via scratch system |
| `frontend/src/components/ui-new/containers/PreviewControlsContainer.tsx` | Added URL override hook integration, merged auto-detected with override URL |
| `frontend/src/components/ui-new/views/PreviewControls.tsx` | Replaced static `<span>` with editable `<input>`, added clear override button (X icon) |

- **Editable URL bar**: Users can type a custom URL to override the auto-detected one
- **Per-workspace persistence**: Override URL saved in the scratch system using workspace ID
- **Debounced saves**: Changes are debounced (300ms) before saving to avoid excessive API calls
- **Clear override button**: X button appears when override is active, allowing revert to auto-detected URL
- **Visual distinction**: Override URLs show in normal text color, auto-detected in dim text

* Cleanup script changes for workspace 3f3c315d-5cc2-43b0-9043-117c857f38b4

* The URL input fix is complete. Here's a summary of what was implemented:

**Feature: Editable URL bar with per-workspace persistence**

1. **New scratch type** - Added `PreviewUrlOverride` to the Rust scratch system for persisting URL overrides per workspace

2. **New hook** - Created `usePreviewUrlOverride.ts` that wraps the scratch system with debounced saves (300ms delay)

3. **Container integration** - Updated `PreviewControlsContainer.tsx` to use the override URL when set, falling back to auto-detected URL

4. **View updates** - Updated `PreviewControls.tsx` with:
   - Editable input field instead of read-only display
   - Clear button (X icon) to revert to auto-detected URL
   - Local state management to prevent WebSocket updates from disrupting typing

**Bug fix for typing issue:**
- Added local state (`localValue`) and ref (`inputRef`) to track input value locally
- The effect only syncs from server when input is not focused, preventing cursor jumping and character loss during typing

* ESLint and Clippy both pass now. The fix moved the state management from the presentational view component (`PreviewControls.tsx`) to the container component (`PreviewControlsContainer.tsx`), which aligns with the codebase's architecture pattern of keeping views stateless.

* I can see projects now. Let me click on the first project to access a workspace where I can test the URL override feature:

* TypeScript check passes now. The fix was changing `RefObject<HTMLInputElement | null>` to `RefObject<HTMLInputElement>` in the props interface - the `null` is already implied in how React refs work.
2026-01-12 23:36:15 +00:00
GitHub Action
6d5c8ac486 chore: bump version to 0.0.150 2026-01-12 21:53:09 +00:00
Alex Netsch
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.
2026-01-12 19:28:55 +00:00
Solomon
ddb92351f5 update cursor-agent models (#1977) 2026-01-12 17:37:24 +00:00
GitHub Action
2c474d689c chore: bump version to 0.0.149 2026-01-12 16:57:54 +00:00
Jacek Tomaszewski
db2df1540c feat(notifications): include task name in approval needed notification (#1879)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 13:49:11 +00:00
Alex Netsch
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`.
2026-01-12 12:38:22 +00:00
Louis Knight-Webb
60174486b2 Fix comparison between EP and Workspace during cleanup (#1959) 2026-01-12 12:09:11 +00:00
Louis Knight-Webb
61190a34d3 Add accelerated 1-hour cleanup for archived workspaces or inactive tasks (Vibe Kanban) (#1952)
* The implementation is complete. Here's a summary of the changes:

## Summary

Modified `crates/db/src/models/workspace.rs` in the `find_expired_for_cleanup()` function:

1. **Added task join** - `JOIN tasks t ON w.task_id = t.id` to access the task's status

2. **Conditional expiration threshold** in the `HAVING` clause:
   - **1 hour** if workspace is archived AND task status is NOT `inprogress` or `inreview`
   - **72 hours** otherwise (preserves existing behavior)

```sql
HAVING datetime('now',
    CASE
        WHEN w.archived = 1 AND t.status NOT IN ('inprogress', 'inreview')
        THEN '-1 hours'
        ELSE '-72 hours'
    END
) > datetime(...)
```

This means archived workspaces for completed/cancelled/todo tasks will be cleaned up much faster (1 hour vs 72 hours), while active work remains protected.

* Done! I've:

1. **Fixed the condition** from `AND` to `OR` in `crates/db/src/models/workspace.rs:350`
2. **Updated the doc comment** to reflect the correct logic
3. **Regenerated the SQLx cache** with `pnpm run prepare-db`
4. **Updated the PR** with the corrected title and description

The accelerated cleanup now triggers when:
- The workspace is archived (regardless of task status), **OR**
- The task is not actively being worked on (todo/done/cancelled)
2026-01-12 11:33:32 +00:00
Louis Knight-Webb
f30606b48a Fix gh CLI compatibility for older versions missing baseRefOid field
**Changes:**
1. Added `GhApiPr` and `GhApiRef` structs (lines 31-46) to deserialize the GitHub REST API response
2. Added `get_pr_info_via_api()` function (lines 103-141) as a fallback that uses `gh api repos/{owner}/{repo}/pulls/{number}`
3. Modified `get_pr_info()` (lines 166-170) to detect "unknown json field" errors and fall back to the API method

**How it works:**
- Modern `gh` CLI versions continue to use the faster `gh pr view --json` approach
- When an older `gh` CLI returns "Unknown JSON field: baseRefOid", the code catches this error and falls back to `gh api` which uses the stable REST API
- The REST API fields (`base.sha`, `head.sha`, `head.ref`) have been stable for years and work with all `gh` CLI versions
2026-01-12 10:14:34 +00:00
Gabriel Gordon-Hall
8fa5b9d098 feat: remove agent_working_dir from settings (#1874)
* remove configurable agent_working_dir

(cherry picked from commit 285b3e04abceeb8e4a4ee1be16e3de97a8f32299)

* calculate agent_working_dir on create and start task

* i18n
2026-01-12 09:14:48 +00:00
Louis Knight-Webb
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
2026-01-11 15:39:07 +00:00
Louis Knight-Webb
7ba1867a8f The change compiles successfully. Here's a summary of what I did: (#1930)
## Summary

Increased the workspace name length from 35 to 60 characters in `vibe-kanban/crates/db/src/models/workspace.rs`:

1. Added a constant at the top of the file:
   ```rust
   const WORKSPACE_NAME_MAX_LEN: usize = 60;
   ```

2. Updated both occurrences where the hardcoded `35` was used:
   - Line 586 in `find_all_with_status`
   - Line 673 in `find_by_id_with_status`

Both now use `WORKSPACE_NAME_MAX_LEN` instead of the hardcoded value, making future adjustments easier.
2026-01-11 10:50:41 +00:00