Skip to content

Commit 3aa01f5

Browse files
fix(integration): refresh shared infra on integration switch
`integration switch` previously called _install_shared_infra() with the default force=False, so vendored scripts under .specify/scripts/{bash,powershell}/ from a prior install were preserved even when the new target integration required a newer version. Concretely, an older update-agent-context.sh that did not list 'pi' (or any newer agent) in its supported-agent table would silently override the freshly installed wrapper, producing 'Unknown agent type ...' errors at command time despite the CLI advertising the integration. Pass force=True from integration_switch() so shared infrastructure is rewritten to the bundled CLI version. User content under specs/ is untouched (shared infra is CLI-version-tied, not user content). Fixes #2293
1 parent 171b65a commit 3aa01f5

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/specify_cli/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,9 +2381,13 @@ def integration_switch(
23812381
if integration_options:
23822382
parsed_options = _parse_integration_options(target_integration, integration_options)
23832383

2384-
# Ensure shared infrastructure is present (safe to run unconditionally;
2385-
# _install_shared_infra merges missing files without overwriting).
2386-
_install_shared_infra(project_root, selected_script, invoke_separator=target_integration.effective_invoke_separator(parsed_options))
2384+
# Refresh shared infrastructure to the current CLI version. Switching
2385+
# integrations is exactly when stale vendored shared scripts (e.g.
2386+
# update-agent-context.sh that pre-dates the target integration's
2387+
# supported-agent list) would silently break the new integration, so
2388+
# always overwrite with the bundled copies. User content lives under
2389+
# specs/ and is not touched here. See #2293.
2390+
_install_shared_infra(project_root, selected_script, force=True, invoke_separator=target_integration.effective_invoke_separator(parsed_options))
23872391
if os.name != "nt":
23882392
ensure_executable_scripts(project_root)
23892393

0 commit comments

Comments
 (0)