Skip to content

[Bug]: integration install/upgrade don't register extension commands for the new agent (only switch does) #2886

Description

@PascalThuet

Bug Description

specify integration switch re-registers enabled extensions' commands for the target agent (register_enabled_extensions_for_agent). specify integration install and specify integration upgrade do not. integration.setup() only installs the integration's own core commands, not extension commands.

So when a second integration is added to a project, the new agent is missing the extension commands the first agent has (e.g. the bundled agent-context extension's /speckit.agent-context.update, and any other installed extension's commands).

Steps to Reproduce

  1. specify init --here --integration claude
  2. specify integration install codex
  3. Inspect .specify/extensions/.registry: the agent-context entry's registered_commands contains only claude, not codex.

Reproduced on main @ 7106858:

registered_commands: { "claude": ["speckit.agent-context.update"] }

No codex key; codex has no rendered speckit.agent-context.update command.

Expected Behavior

Installing/upgrading an integration registers the enabled extensions' commands for that integration's agent, same as switch does — so every installed agent has the same extension commands.

Actual Behavior

Only switch registers extension commands for an agent. A second integration added via install (or refreshed via upgrade) never gets them, so its extension commands are silently absent.

Question for maintainers

The fix is to call register_enabled_extensions_for_agent(<agent>) from install and upgrade (as switch already does). Before I open a PR, one decision is yours:

Should install/upgrade register all enabled extensions for the new agent (full parity with switch), or only a subset?

  • Full parity (recommended): every installed agent ends up with every enabled extension's commands. Consistent with switch; smallest, most predictable change. Downside: install/upgrade start writing more files than today.
  • Subset / opt-in: narrower blast radius, but special-cases which extensions propagate to which agents — more config, easy to get inconsistent.

If full parity is fine, I'll send a PR adding the register_enabled_extensions_for_agent call to both paths with tests.

Code references (main @ 7106858)

  • integrations/_migrate_commands.pyswitch calls register_enabled_extensions_for_agent(target); upgrade does not.
  • integrations/_install_commands.pyinstall does not call it.
  • integrations/base.pysetup() installs the integration's own commands only.

Specify CLI Version

main @ 7106858

AI Agent

Codex CLI

Related: #2879 (multi-integration), #2881 / #2885 (agent-context back-fill — surfaced this gap but intentionally left it out of scope).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions