Skip to content

Fix: Improve init confirmation prompts and API key validation - #120

Merged
thomas-vilte merged 1 commit into
masterfrom
dev
Jul 30, 2026
Merged

thomas-vilte merged 1 commit into
masterfrom
dev

Conversation

@thomas-vilte

@thomas-vilte thomas-vilte commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Description

I improved the confirmation prompts within the init wizard and enhanced the Gemini API key validation process. The ui.AskConfirmation calls were replaced with a new internal askConfirmation function. This change addresses an issue where mixing fmt.Scanln (used by ui.AskConfirmation) with bufio.Reader (used for other prompts) could desynchronize stdin, causing prompts to receive incorrect input.

Additionally, the validateGeminiAPIKey function now performs an actual CountTokens API request to confirm the API key is authorized by the Gemini service. Previously, validation only checked if the client could be constructed locally, which did not guarantee the key's authorization status.

Fixes #

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual test: I manually ran the init wizard, testing various confirmation prompts and API key input scenarios (valid, invalid, unverified). I verified that the prompts now correctly receive input and that API key validation accurately reflects authorization status.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Test Plan & Evidence

Suggested Manual Verification

  • Unit Tests: Run go test ./... and ensure all tests pass
  • No Regressions: Verify that related features still work as expected

@thomas-vilte thomas-vilte changed the title placeholder Fix: Improve init confirmation prompts and API key validation Jul 30, 2026
@thomas-vilte thomas-vilte added feature New features fix Bug fixes labels Jul 30, 2026
@thomas-vilte
thomas-vilte merged commit 71a5cb8 into master Jul 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features fix Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant