mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
fix(agent-manager): clean busySessions in forget and call before worktree removal
This commit is contained in:
@@ -1110,8 +1110,8 @@ export class AgentManagerProvider implements Disposable {
|
||||
return null
|
||||
}
|
||||
|
||||
const orphaned = state.removeWorktree(worktreeId)
|
||||
this.naming.forget(worktreeId)
|
||||
const orphaned = state.removeWorktree(worktreeId)
|
||||
if (this.diffs.shouldStopForWorktree(worktree.path, orphaned)) {
|
||||
this.diffs.stop()
|
||||
}
|
||||
|
||||
@@ -124,9 +124,13 @@ export class BranchNamingController {
|
||||
}
|
||||
|
||||
/** Drop in-memory bookkeeping for a worktree whose arming ended without a
|
||||
* rename (worktree removed, session moved/deleted). Safe to call for any
|
||||
* id; no-ops when nothing is held. */
|
||||
* rename (worktree removed, session moved/deleted). Also clears the armed
|
||||
* session from the busy set. Call before the worktree is removed from state
|
||||
* so the session is still resolvable. Safe to call for any id; no-ops when
|
||||
* nothing is held. */
|
||||
forget(id: string): void {
|
||||
const worktree = this.deps.state()?.getWorktree(id)
|
||||
if (worktree?.autoNameSessionId) this.busySessions.delete(worktree.autoNameSessionId)
|
||||
this.pending.delete(id)
|
||||
this.model.delete(id)
|
||||
this.idleAttempted.delete(id)
|
||||
|
||||
Reference in New Issue
Block a user