Fix session executor storage to only store base executor name (Vibe Kanban) (#1621)

* The code compiles successfully. Let me provide a summary of what was done:

## Summary

I've implemented the fix for the session executor storage format issue:

### Changes Made

1. **`crates/services/src/services/container.rs` (line 912)**
   - Changed `executor_profile_id.to_string()` to `executor_profile_id.executor.to_string()`
   - This now stores only the base executor name (e.g., `"CLAUDE_CODE"`) instead of the full format with variant (e.g., `"CLAUDE_CODE:ROUTER"`)

2. **`crates/db/migrations/20251220134608_fix_session_executor_format.sql`**
   - Added migration to fix existing erroneous entries
   - Strips the variant suffix from any executor values containing a colon
   - Excludes valid hyphenated values like `dev-server`, `setup-script`, etc.

The fix compiles successfully. This will restore the expected behavior for:
- Capability lookups in `UserMessage.tsx`
- Default profile selection in `CreateAttemptDialog.tsx`

* Simplified. The `LIKE '%:%'` condition is sufficient - it only matches values containing a colon, which are exactly the erroneous `"EXECUTOR:VARIANT"` format entries we need to fix.
This commit is contained in:
Louis Knight-Webb
2025-12-20 14:11:59 +00:00
committed by GitHub
parent ca2b578231
commit ce089f2aae
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
-- Fix session executor values that were incorrectly stored with variant suffix
-- Values like "CLAUDE_CODE:ROUTER" should be "CLAUDE_CODE"
-- This was introduced in the refactor from task_attempts to sessions (commit 6a129d0fa)
UPDATE sessions
SET executor = substr(executor, 1, instr(executor, ':') - 1),
updated_at = datetime('now', 'subsec')
WHERE executor LIKE '%:%';

View File

@@ -909,7 +909,7 @@ pub trait ContainerService {
let session = Session::create(
&self.db().pool,
&CreateSession {
executor: Some(executor_profile_id.to_string()),
executor: Some(executor_profile_id.executor.to_string()),
},
Uuid::new_v4(),
workspace.id,