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

Adding methods to in-body `methods:{}` on `export const model` doesn't re-register

Opened by swamp_lord · 4/17/2026

Description

For user-defined model types (files using export const model = { type, version, methods: { ... }, ... }), adding a new entry to the methods: object is not picked up by swamp at runtime — the registered type keeps the old method set. Identical functionality works correctly when added in a separate export const extension file.

Steps to reproduce

  1. Start with a repo using a user-defined model type, e.g. extensions/models/mongodb_atlas_access_list.ts with export const model = { type: "@john_yq2i/mongodb-atlas-access-list", version: "2026.04.15.3", methods: { revoke_ip, grant_permanent_ip, grant_temporary_ip } }.
  2. Add a new method list inside the methods: object. Save.
  3. rm -rf ~/.swamp/repos/<repoId>/bundles/*/mongodb_atlas_access_list.js to force a rebundle.
  4. Run swamp model method run swamp-club-atlas list.
  5. Separately, bump version to 2026.04.17.1 and add an upgrade stub — still no change.
  6. Finally, delete the in-body list method and add an identical method via a new file extensions/models/mongodb_atlas_access_list_list.ts with export const extension = { type: "@john_yq2i/mongodb-atlas-access-list", methods: [{ list: { ... } }] }.

Actual behavior

Steps 1–5: swamp model type describe @john_yq2i/mongodb-atlas-access-list --json keeps showing only the original 3 methods. swamp model method run fails with Unknown method 'list' ... Available methods: revoke_ip, grant_permanent_ip, grant_temporary_ip. The regenerated bundle also lacks the list method despite it being in the source file.

Step 6: works immediately. swamp model type describe now shows 4 methods; the method runs fine.

Expected behavior

Adding a method in either location — in-body methods: on export const model, or via export const extension — should behave the same way. Both should pick up edits from source on the next run (after bundle invalidation). Having to move code between files to make a method "stick" is surprising.

Environment

  • swamp: 20260414.220725.0-sha.e36340de on darwin aarch64
  • Model type version: 2026.04.15.3
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED+ 1 MOREASSIGNED

Closed

4/24/2026, 5:06:02 PM

No activity in this phase yet.

03Sludge Pulse
stack72 assigned stack724/17/2026, 9:42:19 PM
Editable. Press Enter to edit.

stack72 commented 4/24/2026, 5:06:00 PM

We've not been able to recreate this - closing it out and we can open fresh if needed

Sign in to post a ripple.