fix: register enabled extensions for agent on integration use/upgrade
What
Enabled extension command/skill registration now happens only when an integration is selected or refreshed:
specify integration use <agent>specify integration switch <agent>specify integration upgrade <agent>
Plain specify integration install <agent> installs only that integration core command artifacts. This follows maintainer feedback in #2949 and avoids extension side effects for secondary integrations until they are selected.
Behavior
The shared _register_extensions_for_agent helper remains best-effort: registration failures warn via _print_cli_warning and do not roll back the surrounding use/switch/upgrade transaction.
use now registers enabled extensions after the default integration is changed. switch and upgrade continue to register enabled extensions after their own transactions commit.
Tests
test_install_defers_extension_commands_until_usetest_install_does_not_register_disabled_extensionstest_upgrade_backfills_extension_commands_for_agenttest_install_skills_mode_secondary_agent_defers_extension_artifactstest_upgrade_non_active_agent_preserves_active_agent_skills
Targeted local run:
uv run --extra test pytest tests/integrations/test_integration_subcommand.py -quvx ruff check src/specify_cli/integrations/_install_commands.py src/specify_cli/integrations/_query_commands.py src/specify_cli/integrations/_helpers.py tests/integrations/test_integration_subcommand.pygit diff --check origin/main...HEAD
Closes #2886
I would prefer this ONLY to happen on specify integration use or specify integration switch or specify integration upgrade.
What changed:
integration installno longer registers enabled extension artifacts for the newly installed agent.integration usenow registers enabled extensions after selecting the default integration.switchandupgradecontinue registering enabled extensions after their transactions commit.- Tests now assert that install defers extension artifacts until use, including Copilot skills mode.
Validation:
uv run --extra test pytest tests/integrations/test_integration_subcommand.py -q-> 111 passeduvx ruff check src/specify_cli/integrations/_install_commands.py src/specify_cli/integrations/_query_commands.py src/specify_cli/integrations/_helpers.py tests/integrations/test_integration_subcommand.py-> passedgit diff --check origin/main...HEAD-> passed- Merged latest
origin/main; GitHub reportsMERGEABLE. gh pr checkscurrently reports no checks on the branch.
Please rebase on upstream/main