bug: fix onboarding softlock / add dynamic input accepting. Fix grammatical issues.#439
bug: fix onboarding softlock / add dynamic input accepting. Fix grammatical issues.#439nolan-at-pieces wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes onboarding Step 5 chat softlock (issue #438) by relaxing command validation to accept dynamic pieces ask ... inputs, and polishes several onboarding strings for grammar/casing consistency.
Changes:
- Add
prefix_matchsupport toOnboardingCommandStepto validate commands by prefix (used forpieces ask). - Update onboarding Step 5 prompt/expected command to allow any question text.
- Apply multiple grammar/casing fixes across onboarding step text.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def _is_valid(self, user_input: str) -> bool: | ||
| if self.prefix_match: | ||
| s = user_input.strip() | ||
| return s.startswith(self.predicted_text) and len(s) > len(self.predicted_text) |
There was a problem hiding this comment.
In prefix_match mode, _is_valid requires len(s) > len(self.predicted_text), which rejects pieces ask (no query) even though the CLI supports running ask without args and then prompting for a query. This can still leave users stuck if they try the shorter valid command; consider allowing an exact match as valid (and/or validating based on parsed tokens rather than a raw string prefix).
| return s.startswith(self.predicted_text) and len(s) > len(self.predicted_text) | |
| return s.startswith(self.predicted_text) and len(s) >= len(self.predicted_text) |
| "Starting a session allows you to run multiple commands without having to start the Pieces CLI every time. " | ||
| "Start a session with `pieces run`. To exit your session, use `exit`.", |
There was a problem hiding this comment.
There’s an extra trailing space at the end of the first sentence ("every time. "), which results in an unintended double-space in the rendered onboarding text when concatenated with the next string.
| "Starting a session allows you to run multiple commands without having to start the Pieces CLI every time. " | |
| "Start a session with `pieces run`. To exit your session, use `exit`.", | |
| "Starting a session allows you to run multiple commands without having to start the Pieces CLI every time." | |
| " Start a session with `pieces run`. To exit your session, use `exit`.", |
Fix for issue(s) #438. This adds the ability to type whatever you want on that step.
This also fixes a few grammatical issues in onboarding.