NousResearch/hermes-agent · critical

Cannot resolve ${installScriptName()}: no SOURCE_REPO_ROOT a

Error message

Cannot resolve ${installScriptName()}: no SOURCE_REPO_ROOT and no install stamp. This packaged build was produced without a valid build-time stamp.

What it means

RuntimeError from load_jobs() (cron/jobs.py:1097): _parse_jobs_file() tried its strict-then-repair JSON parse and a non-IO exception escaped, meaning the file is corrupt beyond what auto-repair handles (control-character escaping, bare-list wrapping). The cron subsystem deliberately fails closed rather than silently discarding user jobs.

Source

Thrown at apps/desktop/electron/bootstrap-runner.ts:341

}) {
  // 1. Dev shortcut: prefer a local checkout's installer so we can iterate
  //    without pushing. SOURCE_REPO_ROOT comes from main.ts (path.resolve
  //    of APP_ROOT/../..).
  const localScript = resolveLocalInstallScript(sourceRepoRoot)

  if (localScript) {
    emit({ type: 'log', line: `[bootstrap] using local ${installScriptName()} at ${localScript}` })

    return { path: localScript, source: 'local', kind: installScriptKind() }
  }

  // 2. Packaged path: download from GitHub at the install stamp's ref.
  // Non-git fallback builds carry an all-zero commit; treat that as an
  // unpinned branch ref instead of trying to fetch a non-existent SHA.
  const installRef = installRefForStamp(installStamp)

  if (!installRef) {
    throw new Error(
      `Cannot resolve ${installScriptName()}: no SOURCE_REPO_ROOT and no install stamp. ` +
        'This packaged build was produced without a valid build-time stamp.'
    )
  }

  const cached = cachedScriptPath(hermesHome, installRef.cacheKey)
  const resolvedCommit = installRef.pinned ? installRef.ref : null

  try {
    await fsp.access(cached, fs.constants.R_OK)
    emit({
      type: 'log',
      line: `[bootstrap] using cached ${installScriptName()} for ${installRef.ref.slice(0, 12)}`
    })

    return { path: cached, source: 'cache', commit: resolvedCommit, kind: installScriptKind() }
  } catch {
    // not cached; download

View on GitHub (pinned to c896c09c42)

Solutions

  1. Back up the corrupt file: cp ~/.hermes/cron/jobs.json{,.bak}.
  2. Inspect it (python -m json.tool) to find the damage; often only a trailing fragment needs deleting.
  3. Repair the JSON by hand or rebuild the file as {"jobs": [...]} from the readable parts.
  4. If unrecoverable, move the file aside — load_jobs treats a missing file as empty and `hermes cron add` recreates it; re-add your jobs from the backup text.

Example fix

# before: jobs.json ends with '{"jobs": [{"id": "j1", "prom'
# after: valid JSON, then reload
python -m json.tool ~/.hermes/cron/jobs.json   # locate the error
# fix or replace with {"jobs": []}, then: hermes cron list
Defensive patterns

Strategy: fallback

Validate before calling

import json
from pathlib import Path
from hermes_constants import get_hermes_home

f = get_hermes_home() / "cron" / "jobs.json"
if f.exists():
    try:
        json.loads(f.read_text())
    except (json.JSONDecodeError, UnicodeDecodeError):
        print("jobs.json is corrupt — back it up before Hermes loads it: cp", f, f.with_suffix('.json.bak'))

Try / catch

from cron.jobs import list_jobs
import shutil
try:
    jobs = list_jobs()
except RuntimeError as e:
    if "corrupted and unrepairable" in str(e):
        shutil.copy2(f, f.with_suffix(".json.corrupt"))  # preserve salvageable text
        f.write_text('{"jobs": []}')                     # reset store, re-add jobs after
        jobs = list_jobs()

Prevention

When it happens

Trigger: jobs.json truncated mid-write by a crash/power loss, hand-edited into invalid JSON that the repair passes can't fix, binary garbage from a bad sync tool, or a file whose top-level JSON parses but whose repair path itself raises (e.g. exotic encoding issues).

Common situations: Editing jobs.json manually and introducing a syntax error; an interrupted write because the machine died mid-save; a sync tool (Dropbox/backup restore) writing a partial file.

Related errors


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/1eb8493e96862e7d. Report an issue: GitHub.