fix: default non-interactive init to copilot integration#2414
Open
afurm wants to merge 2 commits intogithub:mainfrom
Open
fix: default non-interactive init to copilot integration#2414afurm wants to merge 2 commits intogithub:mainfrom
afurm wants to merge 2 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a non-interactive specify init crash by preventing the interactive integration picker from running when stdin is not a TTY; in that case (and with no --ai/--integration provided) it defaults to the copilot integration and continues. Adds a regression test to ensure non-interactive initialization selects Copilot and produces expected scaffold output.
Changes:
- Default
specify inittocopilotwhensys.stdin.isatty()is false and no agent was explicitly provided. - Add a CLI-level regression test that monkeypatches the picker to ensure it is not invoked in non-interactive mode.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Adds a non-interactive guard to bypass arrow-key selection and default to copilot. |
tests/integrations/test_cli.py |
Adds a regression test verifying non-interactive init does not open the picker and writes copilot to .specify/integration.json. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
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.
Description
This PR fixes a non-interactive
specify initcrash path whereinitwould still try to open the interactive integration picker when stdin is not a TTY.When
--ai/--integrationis not provided in non-interactive environments, the command now defaults tocopilotand proceeds without prompting.Fixes: github/spec-kit#267
It also adds a regression test to ensure non-interactive initialization:
copilotto.specify/integration.jsonTesting
uv run specify --helpuv sync && uv run pytest(ran focused pytest targets instead)
Additional executed checks:
uv run --with pytest pytest tests/integrations/test_cli.py::TestInitIntegrationFlag::test_noninteractive_init_defaults_to_copilot -quv run --with pytest pytest tests/integrations/test_cli.py -quv run --with pytest pytest tests/integrations/test_integration_copilot.py -qAI Disclosure
This PR was authored with help from ChatGPT/Codex for issue triage, implementation, test additions, and write-up.