{"record":{"id":"c66de833a0cca2c5","repo":"garrytan/gstack","slug":"editor-exited-with-status-result-status-no-cha","errorCode":null,"errorMessage":"Editor exited with status ${result.status}; no changes saved.","messagePattern":"Editor exited with status (.+?); no changes saved\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/domain-skill-commands.ts","lineNumber":196,"sourceCode":"  }\n  const slug = getCurrentProjectSlug();\n  // Read current body to seed the editor\n  const list = await listSkills(slug);\n  const current = [...list.project, ...list.global].find((r) => r.host === host);\n  if (!current) {\n    throw new Error(\n      `Cannot edit: no skill for ${host}.\\n` +\n        'Cause: skill does not exist in this project or global scope.\\n' +\n        'Action: $B domain-skill save to create one first.'\n    );\n  }\n  const editor = process.env.EDITOR || 'vi';\n  const tmpFile = path.join(os.tmpdir(), `gstack-domain-skill-${process.pid}-${Date.now()}.md`);\n  await fs.writeFile(tmpFile, current.body, 'utf8');\n  const result = spawnSync(editor, [tmpFile], { stdio: 'inherit' });\n  if (result.status !== 0) {\n    await fs.unlink(tmpFile).catch(() => {});\n    throw new Error(`Editor exited with status ${result.status}; no changes saved.`);\n  }\n  const newBody = await fs.readFile(tmpFile, 'utf8');\n  await fs.unlink(tmpFile).catch(() => {});\n  if (newBody === current.body) {\n    return `No changes for ${host}.`;\n  }\n  // Re-save (always per-project; promotion is explicit)\n  const page = (global as any).__bm?.getPage?.();\n  void page; // we're in the daemon — page available, but for edit we trust the existing host\n  const row = await writeSkill({\n    host: current.host,\n    body: newBody,\n    projectSlug: slug,\n    source: 'human',\n    classifierScore: 0,\n  });\n  return formatSavedOk(row, slug);\n}","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/domain-skill-commands.ts#L178-L214","documentation":"Error \"Editor exited with status ${result.status}; no changes saved.\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/domain-skill-commands.ts:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}