Skip to content

fix(agent-manager): prevent false GitHub CLI warnings on project switches - #13448

Merged
marius-kilocode merged 2 commits into
mainfrom
fix-cli-errors-on-project-switching
Aug 26, 2026
Merged

fix(agent-manager): prevent false GitHub CLI warnings on project switches#13448
marius-kilocode merged 2 commits into
mainfrom
fix-cli-errors-on-project-switching

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Agent Manager can report that the GitHub CLI is not installed even when gh is available, most often while switching between projects or after a managed worktree disappears. Node returns the same spawn gh ENOENT failure for a missing executable and a missing working directory, while background or stopped project pollers could surface errors in the newly active project.

Why This Change Was Made

A deleted working directory must not invalidate global GitHub CLI availability. PR errors also need the same project ownership as PR status updates so late responses, cached error replay, and background polling cannot leak notifications across project boundaries.

User Impact

Switching Agent Manager projects and removing worktrees no longer produces misleading GitHub CLI installation warnings. Genuine missing-CLI and authentication errors remain visible for the active project, and existing single-project messages continue to work.

Evidence

  • All 4,177 VS Code extension unit tests pass.
  • Extension and webview typechecks, ESLint, the production extension build, knip, formatting, and the Kilo-owned-file guard pass.
  • Regression coverage exercises an installed CLI with a deleted worktree, a directory removed between validation and process launch, a stopped project poller, a genuinely missing executable, project-owned errors, and error replay.
  • An isolated VS Code instance was tested with two real disposable Git projects. Switching in both directions produced no false warning, errors from inactive projects were suppressed, and an active-project authentication error still appeared.

Agent Manager with two isolated projects and no false GitHub CLI warning

A genuine GitHub authentication error remains visible for the active project

@kilo-code-bot

kilo-code-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/kilo-vscode/src/agent-manager/pr-status-bridge.ts
  • packages/kilo-vscode/tests/unit/am-pr-status-bridge.test.ts
Previous Review Summary (commit 613414e)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 613414e)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (10 files)
  • .changeset/agent-manager-project-pr-errors.md
  • packages/kilo-vscode/src/agent-manager/PRStatusPoller.ts
  • packages/kilo-vscode/src/agent-manager/pr-status-bridge.ts
  • packages/kilo-vscode/src/agent-manager/project/pollers.ts
  • packages/kilo-vscode/src/agent-manager/types.ts
  • packages/kilo-vscode/tests/unit/am-pr-status-bridge.test.ts
  • packages/kilo-vscode/tests/unit/gh.test.ts
  • packages/kilo-vscode/tests/unit/project-message-ownership.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts

Reviewed by grok-4.6 · Input: 45.2K · Output: 5.5K · Cached: 249.3K

Review guidance: REVIEW.md from base branch main

Comment thread packages/kilo-vscode/src/agent-manager/pr-status-bridge.ts Outdated
Comment thread packages/kilo-vscode/src/agent-manager/pr-status-bridge.ts Outdated
@marius-kilocode
marius-kilocode merged commit 80d5353 into main Aug 26, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the fix-cli-errors-on-project-switching branch August 26, 2026 08:49
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.

2 participants