{"record":{"id":"6ae75edc4658c3aa","repo":"rohitg00/agentmemory","slug":"d-id-status-detail","errorCode":null,"errorMessage":"${d.id} ✗ ${status.detail ?? \"\"}","messagePattern":"\\$\\{d\\.id\\} ✗ \\$\\{status\\.detail \\?\\? \"\"\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/cli.ts","lineNumber":2673,"sourceCode":"  }\n\n  let failed = 0;\n  let fixed = 0;\n  let skipped = 0;\n  let quit = false;\n\n  for (const d of diagnostics) {\n    if (quit) {\n      skipped++;\n      continue;\n    }\n    const status = await d.check(ctx);\n    if (status.ok) {\n      p.log.success(`${d.id} ✓${status.detail ? ` (${status.detail})` : \"\"}`);\n      continue;\n    }\n    failed++;\n    p.log.warn(`${d.id} ✗ ${status.detail ?? \"\"}`.trim());\n    p.log.info(`why: ${d.fixPreview}`);\n\n    if (d.manualOnly) {\n      p.log.info(`(manual fix only — see \"${d.id}\" docs)`);\n    }\n\n    if (applyAll) {\n      const r = await applyFixWithReport(d, ctx, false);\n      if (r.ok) fixed++;\n      // Re-check only this diagnostic.\n      const after = await d.check(ctx);\n      if (!after.ok) p.log.warn(`${d.id} still failing after fix.`);\n      continue;\n    }\n\n    // Interactive prompt loop — allow [?] More info without leaving the check.\n    while (true) {\n      const action = await askFixAction(d);","sourceCodeStart":2655,"sourceCodeEnd":2691,"githubUrl":"https://github.com/rohitg00/agentmemory/blob/e04ba88819c365c9acf9d6661ea802143e728bd6/src/cli.ts#L2655-L2691","documentation":"Not a thrown exception but a diagnostic warning emitted by `agentmemory doctor`. When a diagnostic's `check(ctx)` returns `{ ok: false }`, the CLI prints `<diagnostic-id> ✗ <detail>` to explain which environment/config check failed, followed by the suggested fix preview. The detail text comes from the individual diagnostic's check implementation.","triggerScenarios":"Running `agentmemory doctor` (interactive or `--dry-run`) when any diagnostic's check fails — e.g. daemon not reachable, data directory not writable, embedding provider misconfigured, stale index state.","commonSituations":"First-time setup before the daemon is started; corrupted or missing state under ./data; environment variables (AGENTMEMORY_URL, embedding keys) unset or wrong; upgrading between versions leaves old config.","solutions":["Read the detail text after the ✗ — it names the specific failed check","Run `agentmemory doctor` interactively and choose Fix (or `--all`) for the failing diagnostic","Choose '?  More info' at the prompt to see the diagnostic's fuller guidance","If the diagnostic is manualOnly, consult the docs for that diagnostic id","Fix the underlying env/config (e.g. start the daemon, set the missing env var) and re-run doctor"],"exampleFix":"// before (failing check output)\nstate-dir-writable ✗ ./data not writable: EACCES\n// after (fix applied / permissions corrected)\nstate-dir-writable ✓ (./data writable)","handlingStrategy":"validation","validationCode":"// run doctor's checks up front before relying on the daemon\nconst ctx = buildDoctorContext();\nconst diagnostics = buildDiagnostics(buildDoctorEffects());\nfor (const d of diagnostics) {\n  const status = await d.check(ctx);\n  if (!status.ok) console.error(`${d.id}: ${status.detail ?? \"failed\"}`);\n}","typeGuard":"function isCheckOk(status: { ok: boolean; detail?: string } | null | undefined): status is { ok: true; detail?: string } {\n  return status?.ok === true;\n}","tryCatchPattern":"null","preventionTips":["Run `agentmemory doctor` after installing or upgrading","Run doctor with --dry-run in CI/setup scripts to catch env issues early","Keep AGENTMEMORY_URL and embedding credentials in a checked .env","Start the daemon before running doctor so passive server checks pass"],"tags":["cli","diagnostics","doctor"],"backgroundTag":"doctor-diagnostic-failed","analyzedSha":"e04ba88819c365c9acf9d6661ea802143e728bd6","analyzedAt":"2026-08-30T01:07:40.754Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}