Skip to content

Commit 7eeacf1

Browse files
committed
docs: clarify extension registration parity scope
1 parent 8918c0e commit 7eeacf1

5 files changed

Lines changed: 19 additions & 20 deletions

File tree

src/specify_cli/extensions.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,16 +1637,12 @@ def unregister_agent_artifacts(self, agent_name: str) -> None:
16371637
def register_enabled_extensions_for_agent(self, agent_name: str) -> None:
16381638
"""Register installed, enabled extensions for ``agent_name``.
16391639
1640-
This is intended to be called after switching integrations. Command
1641-
registration is scoped to the explicit ``agent_name`` argument, but some
1642-
behavior still depends on the current init-options state (for example,
1643-
skills-mode handling uses the active ``ai`` / ``ai_skills`` settings).
1644-
1645-
Callers should therefore pass the agent that has just been made active
1646-
in init-options; in normal use, ``agent_name`` is expected to match the
1647-
current ``ai`` value. This mirrors extension install behavior while
1648-
avoiding stale default-mode command directories when that active agent
1649-
is running in skills mode (notably Copilot ``--skills``).
1640+
Command-file registration is scoped to the explicit ``agent_name``
1641+
argument, so this method can be used after install, upgrade, or switch.
1642+
Extension skill rendering is still scoped to the active ``ai`` /
1643+
``ai_skills`` settings in init-options, so non-active skills-mode
1644+
targets receive command files here. Per-agent skills parity is tracked
1645+
separately in #2948.
16501646
"""
16511647
if not agent_name:
16521648
return

src/specify_cli/integrations/_helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ def _register_extensions_for_agent(
425425
426426
``switch`` has always re-registered enabled extensions for the agent it
427427
activates; ``install`` and ``upgrade`` call this so a newly added (or
428-
refreshed) agent reaches the same parity — every installed agent ends up
429-
with every enabled extension's commands. See issue #2886.
428+
refreshed) agent reaches command-registration parity. See issue #2886.
430429
431430
Known limitation: extension *skill* rendering is scoped to the active
432431
agent (init-options track a single ``ai`` / ``ai_skills`` pair). A

src/specify_cli/integrations/_install_commands.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,11 @@ def integration_install(
190190
raise typer.Exit(1)
191191

192192
# Register enabled extensions for the newly installed agent so it gets the
193-
# same extension commands the existing agents already have (full parity with
194-
# switch); otherwise a second integration silently lacks the first agent's
195-
# extension commands. See #2886. Done after the try/except (the install has
196-
# committed) so this best-effort step can never trigger the rollback above.
193+
# same extension commands the existing agents already have for command
194+
# registration parity with switch; otherwise a second integration silently
195+
# lacks the first agent's extension commands. See #2886. Done after the
196+
# try/except (the install has committed) so this best-effort step can never
197+
# trigger the rollback above.
197198
_register_extensions_for_agent(
198199
project_root,
199200
integration.key,

src/specify_cli/integrations/_migrate_commands.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,10 @@ def integration_upgrade(
475475

476476
# Re-register enabled extensions for the upgraded agent so its extension
477477
# commands are (re)created — including agents installed before this
478-
# back-fill existed. Mirrors switch; see #2886. Done after the upgrade has
479-
# fully settled (Phase 2 included) and outside the try/except above so this
480-
# best-effort step cannot affect upgrade success.
478+
# back-fill existed. Mirrors switch for command registration; see #2886.
479+
# Done after the upgrade has fully settled (Phase 2 included) and outside
480+
# the try/except above so this best-effort step cannot affect upgrade
481+
# success.
481482
_register_extensions_for_agent(
482483
project_root,
483484
key,

tests/integrations/test_integration_subcommand.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,9 @@ def test_install_registers_extension_commands_for_new_agent(self, tmp_path):
12451245
Regression for #2886: only ``switch`` used to register extension
12461246
commands for the newly active agent, so a second integration added via
12471247
``install`` was silently missing the extension commands the first agent
1248-
had. ``install`` must reach full parity with ``switch``.
1248+
had. ``install`` must reach command-registration parity with
1249+
``switch``; active-agent-scoped extension skill rendering remains
1250+
tracked in #2948.
12491251
"""
12501252
project = _init_project(tmp_path, "claude")
12511253

0 commit comments

Comments
 (0)