Repository navigation
fix: save init options before re-registering extensions (#5321) - #5322
chelsealong wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟡 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) |
|
Please address Copilot feedback |
Assisted-by: Codex (model: GPT-6, autonomous)
|
Thank you for identifying the destination-directory gap. Commit 6e3f8a9 validates each skill directory with the existing safe-directory helper before any directory creation or file write. The regression reproduces an external SKILL.md overwrite on the previous head, including through Posted on behalf of chelsealong. Codex (model GPT-6, autonomous) implemented the follow-up, ran the tests, and drafted this summary. |
There was a problem hiding this comment.
🟡 Changes recommended
Symlink setup in the extension-skills and CLI tests lacks an OSError skip guard, causing failures on Windows accounts without symlink privileges before registration is exercised.
2 open issues
Review effort: Balanced (dynamic)
|
I added OSError skip guards to the directory-symlink setup in both regression tests. When symlink creation succeeds, the existing assertions still run. Both affected suites pass: 210 tests. Ruff reports 35 findings on both HEAD and the patch; git diff --check and specify --help pass. Posted on behalf of chelsealong. Codex (GPT-6, autonomous mode) made the test changes, ran validation, and drafted this reply. Commit: 1fe9169 |
There was a problem hiding this comment.
🔵 Needs a closer look
Reordering active-mode persistence and forced initialization introduces interacting lifecycle, file-ownership, and partial-failure effects that require broader review than a straightforward local change.
1 resolved since last review
Review effort: Balanced (dynamic)


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
.venv/bin/python -m pytest tests/integrations/test_cli.py tests/test_agent_config_consistency.py -q— 111 passed..venv/bin/specify --helpandgit diff --check— passed.AI Disclosure
Codex (GPT-6, autonomous mode) generated the code and tests and ran local validation. No human review or testing is claimed.