mpak update reports success without actually updating the cache

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
34/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
backend, cli

Research direction

Start by locating the mpak update and mpak outdated command entry points, then trace how each reads registry versions and writes bundle data to the cache. Reproduce with a cached bundle whose registry version is newer and inspect whether the cache metadata and extracted files change. Done means update reports success only after the cache is updated, and outdated lists cached bundles with newer registry versions.

Written by the indexing model from the issue text.

Description

Problem

mpak update <package> (and the top-level mpak update alias) reports success but performs a silent no-op when a newer version is available on the registry. Neither .mpak-meta.json, the cache manifest.json, nor the extracted dist-info directories change — the tool prints "Updated to X.Y.Z" and exits 0 while the cache on disk remains at the previous version.

This is distinct from #60 (which is about bundle run using stale cache after a successful bundle pull). In this report, update itself does nothing but claims it did.

Environment

  • mpak --version: 0.4.1
  • Platform: linux/x64 (nimblebrain/agent-platform pod, Node 20)
  • Cache location: /data/apps/cache/<package>/

Reproduction

The agent-platform pod for our hq tenant had @nimblebraininc/[email protected] cached. Registry had 0.4.0 available and addressable (mpak bundle show @nimblebraininc/synapse-collateral correctly reported v0.4.0).

$ mpak bundle show @nimblebraininc/synapse-collateral | head -2
🔒 @nimblebraininc/synapse-collateral v0.4.0

$ cat /data/apps/cache/nimblebraininc-synapse-collateral/.mpak-meta.json
{
  "version": "0.3.3",
  "pulledAt": "2026-04-15T08:58:18.083Z",
  ...
}

$ mpak update @nimblebraininc/synapse-collateral
Updated @nimblebraininc/synapse-collateral to 0.4.0

$ cat /data/apps/cache/nimblebraininc-synapse-collateral/.mpak-meta.json
{
  "version": "0.3.3",          ← unchanged
  "pulledAt": "2026-04-15T08:58:18.083Z",   ← unchanged
  ...
}

$ find /data/apps/cache/nimblebraininc-synapse-collateral -name "mcp_collateral-*.dist-info"
/data/apps/cache/nimblebraininc-synapse-collateral/deps/mcp_collateral-0.3.3.dist-info   ← unchanged

stat-confirmed: manifest.json in the cache was not rewritten. No network activity visible. The command returned exit 0 and printed a success message.

mpak outdated also misreports state on the same cache:

$ mpak outdated
=> Checking for updates...
All cached bundles are up to date.

— despite the cache being at 0.3.3 and 0.4.0 being available (also 0.1.0 → 0.2.0 for two other bundles in the same cache dir).

Expected behaviour

One of:

  1. mpak update <pkg> re-fetches the bundle tarball from the registry, overwrites .mpak-meta.json, re-extracts into the cache, and only then prints success. On any failure, it exits non-zero with a clear error.
  2. If no action is taken (e.g. cache is up-to-date, network failure, lockout), it either prints "Already up to date" or a precise failure — never "Updated to X.Y.Z" for a no-op.

mpak outdated should compare each cached bundle's .mpak-meta.json version against the registry's latest and list mismatches.

Workaround

Until fixed, the working sequence is:

$ rm -rf /data/apps/cache/<scoped-package-name>/
$ # restart the consumer (pod / agent-platform / whatever runs prepareServer)
$ # fresh prepare repopulates the cache from registry

This reliably gets the current version on disk. Scoped to one bundle so sibling bundles aren't disturbed.

Impact

  • Prod tenants run stale bundle code indefinitely even after mpak update is invoked as part of operational hygiene. The success message makes it look like maintenance worked.
  • Debugging is misleading. A dev looking at the cache sees v0.3.3, runs mpak update, sees "Updated to 0.4.0", re-checks the cache, still sees v0.3.3, and has no easy explanation because the command lied on the way out.
  • Compounds with #60 (stale cache → stale run): even if run were fixed to re-extract on cache change, update still isn't triggering a cache change, so the fix wouldn't help.

Possible root cause

Hypothesis (not verified — no access to mpak source for this check): the update logic compares cache_version < registry_version, downloads the new tarball, writes it somewhere, but then fails silently before updating .mpak-meta.json or re-extracting. The status-print happens before the persistence step. Either the persistence step throws and is swallowed, or it writes to a wrong path.

Another possibility: it relies on outdated to decide whether to fetch, and outdated has its own bug (see the misreport above) so update believes there is nothing to update even though it should proactively fetch when given an explicit package name.

Dominant language
TypeScript
Stars
14
Forks
13
Avg merge
16m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NimbleBrainInc/mpak

All issues in NimbleBrainInc/mpak

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.