Skip to content

fix: handle cli configuration errors - #4597

Merged
marius-kilocode merged 8 commits into
mainfrom
am-mac-config-startup-issues
Dec 22, 2025
Merged

fix: handle cli configuration errors#4597
marius-kilocode merged 8 commits into
mainfrom
am-mac-config-startup-issues

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Fix Agent Manager not showing error when CLI is misconfigured. When the CLI exits with a configuration error (e.g., missing kilocodeToken), the extension now detects this and shows an error popup with options to run kilocode auth or kilocode config.

@changeset-bot

changeset-bot Bot commented Dec 20, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a6b6d6d

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

Add translations for cliMisconfigured and configureCli keys
to all 21 supported locales.

@kilo-code-bot kilo-code-bot Bot left a comment

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.

✅ No Issues Found

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

Review Details

Files Reviewed:

  • src/core/kilocode/agent-manager/CliProcessHandler.ts - Core logic for detecting CLI configuration errors
  • src/core/kilocode/agent-manager/AgentManagerProvider.ts - UI handling for configuration errors
  • src/core/kilocode/agent-manager/CliOutputParser.ts - Parser updates for instructions field
  • src/core/kilocode/agent-manager/CliSessionLauncher.ts - New getPrewarmedCliPath() method
  • src/core/kilocode/agent-manager/telemetry.ts - New telemetry type
  • src/i18n/locales/en/kilocode.json - Localization strings
  • Test files (3 files with comprehensive coverage)

Checked: Security, bugs, performance, error handling, memory management

Highlights:

  • ✅ Memory-safe buffer management with 64KB cap prevents unbounded growth
  • ✅ Multiple fallback mechanisms for error detection (JSON parsing → raw output patterns)
  • ✅ Proper type safety with cli_configuration_error added to all relevant type definitions
  • ✅ Comprehensive test coverage for all new scenarios including edge cases
  • ✅ Follows established codebase patterns and conventions

Comment thread src/core/kilocode/agent-manager/CliProcessHandler.ts Outdated

@kilo-code-bot kilo-code-bot Bot left a comment

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.

✅ Previous Issues Addressed

The review comment from RSO regarding code complexity in handleProcessExit has been resolved in commit 122f44e. The code now correctly extracts configurationError to a local variable before clearing pendingProcess, making the logic cleaner and easier to follow.

No new issues found in the latest changes.

Review Details

Files Reviewed: src/core/kilocode/agent-manager/CliProcessHandler.ts (latest commit only)

Verified:

  • Configuration error extraction follows the cleaner pattern suggested by RSO
  • Memory-safe buffer management preserved
  • Test coverage remains comprehensive

@kilo-code-bot kilo-code-bot Bot left a comment

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.

✅ No New Issues

Changes since last review (commits b6b4ba10, fdb7b1dc) look good.

Commit Description Assessment
b6b4ba10 Simplify logic further Minor refactoring, cleaner code
fdb7b1dc Fix type errors Type fixes in AgentManagerProvider.ts and CliSessionLauncher.ts
Review Details (2 commits since last review)

Files Changed:

  • src/core/kilocode/agent-manager/CliProcessHandler.ts - Logic simplification
  • src/core/kilocode/agent-manager/AgentManagerProvider.ts - Type fixes
  • src/core/kilocode/agent-manager/CliSessionLauncher.ts - Type fixes

Verified:

  • Configuration error detection logic remains correct
  • Memory-safe buffer management preserved
  • Test coverage comprehensive
  • RSO's previous feedback addressed

Resolve conflict in CliOutputParser.ts:
- Keep session_title_generated event from main
- Keep instructions in welcome event comment from HEAD
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