Skip to content

Comments

fix(cli): show Copilot setup hint on github install cancellation#602

Open
Olusammytee wants to merge 1 commit intoKilo-Org:devfrom
Olusammytee:fix/385-github-install-copilot-hint
Open

fix(cli): show Copilot setup hint on github install cancellation#602
Olusammytee wants to merge 1 commit intoKilo-Org:devfrom
Olusammytee:fix/385-github-install-copilot-hint

Conversation

@Olusammytee
Copy link
Contributor

Summary

  • detect empty provider options during kilo github install and show a clear hint
  • when provider selection is cancelled, display a GitHub Copilot setup link before exiting
  • handle invalid provider selection defensively with the same setup guidance

Fixes #385

Copilot AI review requested due to automatic review settings February 22, 2026 18:32
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

await addWorkflowFiles()
printNextSteps()

const copilotSetupLink = "https://kilo.ai/docs/getting-started/setup-authentication"
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 22, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
packages/opencode/src/cli/cmd/github.ts 209 copilotSetupLink is declared after promptProvider() is called (line 202). Since const is in the temporal dead zone, any cancel/error path in promptProvider() that references copilotSetupLink will throw ReferenceError: Cannot access 'copilotSetupLink' before initialization. Move the declaration before line 202.
Files Reviewed (1 file)
  • packages/opencode/src/cli/cmd/github.ts - 1 issue

Fix these issues in Kilo Cloud

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 options and 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.

Comment on lines +209 to +210
const copilotSetupLink = "https://kilo.ai/docs/getting-started/setup-authentication"

Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant