Summary error (vibe-kanban) (#530)

* ## Summary

Fixed the string slicing panic in [crates/local-deployment/src/container.rs](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-0ec9-summary-er/crates/local-deployment/src/container.rs#L1106-L1118). The issue was at line 1109 where `&summary[..summary.len().min(100)]` used byte-based slicing, causing a panic when byte index 100 fell inside the multi-byte UTF-8 character .

**Solution implemented:**
- Replaced byte-based slicing with character-aware slicing using `char_indices()`
- The fix ensures slicing only occurs at valid UTF-8 character boundaries
- No allocation overhead - uses the Oracle-recommended approach with string slices

The code now safely truncates to the first 100 Unicode characters (or end of string if shorter) without risking panics on multi-byte characters.

* Fixed. Removed the problematic debug log entirely from the [`update_executor_session_summary` function](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-0ec9-summary-er/crates/local-deployment/src/container.rs#L1105-L1106). This eliminates the UTF-8 string slicing panic without adding complexity.
This commit is contained in:
Louis Knight-Webb
2025-08-20 11:36:15 +01:00
committed by GitHub
parent 08f5b16cf6
commit 8120f94633

View File

@@ -1103,11 +1103,6 @@ impl LocalContainerService {
// Only update if summary is not already set
if session.summary.is_none() {
if let Some(summary) = self.extract_last_assistant_message(exec_id) {
tracing::debug!(
"Updating executor session summary for execution {}: {}",
exec_id,
&summary[..summary.len().min(100)]
);
ExecutorSession::update_summary(&self.db.pool, *exec_id, &summary).await?;
} else {
tracing::debug!("No assistant message found for execution {}", exec_id);