Skip to content

[Bug]: agent-context extension is only installed by 'specify init' — other paths write an inert config that stops updating context files at v0.12.0 #2881

@PascalThuet

Description

@PascalThuet

Bug Description

specify init is the only code path that installs and registers the bundled agent-context extension (commands/init.py:464). The specify integration install, integration switch, and integration upgrade commands write/refresh its config file (.specify/extensions/agent-context/agent-context-config.yml) without installing the extension.

So a project managed through the integration commands ends up with an inert config: the .yml exists, but the extension is absent on disk and unregistered. Context files still get updated today only because the deprecated inline updater runs while the extension is missing. When inline updates are removed in v0.12.0, a project in this state stops updating its context files.

Note: re-running specify init --here --force does back-fill the extension (the init block is idempotent via is_installed), so a full re-init recovers. The gap is that the integration commands don't, and they silently drop an inert config in the meantime — which is easy to miss.

Steps to Reproduce

  1. Use a project without the agent-context extension (e.g. initialized before PR Extract agent context updates into bundled agent-context extension #2546).
  2. Run specify integration install <agent> (or switch / upgrade).
  3. Observe: .specify/extensions/agent-context/agent-context-config.yml is written, but .specify/extensions/.registry has no agent-context entry and .specify/extensions/agent-context/ contains only the .yml (no extension.yml/scripts//commands/).

Expected Behavior

integration install / switch / upgrade should ensure the agent-context extension is installed and registered (the same back-fill specify init already does), or not write its config when the extension is absent. A project should never be left with a config that nothing reads.

Actual Behavior

The config is written unconditionally (_save_agent_context_config does mkdir+write with no registration check); the extension is installed only by specify init. The deprecation notice claims the extension manages context, but the integration commands leave it absent — an inert config now, and frozen context files after v0.12.0 unless the user happens to re-run init --force.

Specify CLI Version

0.9.3 (root cause present on main @ 7106858)

AI Agent

Claude Code

Additional Context

References on main (@ 7106858):

  • commands/init.py:464 — only installer of agent-context (idempotent; re-init back-fills it).
  • integrations/_install_commands.py — install path: no extension install; only calls _update_init_options_for_integration.
  • integrations/_migrate_commands.pyswitch only re-registers already-installed extensions (register_enabled_extensions_for_agent, :278); upgrade (:339) runs shared-infra + config update but never installs the extension.
  • integrations/_helpers.py:308-321 — writes the config even when, per its own comment, "the extension is not installed".
  • __init__.py:300 (_save_agent_context_config) — mkdir+write, no registration check.
  • integrations/base.py:587 — inline path still runs while the extension is absent (masks the bug until v0.12); :699 prints the deprecation notice.

Reproduced on a real 0.9.3 project: registry lists only git; agent-context/ holds just the 101-byte config.

Related: #2879 (multi-file divergence); #2319 / #2320 (--force shared-infra overwrite — different scope, predates this extension).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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