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

Relationships

#1165 swamp extension update doesn't migrate existing model instances to the new typeVersion — new methods are 'Unknown' (persists after #869)

Opened by vcjdeboer · 7/15/2026

Follow-up to #869 (marked shipped, but this still reproduces — I added a fresh repro as a comment there: https://swamp-club.com/lab/869). Filing a distinct, open bug for the specific unresolved path: swamp extension update does not migrate an existing model instance to the new typeVersion, so methods/reports shipped in the new version never become available on that instance.

Description

Methods are resolved from the compiled bundle keyed by the instance typeVersion. swamp extension update advances the extension (pulled code + lockfile) but leaves existing instances pinned at their creation version, and there is no swamp model upgrade. Consequence: a newly-shipped method is Unknown and report/bundle resolution keeps using the old version's code, on any pre-existing instance.

Steps to reproduce (clean; no force-pull, no S3)

  1. Instance ingest of @vcjdeboer/session-ingest created at typeVersion 2026.07.12.1.
  2. Publish 2026.07.15.2, adding a new method status (with an upgrades[] identity entry).
  3. swamp extension update @vcjdeboer/session-ingest → real update reported: v2026.07.15.1 -> v2026.07.15.2, "1 updated".
  4. swamp model get ingest still shows typeVersion: 2026.07.12.1; swamp model method run ingest statusUnknown method 'status'.
  5. Bump the definition file typeVersion to .15.2 + swamp model evaluate ingest: evaluated definition now reads .15.2, but status is still Unknown and the instance is still .12.1.
  6. swamp doctor extensions only lists (... @2026.07.15.2 [pulled] 2 source(s)); no recompile/rebuild in this build.

Expected

A non-destructive way to advance an existing instance's typeVersion (e.g. swamp model upgrade <name>, or extension update migrating instances via the upgrades[] chain) so new methods/reports load without delete+recreate (which loses the instance).

Workaround

Only two, both poor: delete + recreate the model (loses the instance/state), or hand-overwrite the specific cached bundle .js under .swamp/report-bundles/<hash>/ (fragile; breaks on cache clear).

Corroborating signal

Unrelated user models fail to load on every run with Last upgrade toVersion X does not match model version Y (@alvagante/content-blog-post, @magistr/obsidian/vault) — same model-versioning-mismatch family.

Environment

swamp 20260711.205210.0-sha.c8b5c983; macOS (darwin 25.2.0); local repo; extension @vcjdeboer/session-ingest (locally developed, installed/lockfile at .15.2, instance frozen at .12.1).

02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

7/17/2026, 3:34:59 PM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

vcjdeboer commented 7/15/2026, 8:35:08 PM

Confirmed: still reproduces after swamp update to the latest build 20260715.175955.0-sha.4d2897c1 (was 20260711.205210.0-sha.c8b5c983). On the new binary the full ladder was tried and none migrate the existing instance:

  • swamp extension update @vcjdeboer/session-ingest → no-op ("already up to date v2026.07.15.2")
  • swamp model evaluate ingest → rewrites the evaluated definition only
  • swamp repo upgrade → updates repo settings/skills only

Instance remains typeVersion: 2026.07.12.1; swamp model method run ingest status still returns Unknown method 'status'. So the instance-migration gap is not addressed in 20260715.

stack72 commented 7/17/2026, 3:34:42 PM

Thanks for the detailed repro @vcjdeboer — this helped us track down what's happening.

There are two separate things going on here, and only one of them is a bug.

What we fixed in https://github.com/swamp-club/swamp/pull/1882

The "Unknown method" problem after extension update is caused by local source shadowing. When you have an extension both locally developed (source in a local models dir or .swamp-sources.yaml mount) and installed via the lockfile, resolveOriginConflicts silently clears the pulled entry's type in favor of the local source. So after swamp extension update pulls the new version, the local (old) source still wins — new methods aren't visible, and you get no feedback about why.

swamp extension update now warns when this happens, showing which types are shadowed and which local source is winning. The fix is to update your local source or remove it so the pulled version takes effect.

What's by design (for now)

The typeVersion on the model instance not advancing after extension update is intentional — extension update and model upgrade are separate concerns. extension update pulls new extension code. Model upgrade (advancing the instance's typeVersion and running upgradeAttributes on globalArguments) is opt-in and currently triggers as a side effect when you next run a method via swamp model method run, provided the extension model has an upgrades[] stanza.

There's no standalone swamp model upgrade command today. We may add one in the future, but it's not blocking method availability — new methods load from the model type registry regardless of the instance's stored typeVersion. The typeVersion field only controls the upgradeAttributes migration chain for globalArguments. There is work planned for this soon(ish)

The "corroborating signal"

The Last upgrade toVersion x does not match model version y errors from other users (@alvagante/content-blog-post, @magistr/obsidian/vault) are a different issue — that's a validation failure where the extension author's upgrades[] stanza doesn't match their model version field. Those models fail to register entirely. We can track that separately if it's still reproducing.

vcjdeboer commented 7/17/2026, 3:47:20 PM

Confirmed resolved on this machine following your guidance — swamp 20260717.145236.0-sha.d0b3b256. Root cause was exactly local source shadowing. A few details that may be useful:

It was TWO shadows, per source-kind — and fixing one leaves a confusing half-working state. The suite is split (published + lockfile) but this repo also keeps pre-split local copies. There were two stale .12.1 shadows of @vcjdeboer/session-ingest:

  • extensions/models/ (the default local models dir) shadowed the methods → the newly-published status method was Unknown method.
  • extensions/reports/ (the local reports dir) separately shadowed the report@vcjdeboer/capture-report kept rendering the wrong session.

Updating only extensions/models/ made status resolve correctly — but capture-report still ran the stale code from extensions/reports/. So a user can fix the models shadow, watch methods start working, and be baffled that a report (or other source-kind) is still stale. What fully worked: sync both local source dirs to the published version, then rm -rf .swamp/report-bundles/<hash> to force a recompile. Methods + report then both correct.

On the #1882 warning: I didn't see it fire here — swamp extension update @vcjdeboer/session-ingest printed "already up to date (v2026.07.15.2)" and no-op'd, because I'd pull --forceed the new version into the lockfile earlier, so update had nothing to pull. The shadow warning seems tied to an actual pull; when the lockfile is already current but a stale local source shadows it, extension update stays silent. A shadow check that also runs on the "already up to date" path (or in swamp doctor) would catch that variant.

Confirming your typeVersion point: the instance is still typeVersion 2026.07.12.1 and never advanced, yet every method incl. the new status is now available — so "methods load from the type registry regardless of the stored typeVersion" holds exactly here. 👍

Unrelated FYI (separate, not asking you to chase it): on this build swamp data query / swamp data list return 0 rows for models that demonstrably have data (swamp data get still works) — it surfaced as "0 local" in the new status output. Happy to open a clean repro if that's useful; otherwise ignore.

Thanks for the quick turnaround on #1882.

Sign in to post a ripple.