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

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

  1. Add a method list to extensions/models/digitalocean_app_platform_list.ts with writeResource("apps", ...).
  2. Run swamp model method run telemetry list — fails with "Undeclared resource spec 'apps'".
  3. Edit the source to drop the writeResource call entirely (method now returns { dataHandles: [] }).
  4. Run swamp model method run telemetry list again.

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.js

Next 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.e36340de on darwin aarch64
  • Bundle dir: ~/.swamp/repos/b1b78ea0-7a12-47a4-888e-e99db597d49c/bundles/e9c5c01e/
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 8 MOREREVIEW+ 3 MOREPR_MERGEDSHIPPED

Shipped

4/17/2026, 11:14:24 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack724/17/2026, 9:41:29 PM

Sign in to post a ripple.