diegosouzapw/OmniRoute · error

Git tag not found

Error message

Git tag not found: ${targetTag}

What it means

Pre-flight guard in ensureGitTagExists: `git rev-parse -q --verify refs/tags/<targetTag>` failed in PROJECT_ROOT (tag absent or git errored, 10s timeout). Auto-update refuses to proceed to a tag that does not exist locally because the update script would checkout/deploy an unresolvable ref.

Solutions

  1. Run `git fetch --tags` to bring the tag locally and retry
  2. Verify the tag name is exactly as published (leading 'v', etc.)
  3. If the repo is shallow, unshallow it so tags are visible
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/system/autoUpdate.ts:278 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/f380301ff518d967. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/system/autoUpdate.ts:278

      composeCommand: null,
    };
  }

  return { supported: true, reason: null, composeCommand };
}

export async function ensureGitTagExists(
  targetTag: string,
  execFileImpl: ExecFileLike = execFileAsync,
  cwd = PROJECT_ROOT
): Promise<void> {
  try {
    await execFileImpl("git", ["rev-parse", "-q", "--verify", `refs/tags/${targetTag}`], {
      timeout: 10_000,
      cwd,
    });
  } catch {
    throw new Error(`Git tag not found: ${targetTag}`);
  }
}

export function buildNpmUpdateScript(latest: string): string {
  return [
    "set -eu",
    // --include=optional keeps the optionalDependencies (better-sqlite3, keytar,
    // tls-client, and the llmlingua SLM stack) installed on every update so an
    // `omit=optional` config / .npmrc cannot silently drop them.
    `npm install -g omniroute@${latest} --include=optional --ignore-scripts --legacy-peer-deps`,
    "if command -v pm2 >/dev/null 2>&1; then",
    "  pm2 restart omniroute || true",
    "fi",
    `echo \"[AutoUpdate] Successfully updated to v${latest}.\"`,
  ].join("\n");
}

export function buildSourceUpdateScript(latest: string, gitRemote = "origin"): string {

View on GitHub (pinned to a179ffed5b)