Repository navigation
Conversation
Assisted-by: Claude Code (model: Claude Opus 5, autonomous)
…oved `specify extension catalog remove` wrote `catalogs: []` after dropping the last entry and printed that built-in defaults would be used. The catalog loader rejects an existing config with no entries, so every later catalog-backed command (`catalog list`, `search`, `add`, `update`, `info`) failed until the file was deleted by hand. Delete the file instead, as `specify integration catalog remove` already does. Assisted-by: Claude Code (model: Claude Opus 5, autonomous)
This branch has not been deployed
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
specify extension catalog remove <name>on the last project catalog prints "No catalogs remain in config. Built-in defaults will be used." but writes.specify/extension-catalogs.ymlascatalogs: []. The extension catalog loader rejects an existing config with no entries (on purpose, seetest_empty_project_config_raises_error), so every later catalog-backed command fails until the user deletes the file by hand:extension search,extension info,extension add <id>for any id that is not bundled, andextension updateonce an extension is installed fail the same way.This PR deletes the file when the last entry is removed, which is what
specify integration catalog removealready does (IntegrationCatalog.remove_catalog, pinned bytest_catalog_remove_final_entry_restores_defaults). The built-indefaultandcommunitycatalogs are active again, as the message says (or the user-level~/.specify/extension-catalogs.yml, when one exists; it is the next layer in the resolution order). The othercatalog removecommands are not affected: presets, workflows and workflow steps treat an empty list as no config, and bundles always add the built-in catalogs.Testing
test_extension_catalog_remove_final_entry_restores_defaults: add one catalog, remove it, thenextension catalog listexits 0 and listsdefaultandcommunity, and the config file is gone. Onmainit fails with the error above (assert 1 == 0).test_extension_catalog_remove_keeps_config_with_remaining_entries: removing one of two entries keeps the file with the other entry unchanged.tests/specify_cli: 4416 passed, 2 skipped.tests/test_extensions.py: 464 passed..specify/is left empty andextension catalog listexits 0 with the built-in stack.Equivalent local checks: tests ran with
.venv/bin/python -m pytestand the CLI with the venv'sspecify, on macOS.AI Disclosure
AI disclosure: This contribution was produced by Claude Code running autonomously on behalf of @Chaoqi31. An audit agent (Claude Fable 5.1, max reasoning effort) found the bug and wrote a failing reproduction. A fix agent (Claude Opus 5, xhigh effort) wrote the fix and tests. A separate review agent checked the branch, and the orchestrating agent (Claude Opus 5) wrote the commits and this description. AI generated the code, tests and text. No human reviewed the diff line by line before submission.