Skip to content

fix(agent-manager): recover worktrees after restart#9939

Open
marius-kilocode wants to merge 1 commit intomainfrom
quickest-wool
Open

fix(agent-manager): recover worktrees after restart#9939
marius-kilocode wants to merge 1 commit intomainfrom
quickest-wool

Conversation

@marius-kilocode
Copy link
Copy Markdown
Collaborator

Summary

  • Recover Agent Manager worktrees from .kilo/worktrees when saved state is missing, stale, or corrupt.
  • Harden state persistence by draining pending saves on shutdown and preserving corrupt state as a backup.

Fixes #9877

void this.shutdown()
}

private async disposeAsync(): Promise<void> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Shutdown does not wait for terminal cleanup

shutdown() is now awaited during extension deactivation, but terminalRouter.dispose() is still fire-and-forget inside this async cleanup. This lets shutdown resolve before PTY removal requests finish, so the connection service can be torn down while cleanup is in flight and terminals may linger until the backend exits. Await that disposal in disposeAsync() so the new shutdown drain also covers terminal resources.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 5, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
Resolved Issues
File Line Issue
packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts 1695 Resolved: terminal cleanup is now awaited during shutdown.

Reviewed by gpt-5.5-20260423 · 514,885 tokens

@marius-kilocode marius-kilocode force-pushed the quickest-wool branch 2 times, most recently from 31eac80 to cbbce0f Compare May 5, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Manager loses worktrees after restart

1 participant