Skip to content

Canvas Extensions: installation persistence — fix disabled-by-default and self-heal auto-enable #4350

Closed

Description

@VascoSch92

On-disk layout under ~/.openhands/canvas-extensions/installed/<name>/. Reuse InstallationMetadata/InstallationInfo (openhands-sdk/openhands/sdk/extensions/installation/) for .installed.json bookkeeping only — not InstallationManager.install()/.update() unmodified.

Two confirmed issues, with exact locations (verified by running the code against current main):

  • InstallationInfo.enabled defaults to True (info.py:22: enabled: bool = Field(default=True, ...)). InstallationManager.install() only overrides this if existing is not None (manager.py:122-126) — i.e. only on a force-reinstall of an already-tracked name. A genuinely new install keeps the field default. Reproduced directly: a throwaway extension installed via the public API came back enabled=True.
  • InstallationMetadata.discover_untracked() (metadata.py:197-241), the self-healing reconciliation that runs on every list_installed(), builds new entries via InstallationInfo.from_extension(extension, source="local", install_path=item) (metadata.py:238-239) with no enabled= override either — same default applies.
  • Already live behavior for Plugins: install_plugin() (openhands/sdk/plugin/installed.py:57-80) calls .install() with no override at all. The test suite's own setup implicitly confirms this — tests/sdk/extensions/installation/test_installation_manager.py:172-182 has to call manager.disable(...) explicitly before testing that a force-reinstall preserves the disabled state, because a fresh install is known to land enabled. There's no test anywhere asserting a bare fresh install defaults to disabled.

Canvas Extensions must force enabled=False explicitly on every write path that can create a tracked entry — both fresh install and discovery. Neither install() nor InstallationInfo.from_extension() currently accepts an override for this, so it needs to be an explicit post-write correction, or a new keyword added upstream (which would then need auditing against every existing Plugins/Skills call site so their behavior doesn't silently change too).

Regression tests:

  • Install without an explicit enable call → assert disabled.
  • Attempt to smuggle enabled: true in the install request body → assert it's ignored.
  • Manually place a valid extension directory in the install root (bypassing the API) → assert it comes back disabled on next list/get.

Blocked by: #4348

Metadata

Metadata

Assignees

No one assigned

    Labels

    canvas-extensionspriority:highsecurity-related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions