Repository navigation
Conversation
`integration switch` and `integration use` register only enabled extensions for the agent they activate, and `switch` also removes a disabled extension's commands from the previous agent. For every integration except `generic`, `extension enable` only flipped the registry flag and re-enabled hooks, so an extension disabled across a switch or use came back "enabled" with no commands for the active agent: no skill or command file and nothing for that agent in `registered_commands`, until the integration is selected again or the extension is reinstalled. When the registry has no commands for the active agent, `enable` now registers the extension through register_enabled_extensions_for_agent, which gains an `extension_ids` filter so only that extension is touched. A plain disable/enable cycle, where the commands are still registered, leaves the agent's files alone; agents that take extension commands as skills (Copilot with --skills) only get missing skill files written. Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
An extension that is disabled while the project changes integration comes back "enabled" with no commands for the new agent.
docs/reference/extensions.mddescribes disable as temporary ("Re-enable withenable"), but here re-enabling silently restores nothing:integration install geminifollowed byintegration use geminigives the same result. The only ways back are selecting the integration again or reinstalling the extension.Root cause:
integration switchandintegration useregister only enabled extensions for the agent they activate (register_enabled_extensions_for_agentskips disabled entries).switchalso removes a disabled extension's commands from the previous agent.extension enable(extensions/command_enable.py) then only flips the registry flag and re-enables hooks. Every integration exceptgenericgets no registration at all.The fix:
register_enabled_extensions_for_agent()gains a keyword-onlyextension_idsfilter, so a single extension can be registered.genericagents,enablecalls it for this one extension, but only when the registry has no commands recorded for the active agent.--skills) only get missing skill files written.With the change, the same steps end with:
Overlap: your open PRs #4959 and #4883 also edit
extensions/command_enable.py. Neither touches this case, but they will conflict textually with this change. If #4959 lands first, this logic belongs inExtensionManager.enable(), and the PR can be rebased onto that.Testing
uv run specify --helpuv sync && uv run pytestmainand on this branchNew tests in
tests/specify_cli/extensions/test_command_enable.py, each parametrized overclaudeandcopilotwith--skills:test_enable_registers_commands_for_integration_switched_while_disabled: fails onmain(the extension'sSKILL.mdis missing after enable) and passes with the changetest_enable_leaves_commands_still_registered_for_active_integration: the negative case. A hand-edited skill survives a disable/enable cycle and the registry is unchanged. It passes before and after.The file gives 5 passed with the change (2 failed on
main).tests/specify_cli/extensions,test_command_switch,test_command_use,test_extensions,test_extension_skills,test_extension_registration,test_integration_generic): 1095 passed.tests/test_*_python_parity.pyfiles occur identically on unmodifiedmainon this machine under full-suite load; those files pass when run on their own (257 passed, 112 skipped).uvx ruff@0.15.0 check src tests: cleanAI Disclosure
AI disclosure: Claude Code (model: Claude Opus 5.5, max reasoning effort, autonomous agent mode) opened this PR on behalf of @yxshee. A Claude Code subagent (same model, autonomous) found the bug and wrote the fix and tests. The lead agent independently re-ran the new tests against
mainand the branch, reproduced the behavior above with the real CLI, reviewed the diff, and wrote this description. No human reviewed the change line by line before it was opened.🤖 Generated with Claude Code