different-ai/openwork · error

Recovery target version must differ from the installed versi

Error message

Recovery target version must differ from the installed version.

What it means

Thrown by `targetedStableUpdaterFeed` when recovery mode (`allowOlder = true`) is requested but the target version compares equal to the installed version (`comparison === 0`). Recovery updates exist to move the install to a different (possibly older) known-good release; targeting the identical version is a no-op and is rejected explicitly (non-recovery mode emits the sibling message about needing a newer version).

Source

Thrown at apps/desktop/electron/updater.mjs:175

  return comparePrereleaseIdentifiers(parsedLeft.prerelease, parsedRight.prerelease);
}

function isVersionNewer(candidate, current) {
  const comparison = compareVersions(candidate, current);
  return comparison === null ? candidate !== current : comparison > 0;
}

export function targetedStableUpdaterFeed(currentVersion, targetVersion, allowOlder = false) {
  const normalizedTarget = normalizeStableTargetVersion(targetVersion);
  if (!normalizedTarget) {
    throw new Error("Target update version must use the stable x.y.z format.");
  }
  const comparison = compareVersions(normalizedTarget, currentVersion);
  if (comparison === null) {
    throw new Error("Installed version could not be validated for a targeted update.");
  }
  if (comparison === 0 || (!allowOlder && comparison < 0)) {
    throw new Error(allowOlder
      ? "Recovery target version must differ from the installed version."
      : "Target update version must be newer than the installed version.");
  }
  return `https://github.com/different-ai/openwork/releases/download/v${normalizedTarget}`;
}

function updaterChannelState(app, channel, targetVersion = null, manifestChannel = "latest") {
  const normalized = normalizeElectronUpdaterChannel(channel, manifestChannel);
  const currentVersion = resolveAppVersion(app);
  return {
    channel: normalized,
    feedUrl: targetVersion
      ? targetedStableUpdaterFeed(currentVersion, targetVersion)
      : electronUpdaterFeedUrl(normalized, manifestChannel),
    currentVersion,
  };
}

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Pass a recovery target different from the installed version (the known-good older release you intend)
  2. Check the installed version first and skip the update if it already matches the target
  3. Fix automation that copies currentVersion into the target field

Example fix

// before
targetedStableUpdaterFeed(installed, recoveryTarget, true); // same version
// after
if (recoveryTarget === installed) return; // already on recovery version
targetedStableUpdaterFeed(installed, recoveryTarget, true);
Defensive patterns

Strategy: validation

Validate before calling

function recoveryTargetDiffers(current, target, allowOlder) {
  return !allowOlder || target !== current;
}

Try / catch

try {
  const feed = targetedStableUpdaterFeed(current, target, true);
} catch (e) {
  if (e.message.startsWith('Recovery target version must differ')) {
    showError('Already running the recovery version — nothing to do');
  } else throw e;
}

Prevention

When it happens

Trigger: Calling `targetedStableUpdaterFeed(current, current, true)` or otherwise passing a target equal to the running version with allowOlder set.

Common situations: A recovery UI defaulting the version field to the currently installed version; automation computing the target from the installed version; stale state after a successful update where the app already runs the recovery target.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/1a7237a5c61c593b. Report an issue: GitHub.