Skip to content

Conversation

@marius-kilocode
Copy link
Contributor

When starting multiple versions of the same prompt in different worktrees, the terminal button on the top right is only shown on the firrst session (we need this to be on all different versions and not just in the first verszion) write a failing test first then fix this

@changeset-bot
Copy link

changeset-bot bot commented Dec 23, 2025

🦋 Changeset detected

Latest commit: 1b7beea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@marius-kilocode marius-kilocode enabled auto-merge (squash) December 23, 2025 20:59
@kiloconnect
Copy link
Contributor

kiloconnect bot commented Dec 23, 2025

✅ No Issues Found

5 files reviewed | Confidence: 95% | Recommendation: Merge

Review Details

Files Reviewed:

  • src/core/kilocode/agent-manager/AgentManagerProvider.ts - Core fix for multi-version session sequencing
  • src/core/kilocode/agent-manager/CliProcessHandler.ts - New hasPendingProcess() method
  • src/core/kilocode/agent-manager/__tests__/AgentManagerProvider.spec.ts - Test coverage for the fix
  • .changeset/agent-manager-multi-version-terminal.md - Changeset documentation
  • pnpm-lock.yaml - Minor lockfile update

Summary:
This PR correctly fixes the issue where terminal button visibility was only shown on the first session when starting multiple versions in different worktrees. The fix ensures waitForPendingSessionToClear() now checks both registry.pendingSession AND processHandler.hasPendingProcess() before resolving, preventing race conditions during multi-version session spawning.

Checked: Security, bugs, race conditions, error handling, test coverage

Quality Notes:

  • Clean, minimal change with focused scope
  • New hasPendingProcess() method follows existing patterns in CliProcessHandler
  • Test properly uses fake timers with cleanup in finally block
  • Defensive optional chaining on processHandler?.hasPendingProcess() is safe

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.

3 participants