fix(cli): show Copilot setup hint on github install cancellation#602
fix(cli): show Copilot setup hint on github install cancellation#602Olusammytee wants to merge 1 commit intoKilo-Org:devfrom
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
| await addWorkflowFiles() | ||
| printNextSteps() | ||
|
|
||
| const copilotSetupLink = "https://kilo.ai/docs/getting-started/setup-authentication" |
There was a problem hiding this comment.
CRITICAL: copilotSetupLink is declared here on line 209, but promptProvider() is called on line 202 — before this const is initialized. Since const declarations are in the temporal dead zone until execution reaches them, any error/cancel path in promptProvider() that references copilotSetupLink (lines 278, 289, 295) will throw a ReferenceError: Cannot access 'copilotSetupLink' before initialization.
This variable needs to be moved before the promptProvider() call (e.g., before line 202) so it's initialized when the function body executes.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (1 file)
|
There was a problem hiding this comment.
Pull request overview
This PR improves the kilo github install CLI UX by surfacing a GitHub Copilot setup hint when provider selection is cancelled, invalid, or when no providers are available—addressing the confusion described in issue #385.
Changes:
- Precomputes provider selection
optionsand handles the “no options available” case with a warning + Copilot setup hint. - Prints a Copilot setup link before exiting when provider selection is cancelled.
- Adds a defensive check for invalid provider selection with the same setup guidance.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const copilotSetupLink = "https://kilo.ai/docs/getting-started/setup-authentication" | ||
|
|
There was a problem hiding this comment.
copilotSetupLink is declared after promptProvider() has already been awaited. Since promptProvider() references copilotSetupLink on cancel/invalid/empty-option paths, those flows will currently throw a ReferenceError due to the temporal dead zone. Move the copilotSetupLink declaration above the await promptProvider() call (or define it inside promptProvider).
Summary
Fixes #385