Skip to content

fix: save init options before re-registering extensions (#5321) - #5322

Open
chelsealong wants to merge 1 commit into
github:mainfrom
chelsealong:fix/codex-spec-kit-5321
Open

chelsealong wants to merge 1 commit into
github:mainfrom
chelsealong:fix/codex-spec-kit-5321

Conversation

@chelsealong

Copy link
Copy Markdown
Contributor

Description

Fixes #5321. Forced init now saves the selected integration mode before re-registering installed extensions and presets, so extension files use the selected mode.

Testing

  • Regression test: skills mode failed before the fix; skills and command modes pass after it.
  • .venv/bin/python -m pytest tests/integrations/test_cli.py tests/test_agent_config_consistency.py -q — 111 passed.
  • .venv/bin/specify --help and git diff --check — passed.
  • Ruff reported 39 findings on both the unmodified baseline and the patch.

AI Disclosure

Codex (GPT-6, autonomous mode) generated the code and tests and ran local validation. No human review or testing is claimed.

@chelsealong
chelsealong requested a review from mnriem as a code owner November 9, 2026 01:25
Copilot AI auto review requested due to automatic review settings November 9, 2026 01:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Forced initialization can overwrite files outside the project through symlinked skill subdirectories because individual destination directories are not validated.

1 open issue
What changed in this PR

Fixes #5321 by saving the selected integration mode before forced init re-registers installed extensions and presets.

Changes:

  • Moves init-option persistence ahead of re-registration so it uses the current mode.
  • Adds regression coverage for skills and command modes when saved options are absent.
File Description
tests/​integrations/​test_cli.py Verifies forced init generates extension files only in the selected mode.
src/​specify_cli/​command_init.py Saves init options before extension and preset re-registration.

Review effort: Balanced (auto)

init_opts["ai_skills"] = True
else:
init_opts.pop("ai_skills", None)
save_init_options(project_path, init_opts)
@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Nov 9, 2026
@mnriem

mnriem commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

@mnriem mnriem added the author-awaiting Waiting on author response label Nov 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author-awaiting Waiting on author response triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

init --force registers extensions before ai_skills is saved (skills-mode init writes command files)

3 participants