From 4fdde9d0a85358a00dbf6eab7785ae6fcedeba83 Mon Sep 17 00:00:00 2001 From: Samuel Lee Date: Tue, 27 Jan 2026 16:36:49 -0800 Subject: [PATCH] fix: unwrap AppModuleResolver to find activator in self-healing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The _invalidate_all_install_state() function was looking for _activator directly on the resolver, but when the resolver is an AppModuleResolver, the _activator lives on the wrapped BundleModuleResolver (stored as _bundle). This caused self-healing to always fail with 'No activator found' warning, meaning missing dependency issues would never actually self-heal even though detection worked correctly. Fix by unwrapping AppModuleResolver first, following the same pattern already used in session_spawner.py. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com> --- amplifier_app_cli/session_runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/amplifier_app_cli/session_runner.py b/amplifier_app_cli/session_runner.py index 5181f85..388398a 100644 --- a/amplifier_app_cli/session_runner.py +++ b/amplifier_app_cli/session_runner.py @@ -481,8 +481,11 @@ def _invalidate_all_install_state(prepared_bundle: "PreparedBundle") -> None: """ try: resolver = prepared_bundle.resolver + # Unwrap AppModuleResolver if present (app layer wraps BundleModuleResolver) + # Pattern from session_spawner.py - handle both wrapped and direct cases + bundle_resolver = getattr(resolver, "_bundle", resolver) # Access the activator (BundleModuleResolver stores it as _activator) - activator = getattr(resolver, "_activator", None) + activator = getattr(bundle_resolver, "_activator", None) if not activator: logger.warning("No activator found - cannot invalidate install state") return