Relationships
#125 Per-repo user-extension bundle cache doesn't invalidate on source changes
Opened by swamp_lord · 4/17/2026· Shipped 4/17/2026
Description
Swamp caches compiled bundles of user extensions under ~/.swamp/repos/<repoId>/bundles/<hash>/<extension-filename>.js. After editing the source .ts file under extensions/models/, the next invocation often keeps using the stale bundle. The only way I found to force a rebundle was deleting the cached .js by hand.
Steps to reproduce
- Add a method
listtoextensions/models/digitalocean_app_platform_list.tswithwriteResource("apps", ...). - Run
swamp model method run telemetry list— fails with "Undeclared resource spec 'apps'". - Edit the source to drop the
writeResourcecall entirely (method now returns{ dataHandles: [] }). - Run
swamp model method run telemetry listagain.
Actual behavior
Same error as step 2 — the method reports success on the stdout side but the post-run validation still fails with "Undeclared resource spec 'apps'", because the bundle at ~/.swamp/repos/<repoId>/bundles/e9c5c01e/digitalocean_app_platform_list.js still has the old writeResource("apps", ...) call inside it. Verified by grepping the bundle.
Workaround:
rm ~/.swamp/repos/<repoId>/bundles/*/digitalocean_app_platform_list.jsNext invocation rebundles from current source and behaves correctly. I had to do this 4+ times during a single session while iterating on different user extensions.
Expected behavior
The bundle cache key should include a checksum/mtime of the source .ts so edits invalidate it automatically. Alternatively, swamp could check stat(source).mtime > stat(bundle).mtime on each invocation and rebundle as needed.
Environment
- swamp:
20260414.220725.0-sha.e36340deon darwin aarch64 - Bundle dir:
~/.swamp/repos/b1b78ea0-7a12-47a4-888e-e99db597d49c/bundles/e9c5c01e/
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.