Relationships
#208 swamp model type search is slow (~8s) and re-bundles all extensions on every call
Opened by magistr · 5/1/2026· Shipped 5/1/2026
Description
swamp model type search <query> takes ~8 seconds end-to-end on a repo with a handful of local + pulled extensions, because every invocation:
- Re-runs
deno bundleagainst every extension inextensions/models/and.swamp/pulled-extensions/** - Emits a wall of
swamp-warning:/Rebundle failedlines for any broken or missing module before doing the search
A type search should be a cheap string lookup over registered type names. It shouldn't need to bundle executable code at all — bundling is only relevant when a method is actually executed.
The warnings themselves are mostly fine (they correctly flag broken local symlinks and missing files in pulled extensions), but they shouldn't be triggered by model type search and they shouldn't slow it down.
Steps to reproduce
$ time swamp model type search good-planning --json
... 8 lines of swamp-warning: ... FilesystemLoop / NotFound ...
{"query":"good-planning","results":[{"raw":"@magistr/good-planning","normalized":"@magistr/good-planning"}]}
swamp model type search good-planning --json 4.33s user 1.12s system 66% cpu 8.214 totalThe bundling warnings fire before the search runs — confirming bundling is on the search path.
Expected
swamp model type search should complete in well under a second and should not need to bundle extensions to answer "which type names match this query?". Bundling failures for unrelated extensions should not affect or block a type-name lookup.
Suggested direction
- Decouple type-name discovery from extension bundling. Manifest / type-name index should be readable without invoking the deno bundler.
- If bundling is genuinely needed for some search modes, cache aggressively and skip it for pure name searches.
- At minimum, defer/suppress rebundle warnings for read-only commands like
model type search,model search,model type describe.
Environment
- swamp:
20260501.150516.0-sha.acc85d5a - Platform: macOS (Darwin 23.6.0)
- Repo state: 6 local models in
extensions/models/(5 with a stale broken symlink tolib/ssh.ts), 2 pulled extensions with missing internal modules (@keeb/grafana,@stack72/letsencrypt-certificate). Total time ~8s either way.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.