fix: read nested bundle URIs from in-memory registry in bundle list --all#92
Open
colombod wants to merge 1 commit intomicrosoft:mainfrom
Open
fix: read nested bundle URIs from in-memory registry in bundle list --all#92colombod wants to merge 1 commit intomicrosoft:mainfrom
colombod wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…-all The get_bundle_categories() method read nested bundle and dependency URIs from ~/.amplifier/registry.json on disk, which could contain stale git+ URIs that don't reflect current local path overrides from settings.local.yaml. Changed to read from the in-memory BundleRegistry (via get_state()) which has current overrides applied, aligning the --all view with the default bundle list view that already reads from in-memory state. Fixes: microsoft-amplifier/amplifier-support#62 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the display half of microsoft-amplifier/amplifier-support#62.
amplifier bundle list --allshowed GitHub URLs for nested bundles even when the parent bundle was overridden to a local path viasettings.local.yaml. The nested bundles and dependencies categories read URIs from stale~/.amplifier/registry.jsonon disk instead of the in-memory registry that has current overrides applied.Root Cause
get_bundle_categories()indiscovery.pyused three inconsistent data sources for its output categories:_find_packaged_bundle()AppSettings().get_added_bundles()~/.amplifier/registry.jsonon disk~/.amplifier/registry.jsonon diskThe default
bundle listview (without--all) already correctly reads from the in-memory registry viadiscovery.find(). The--allview was the only inconsistent path.Change
Replaced the
registry.jsonfile-read block withself._registry.get_state()which returns the in-memoryBundleStateobjects that reflect current session state including local overrides.Before (read from disk):
After (read from in-memory registry):
The output format and category logic are preserved exactly — only the data source changes.
Evidence
Diff stats
amplifier_app_cli/lib/bundle_loader/discovery.py: +25/−33 lines (net reduction — simpler code)tests/lib/bundle_loader/test_discovery.py: +146 lines (NEW file, 3 regression tests)Test results
amplifier-app-clifull suiteNote: app-cli tests were run with the local
amplifier-foundationcheckout (including the companion PR's changes) viauv pip install -e+uv run --no-sync, sinceBundleState.explicitly_requestedis needed at runtime.New regression tests (
TestGetBundleCategoriesNestedURIs)test_nested_bundles_reflect_in_memory_stateBundleStateentries appear inget_bundle_categories()output with correct URIstest_stale_persisted_uri_not_used_for_nested_bundlesregistry.jsonhas agit+URI but in-memory state has been updated tofile://, the output reflects the in-memory URItest_dependencies_reflect_in_memory_stateincluded_bymetadataCompanion PR
This is the second of two PRs for issue #62. The companion PR is microsoft/amplifier-foundation#83 which fixes the persistent state in
BundleRegistry._load_single(). The foundation PR should merge first (it fixes the persistent state), then this PR (it fixes the display).Together, both PRs ensure:
bundle list --allreads from refreshed in-memory state, not stale disk dataHow to verify end-to-end
After both PRs merge:
bundle.added.foundation: ../../amplifier-foundationtosettings.local.yamlamplifier bundle list --allgit+GitHub URLs