different-ai/openwork · error

Could not determine the installed OpenWork version.

Error message

Could not determine the installed OpenWork version.

What it means

During a manual update check on the stable channel, useElectronUpdaterState resolves the currently installed version from the update bridge channel state, falling back to the app version. If both are missing/empty it cannot proceed to resolveFreshStableDesktopUpdate and throws. The updater needs a concrete installed version to compare against published releases.

Source

Thrown at apps/app/src/react-app/domains/settings/state/electron-updater-state.ts:393

    try {
      let targetVersion: string | undefined;
      const releaseChannelResolution = await resolvePolicyReleaseChannel(
        requestedReleaseChannel,
      );
      if (!isCurrentRequest()) return;
      const activeReleaseChannel = releaseChannelResolution.channel;
      const freshDesktopConfig = releaseChannelResolution.desktopConfig;
      if (activeReleaseChannel !== requestedReleaseChannel) {
        onReleaseChannelChange(activeReleaseChannel);
        await bridge.setChannel?.(activeReleaseChannel);
        if (!isCurrentRequest()) return;
      }
      if (manual && activeReleaseChannel === "stable") {
        const channelState = await bridge.getChannel?.();
        if (!isCurrentRequest()) return;
        const currentVersion = channelState?.currentVersion ?? appVersion;
        if (!currentVersion) {
          throw new Error("Could not determine the installed OpenWork version.");
        }

        const selection = await resolveFreshStableDesktopUpdate({
          currentVersion,
          refreshDesktopConfig,
        });
        if (!isCurrentRequest()) return;
        if (!selection) {
          throw new Error("Den returned an invalid desktop release inventory.");
        }
        if (selection.kind === "blocked") {
          setUpdateStatus({
            state: "blocked",
            lastCheckedAt: Date.now(),
            version: selection.latestPublishedVersion,
            message: t("settings.update_blocked_org", undefined, {
              version: selection.latestPublishedVersion,
            }),

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Ensure the app build embeds a valid version (check appVersion passed into the hook).
  2. Verify the desktop bridge exposes getChannel and returns currentVersion; update the desktop runtime if the capability is missing.
  3. Retry the update check after the bridge finishes initializing.
  4. If in a dev build, expect this may be unavoidable and gate the manual check on a known version.

Example fix

// before
const currentVersion = channelState?.currentVersion ?? appVersion;
if (!currentVersion) {
  throw new Error("Could not determine the installed OpenWork version.");
}
// after
const currentVersion = channelState?.currentVersion ?? appVersion ?? DEFAULT_APP_VERSION;
if (!currentVersion) {
  setUpdateStatus({ state: "unavailable", lastCheckedAt: Date.now() }); // degrade gracefully
  return;
}
Defensive patterns

Strategy: fallback

Validate before calling

const channelState = await bridge.getChannel?.();
const version = channelState?.currentVersion ?? appVersion;
if (!version) { /* skip update check and show 'version unknown' state */ }

Type guard

function hasVersion(s: { currentVersion?: string } | null | undefined): s is { currentVersion: string } {
  return typeof s?.currentVersion === "string" && s.currentVersion.length > 0;
}

Try / catch

try {
  await checkForUpdates({ manual: true });
} catch (err) {
  if (err.message.includes("Could not determine the installed")) setUpdateStatus({ state: "unavailable" });
  else throw err;
}

Prevention

When it happens

Trigger: Manual 'check for updates' on the stable channel when bridge.getChannel() returns null/undefined or an object with no currentVersion, AND the appVersion fallback is also empty or undefined.

Common situations: Bridge API not yet initialized or the getChannel capability is missing (older desktop bridge), corrupted or missing app metadata in dev builds, running a packaged build where version info was not embedded.

Related errors


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