{"record":{"id":"3cc88e4f3da60079","repo":"NousResearch/hermes-agent","slug":"res-status-text-res-statustext","errorCode":null,"errorMessage":"${res.status}: ${text || res.statusText}","messagePattern":"\\$\\{res\\.status\\}: \\$\\{text \\|\\| res\\.statusText\\}","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/electron/dashboard-token.ts","lineNumber":32,"sourceCode":"\n  if (protocol !== 'http:' && protocol !== 'https:') {\n    throw new Error(`Unsupported Hermes backend URL protocol: ${protocol}`)\n  }\n\n  const timeoutMs = options.timeoutMs ?? DEFAULT_TOKEN_FETCH_TIMEOUT_MS\n\n  const res = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) }).catch(error => {\n    if (error.name === 'TimeoutError') {\n      throw new Error(`Timed out connecting to Hermes backend after ${timeoutMs}ms`)\n    }\n\n    throw error\n  })\n\n  const text = await res.text()\n\n  if (!res.ok) {\n    throw new Error(`${res.status}: ${text || res.statusText}`)\n  }\n\n  return text\n}\n\nfunction extractInjectedDashboardToken(html) {\n  const match = /window\\.__HERMES_SESSION_TOKEN__\\s*=\\s*(\"(?:\\\\.|[^\"\\\\])*\")/.exec(String(html || ''))\n\n  if (!match) {\n    return null\n  }\n\n  try {\n    return JSON.parse(match[1])\n  } catch {\n    return null\n  }\n}","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/electron/dashboard-token.ts#L14-L50","documentation":"AmbiguousJobReference (a LookupError subclass, cron/jobs.py:1804) raised by resolve_job_ref when a name reference matches the stored ID of nothing but the lowercased names of two or more jobs. Since pause/resume/update accept either an ID or a name, a duplicated name cannot be acted on safely; the message lists the matching job IDs so you can disambiguate.","triggerScenarios":"Two jobs created with the same name (names are not unique), then resume_job('daily-digest'), pause_job('daily-digest'), or any name-based lookup/CLI verb targeting that name.","commonSituations":"Re-running a setup script or `hermes cron add` that recreates the same-named job; an agent creating a job per day with a fixed name; case-only name collisions resolved via .lower() matching.","solutions":["Use one of the job IDs listed in the error message instead of the name.","Find IDs with `hermes cron list`.","Rename or remove the duplicate jobs so names are unique again.","Catch AmbiguousJobReference specifically when scripting name-based lookups."],"exampleFix":"# before\nresume_job(\"daily-digest\")  # two jobs share this name\n\n# after\nresume_job(\"a1b2c3d4\")  # ID taken from the error message / `hermes cron list`","handlingStrategy":"try-catch","validationCode":"from cron.jobs import load_jobs\n\ndef unique_name(name: str) -> bool:\n    n = name.lower()\n    return sum(1 for j in load_jobs() if (j.get(\"name\") or \"\").lower() == n) <= 1","typeGuard":null,"tryCatchPattern":"from cron.jobs import AmbiguousJobReference, resume_job\ntry:\n    resume_job(ref)\nexcept AmbiguousJobReference as e:\n    # message lists the matching IDs — pick one explicitly\n    job_id = parse_ids_from_error(e) or choose_via_list_jobs()\n    resume_job(job_id)","preventionTips":["Act on job IDs in scripts; treat names as display-only labels.","Give jobs unique names at creation (include date/purpose) and clean up duplicates with `hermes cron remove`."],"tags":["cron","naming","lookup","ambiguity"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}