Accept any capitalization at init's environment prompt - #23
Merged
Conversation
Rich's `choices` matching is case-sensitive by default, so typing `Go` for a `go` business — the natural way to capitalize it — looped forever on "please select one of the available options" with no indication why, indistinguishable from the prompt simply not accepting input. Rich's stock rejection message also never mentioned that `url` is itself one of the listed choices and opens a second free-text prompt, so anyone whose environment is not one of the curated names had no way to find the escape hatch.
jbedient-kizen
force-pushed
the
bug/init-env-prompt-case-insensitive
branch
from
September 1, 2026 18:22
15b8d5d to
408af97
Compare
annaliu-kizen
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
kizen init's Environment prompt rejected correctly-typed answers because of their case, and never revealed its own escape hatch.What was wrong
Rich's
choicesmatching is case-sensitive by default. TypingGofor agobusiness — the natural way to capitalize it — looped forever on "please select one of the available options" with no indication why. From the user's side that is indistinguishable from the prompt not accepting input at all.Separately, Rich's stock rejection message never mentioned that
urlis itself one of the listed choices and opens a second free-text prompt. Anyone whose environment is not one of the curated names had no way to discover that, and could end up re-typing their real host indefinitely.What changed
_askpassescase_sensitive=False, so capitalization no longer matters._EnvironmentPromptsubclass overridesillegal_choice_messageto say directly:Type "url" to enter a custom address instead.Both are confined to
cli/init.py. No flags, no--helpchanges, soscripts/cli-tree-baseline.txtis untouched.Verification
bin/check.sh builder-cli— lint, format, typecheck, test, extra_checks all pass:1251 passed, 5 skipped, 76 deselected. (The 5th skip is thechdbimportorskip, legitimate without--extra connectors.)The two new tests were confirmed to genuinely cover the fix rather than pass either way — with
init.pyreverted tomainthey both fail: