mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
When a worktree was deleted, its sessions had worktreeId set to null but were never removed from agent-manager.json. These orphaned sessions were invisible in the UI and could never be reassigned, causing the file to grow unboundedly (170+ entries with only 8 active worktrees). - removeWorktree() now deletes sessions from state instead of nullifying - load() skips orphaned sessions during deserialization (one-time cleanup) - validate() also prunes orphaned sessions for completeness