[Bug]: bundle update suggests unsupported --force after extension refresh failure
Bug Description
specify bundle update --all can fail when a bundle owns an already-installed extension, then suggests retrying with --force.
However, specify bundle update does not support --force, so the suggested recovery path is invalid.
This looks like a mismatch between bundle refresh semantics and lower-level extension install semantics.
Steps to Reproduce
-
Have a Spec Kit project with an installed bundle that owns the
gitextension. -
Run:
specify bundle update --all -
Observe that the command fails because
gitis already installed. -
Follow the suggested recovery and run:
specify bundle update --all --force -
Observe that
--forceis rejected becausebundle updatehas no such option.
Expected Behavior
specify bundle update --all should refresh bundle-owned installed components successfully.
If refresh cannot proceed, the error should provide a valid bundle-level recovery path and should not suggest --force unless bundle update actually supports it.
Actual Behavior
The first command fails with an extension-level duplicate-install error:
Error: Failed to install bundle 'basic-speckit-c8volt-stack': Extension 'git' is already installed. Use 'specify extension remove git' first, or retry with --force to overwrite.. No changes were recorded.
Retrying with the suggested --force flag fails because bundle update does not expose that option:
Usage: specify bundle update [OPTIONS] [BUNDLE_ID]
Try 'specify bundle update --help' for help.
โญโ Error โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ No such option: --force โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Specify CLI Version
0.12.8
AI Agent
GitHub Copilot
Operating System
macOS Tahoe 26.5.1
Python Version
3.13.5
Error Logs
โฏ specify bundle update --all
Error: Failed to install bundle 'basic-speckit-c8volt-stack': Extension 'git' is already installed. Use 'specify extension remove git' first, or retry
with --force to overwrite.. No changes were recorded.
โฏ specify bundle update --all --force
Usage: specify bundle update [OPTIONS] [BUNDLE_ID]
Try 'specify bundle update --help' for help.
โญโ Error โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ No such option: --force โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Additional Context
From local inspection, bundle update calls install_bundle(..., refresh=True). For owned existing components, _refresh_component() prefers a primitive refresh() hook, but DefaultPrimitiveInstaller currently does not implement one, so it falls back to installer.install(...).
For extensions, plain install rejects already-installed extensions unless force=True, producing the leaked extension-level message.
This appears broader than wording: bundle update documents refresh semantics, but the real default primitive adapter can fall back to duplicate install semantics for extensions.
Bug assessment โ bundle-update-force-mislead: Valid ยท severity medium
Bug Assessment: bundle update suggests unsupported --force after extension refresh failure
- Slug:
bundle-update-force-mislead - Created: 2026-07-09T16:02:23Z
- Source: issue #3424
- Verdict: valid
- Severity: medium
Report (summarized)
Reported by @grafvonb. Running specify bundle update --all on a project whose bundle owns the git extension fails with an extension-level error that suggests retrying with --force. However, specify bundle update has no --force option, so the suggested recovery path is invalid and leaves the user stuck.
Symptom
specify bundle update --all raises a BundlerError that contains an extension-level message advising --force, which bundle update does not support; the user has no valid bundle-level recovery path and the update silently makes no changes.
Reproduction
- Create a Spec Kit project with a bundle installed that owns the
gitextension (e.g.basic-speckit-c8volt-stack). - Run
specify bundle update --all. - Observe the error:
Failed to install bundle '...': Extension 'git' is already installed. Use 'specify extension remove git' first, or retry with --force to overwrite.. No changes were recorded. - Follow the suggested recovery and run
specify bundle update --all --force. - Observe:
No such option: --forceโbundle updaterejects the flag.
Suspected Code Paths
src/specify_cli/bundler/services/installer.py:206-220โ_refresh_component(): triesinstaller.refreshattribute; falls back toinstaller.install()when none is found. This fallback is the trigger.src/specify_cli/bundler/services/installer.py:155-163โinstall_bundle()except Exceptionhandler: wraps any raised exception verbatim intoBundlerError, propagating the extension-level--forcehint unchanged.src/specify_cli/bundler/services/adapters.py:164-197โDefaultPrimitiveInstaller: implementsis_installed,install, andremoveon thePrimitiveInstallerprotocol, but has norefreshmethod, so_refresh_component()'sgetattr(installer, "refresh", None)resolves toNoneand the fallback path is always taken.src/specify_cli/bundler/services/primitives.py:226-280โ_ExtensionKindManager.install(): delegates toExtensionManager.install_from_directory(..., force=False)(default), which raisesExtensionErrorwhen the extension is already installed andforceisFalse.src/specify_cli/extensions/__init__.py:1354-1361โExtensionManager.install_from_directory(): the guarded block that raisesExtensionErrorwith the--forceadvice whennot force and is_installed.
Root Cause Hypothesis
Confidence: high.
_refresh_component() is designed to prefer a refresh hook on the installer and fall back to install(). The unit test test_refresh_falls_back_to_install_without_hook validates this path using FakeInstaller, whose install() is idempotent (does not raise on double-install). In production, DefaultPrimitiveInstaller has no refresh method, so the fallback fires โ but DefaultPrimitiveInstaller.install() is not idempotent for extensions: it ultimately calls ExtensionManager.install_from_directory() with force=False, which raises ExtensionError when the extension is already present. The BundlerError wrapping in install_bundle() then surfaces that error verbatim, embedding the extension-level --force hint in a message that appears to be actionable via bundle update, which does not support --force.
There are two overlapping defects:
- Functional:
DefaultPrimitiveInstallerlacks arefreshmethod that passesforce=True(or equivalent) to the underlying primitives, making bundle refresh semantically broken for extensions. - UX: the leaked extension-level error message suggests an option that
bundle updatedoes not expose.
Proposed Remediation
Preferred: Add a refresh() method to DefaultPrimitiveInstaller (in adapters.py) that delegates to a refresh() method on each kind manager. Each kind manager then calls the underlying primitive with the equivalent of force=True:
_ExtensionKindManager.refresh()โ callsinstall_from_directory(..., force=True)orinstall_from_zip(..., force=True)(both already acceptforce: bool = False). This path is already exercised byExtensionManagerโ addingforce=Trueat the bundler adapter layer is the minimal and safe change._PresetKindManager.refresh()โ the presetinstall_from_directory()does not expose aforceparameter; a minimal approach isremove()theninstall(), or addforcetoPresetManager.install_from_directory()first._WorkflowKindManager.refresh()and_StepKindManager.refresh()โ they delegate to CLI command callables; their underlyingworkflow_add/workflow_step_addlikely handle idempotency already, so the fallback-to-install path may already work, but should be verified.
Once the refresh hook exists on DefaultPrimitiveInstaller, _refresh_component() will call it instead of install(), and the --force hint will never surface in the bundle context.
Alternatives:
- Change
_refresh_component()fallback toremove()+install(): Avoids addingforceeverywhere, but introduces atomicity risk โ ifremove()succeeds andinstall()fails, the component is gone. More complex rollback would be needed. - Suppress or rewrite the error message in
install_bundle(): A cosmetic fix that replaces the extension-level--forcehint with a bundle-level message (e.g. "re-runspecify bundle update"). This unblocks users with a helpful message but does not fix the underlying failure. - Add
--forcetobundle update: Surfaces the ability to force-refresh to users, but this exposes more surface area and would require plumbingforcethroughinstall_bundle()and down to each kind manager anyway.
Files likely to change:
src/specify_cli/bundler/services/adapters.pyโ addrefresh()toDefaultPrimitiveInstallersrc/specify_cli/bundler/services/primitives.pyโ addrefresh()to_ExtensionKindManager(and verify/add for other kind managers)src/specify_cli/presets/__init__.pyโ may needforceparameter added toinstall_from_directory()if the preferred approach is used for presetstests/unit/test_bundler_primitives.pyโ add tests for the newrefresh()pathstests/integration/test_bundler_install_flow.pyโ strengthen the existingtest_refresh_falls_back_to_install_without_hookor add a new integration test that exercises the realDefaultPrimitiveInstallerrefresh path
Tests to add or update:
- Unit test:
_ExtensionKindManager.refresh()callsinstall_from_directorywithforce=True - Integration test:
bundle updatewith an already-installed bundle-owned extension completes without error (usesDefaultPrimitiveInstalleragainst a real extension on disk) - Regression test: the leaked
--forcehint no longer appears inBundlerErrormessages frombundle update
Risks & Considerations
- Preset force-overwrite:
PresetManager.install_from_directory()does not currently acceptforce. If the preferred fix is applied to presets viaremove()+install(), test atomicity carefully. - Workflow/step idempotency:
_WorkflowKindManager.install()and_StepKindManager.install()delegate to CLI callables; verify those callables are idempotent for already-installed items before relying on the existinginstall()fallback. - No API breakage:
PrimitiveInstalleris aProtocol; addingrefreshtoDefaultPrimitiveInstalleris backwards compatible._KindManageris also aProtocol; addingrefreshis non-breaking for existing test fakes. - Test isolation: existing test
test_refresh_falls_back_to_install_without_hookusesFakeInstallerwithrefresh = None; this test should continue to pass (the fallback path is still valid for custom installers without a refresh hook), but the production path will now exercise the newrefreshmethod.
Open Questions
- [NEEDS CLARIFICATION: Does
PresetManager.install_from_directory()silently overwrite an existing preset, or does it also reject double-installs? This determines whether presets are affected by the same root cause or only extensions.] - [NEEDS CLARIFICATION: Are
workflow_addandworkflow_step_addidempotent when the workflow/step is already installed? If so, the fallback-to-install path already works for those kinds and only extensions (and possibly presets) need the fix.]
Generated by ๐ Assess Bug from Labeled Issue for issue #3424 ยท 258.1 AIC ยท โ 31.3 AIC ยท โ 31.8K ยท โท
Pull request created: #3452
Generated by Fix Bug from Labeled Issue ยท 1.7K AIC ยท โ 16.4 AIC ยท โ 35.6K
Posted on behalf of @mnriem by GitHub Copilot (model: claude-sonnet-4.6, autonomous)
A draft PR has been opened on branch fix/3424-bundle-update-force-mislead with the fix for bundle-update-force-mislead.
What changed: Added refresh() to DefaultPrimitiveInstaller (and all kind managers) so _refresh_component() uses force=True for extensions and presets instead of falling back to a bare install(). This eliminates the leaked extension-level --force hint from BundlerError during bundle update. Also added force parameter to PresetManager.install_from_directory() and install_from_zip() to mirror extension semantics.
Files changed: adapters.py, primitives.py, presets/__init__.py, tests/unit/test_bundler_primitives.py.
Next step: Please review the draft PR. If the repository has the stage-3 bug-test workflow configured, applying the appropriate label after merging will run the automated test validation stage.
Generated by ๐ ๏ธ Fix Bug from Labeled Issue for issue #3424 ยท 1.7K AIC ยท โ 16.4 AIC ยท โ 35.6K ยท โท
Bug test โ bundle-update-force-mislead: โ ๏ธ inconclusive ยท 0 passed, 0 failed, 0 skipped ยท fix from PR #3452 (branch fix/3424-bundle-update-force-mislead-5dabdaccdc652640, SHA c36667e)
Bug Test Report: bundle update suggests unsupported --force after extension refresh failure
- Slug:
bundle-update-force-mislead - Date: 2026-07-10
- Source issue: #3424
- Fix under test: PR #3452 โ branch
fix/3424-bundle-update-force-mislead-5dabdaccdc652640, head SHAc36667ecb44b42d5c5bb24732a6e841fc584848f - Test command:
[NEEDS CLARIFICATION: dependency install blocked by firewall โ pytest unavailable] - Scope: N/A โ no tests executed
- Result: inconclusive
Summary
The fix branch (PR #3452) was successfully checked out. However, the test run could not be completed because the CI runner's firewall blocks all outbound connections to PyPI (403 Forbidden), preventing installation of pytest and the project's own dependencies. No tests were executed; the result is inconclusive due to environment/setup failure, not due to any fault in the fix itself.
Test Results
| Metric | Count |
|---|---|
| Passed | 0 |
| Failed | 0 |
| Skipped | 0 |
| Errored | 0 (setup failure โ no tests reached) |
| Duration | N/A |
Failures (if any)
None (no tests ran).
Verification vs. Historical Fix
Not applicable (no historical fix referenced โ PR #3452 is the proposed fix and has not been merged).
Notes & Caveats
- Root cause of inconclusive result: The CI runner blocks PyPI (
pip install pytestreturns403 Forbiddentunnel error). The project has no pre-installed virtualenv or local wheel cache. Withoutpytestand project dependencies installed, the test suite cannot be imported or executed. - Relevant test files identified (from assessment):
tests/unit/test_bundler_primitives.pyโ new tests added by the fix:test_extension_refresh_calls_install_with_force,test_preset_refresh_calls_install_with_force,test_default_installer_refresh_dispatches_to_kind_manager,test_no_force_hint_in_bundler_error_on_refreshtests/integration/test_bundler_install_flow.pyโ existing integration tests for bundle install lifecycle
- What would unblock a real test run: either (a) configure the workflow to install Python dependencies before the
bug-testagent runs (e.g., auv sync --extra testorpip install -e ".[test]"step), or (b) allow outbound PyPI traffic in the firewall policy. - PR #3452 is a draft โ the fix was produced by the automated
bug-fixstage and is pending human review. The PR description notes that no project test command was runnable in that environment either (same firewall constraint). - Code inspection: The fix diff is syntactically valid (confirmed by the
bug-fixstage viaast.parse). The approach โ addingrefresh()toDefaultPrimitiveInstallerand all kind managers, withforce=Truefor extensions and presets โ directly addresses both defects identified in the assessment (functional: missingrefreshhook; UX: leaked--forcehint).
Unverified
(No suspicious or instruction-like content encountered in the issue body, comments, or fetched pages.)
Generated by ๐งช Test a Bug Fix from a Labeled Issue for issue #3424 ยท 653.8 AIC ยท โ 10.9 AIC ยท โ 36.1K ยท โท