fix: add missing ensureLoaded() calls for lazy extension registries#1056
Merged
fix: add missing ensureLoaded() calls for lazy extension registries#1056
Conversation
PR #1050 converted type registries to lazy loading but missed ensureLoaded() calls in three commands and tab completion, causing user-defined extensions to not be discovered. - model_method_describe: add modelRegistry.ensureLoaded() before createModelMethodDescribeDeps - type_describe: add modelRegistry.ensureLoaded() before createTypeDescribeDeps - vault_type_search: add vaultTypeRegistry.ensureLoaded() before constructing deps - completion_types: make ModelTypeType.complete() async with ensureLoaded() so extension types appear in tab completion Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
CLI UX Review
Blocking
None.
Suggestions
None.
Verdict
PASS — This PR contains no user-facing changes. It fixes a silent bug where user-defined extension types were not discovered by model method describe, type describe, vault type-search, and tab completion. The only observable effect is that these commands now work correctly with extensions, which is a net UX improvement.
There was a problem hiding this comment.
Code Review
No blocking issues found. This is a clean, focused bug fix.
What looks good
- All
ensureLoaded()calls are properlyawaited — no fire-and-forget promises - Imports from domain modules (
../../domain/models/model.ts,../../domain/vaults/vault_type_registry.ts) follow the established pattern used by other CLI commands (model_method_run.ts,workflow_run.ts,type_search.ts) - The libswamp import boundary is respected — no imports from internal libswamp paths
ModelTypeType.complete()correctly changed toasyncwithPromise<string[]>return type- Tests properly updated to
async/awaitto match the new signature - All files retain the AGPLv3 copyright header
- Changes are minimal and focused on the fix
Suggestions
- Consider whether
createModelMethodDescribeDeps()andcreateTypeDescribeDeps()should callensureLoaded()internally (likecreateModelCreateDeps()does), so future callers don't need to remember. This would be a follow-up improvement, not blocking.
stack72
added a commit
that referenced
this pull request
Apr 2, 2026
VaultService.fromRepository() accesses vaultTypeRegistry without loading it first, causing all extension vault tests to fail with "Unsupported vault type". The model validate command similarly calls createModelValidateDeps() without loading the model registry. Add vaultTypeRegistry.ensureLoaded() at the top of fromRepository() and modelRegistry.ensureLoaded() in the model validate command handler. Fixes 6 remaining regression failures from lazy extension loading.
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
PR #1050 converted all type registries (
modelRegistry,vaultTypeRegistry, etc.) from eager loading at CLI startup to lazy loading viasetLoader()/ensureLoaded(). However, three commands and tab completion were missed, causing user-defined extensions fromextensions/models/andextensions/vaults/to not be discovered.Fixes:
model method describe— addedmodelRegistry.ensureLoaded()beforecreateModelMethodDescribeDepstype describe— addedmodelRegistry.ensureLoaded()beforecreateTypeDescribeDepsvault type-search— addedvaultTypeRegistry.ensureLoaded()before constructing depsModelTypeType.complete()— made async withensureLoaded()so extension types appear in tab completionRoot cause: Unlike
createModelCreateDeps()which callsensureLoaded()internally,createModelMethodDescribeDeps()andcreateTypeDescribeDeps()do not — so the CLI command must call it before invoking them.Test plan
deno checkpassesdeno lintpassesdeno fmtpassesextension_vault_test.ts,extension_model_test.ts,method_describe_test.ts,broken_extensions_test.ts,vault_only_pull_test.ts🤖 Generated with Claude Code