Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneesstack72

#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:

  1. Re-runs deno bundle against every extension in extensions/models/ and .swamp/pulled-extensions/**
  2. Emits a wall of swamp-warning: / Rebundle failed lines 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 total

The 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 to lib/ssh.ts), 2 pulled extensions with missing internal modules (@keeb/grafana, @stack72/letsencrypt-certificate). Total time ~8s either way.
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 8 MOREREVIEW+ 3 MOREPR_MERGEDSHIPPED

Shipped

5/1/2026, 8:52:04 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack725/1/2026, 5:07:09 PM

Sign in to post a ripple.