{"record":{"id":"3297062bdb5bdede","repo":"NousResearch/hermes-agent","slug":"could-not-rename-slug","errorCode":null,"errorMessage":"Could not rename ${slug}","messagePattern":"Could not rename (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/src/store/pet-gallery.ts","lineNumber":484,"sourceCode":"\n  const prev = $petGallery.get()?.pets.find(p => p.slug === slug)?.displayName ?? ''\n\n  // Optimistic: paint the new name now (slug reconciles when the RPC returns).\n  patchGallery(g => ({\n    ...g,\n    pets: g.pets.map(p => (p.slug === slug ? { ...p, displayName: trimmed } : p))\n  }))\n  $petGalleryError.set(null)\n\n  return (async () => {\n    try {\n      const res = await petRpc<{ ok: boolean; slug: string; displayName: string }>(request, 'pet.rename', {\n        slug,\n        name: trimmed\n      })\n\n      if (!res?.ok) {\n        throw new Error(fallback)\n      }\n\n      const newSlug = res.slug || slug\n\n      if (newSlug !== slug) {\n        thumbCache.delete(slug)\n        patchGallery(g => ({\n          ...g,\n          active: g.active === slug ? newSlug : g.active,\n          pets: g.pets\n            .filter(p => p.slug !== newSlug || p.slug === slug)\n            .map(p => (p.slug === slug ? { ...p, slug: newSlug, displayName: res.displayName || trimmed } : p))\n        }))\n      }\n\n      return true\n    } catch (e) {\n      // Roll the optimistic name back so the list reflects on-disk truth.","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/src/store/pet-gallery.ts#L466-L502","documentation":"Error \"Could not rename ${slug}\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/src/store/pet-gallery.ts:484 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a new slug that does not collide with an existing pet.","Verify the pet exists and the gallery store is writable, then retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}