spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

fix: register enabled extensions for agent on integration use/upgrade

Open PascalThuet opened this issue 5 months ago • 2 comments

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_use
  • test_install_does_not_register_disabled_extensions
  • test_upgrade_backfills_extension_commands_for_agent
  • test_install_skills_mode_secondary_agent_defers_extension_artifacts
  • test_upgrade_non_active_agent_preserves_active_agent_skills

Targeted local run:

  • uv run --extra test pytest tests/integrations/test_integration_subcommand.py -q
  • uvx 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
  • git diff --check origin/main...HEAD

Closes #2886

PascalThuet avatar Jun 12 '26 04:06 PascalThuet

I would prefer this ONLY to happen on specify integration use or specify integration switch or specify integration upgrade.

mnriem avatar Jun 16 '26 13:06 mnriem

What changed:

  • integration install no longer registers enabled extension artifacts for the newly installed agent.
  • integration use now registers enabled extensions after selecting the default integration.
  • switch and upgrade continue 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 passed
  • uvx 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 -> passed
  • git diff --check origin/main...HEAD -> passed
  • Merged latest origin/main; GitHub reports MERGEABLE.
  • gh pr checks currently reports no checks on the branch.

PascalThuet avatar Jun 16 '26 21:06 PascalThuet

Please rebase on upstream/main

mnriem avatar Jun 16 '26 22:06 mnriem