{"record":{"id":"31270174cb71b620","repo":"rohitg00/agentmemory","slug":"config-displayname-hooks-skipped-hookresult-312701","errorCode":null,"errorMessage":"${config.displayName} hooks skipped: ${hookResult.reason}. MCP wiring still applied.","messagePattern":"(.+?) hooks skipped: (.+?)\\. MCP wiring still applied\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/cli/connect/json-mcp-adapter.ts","lineNumber":135,"sourceCode":"      writeJsonAtomic(config.configPath, next);\n\n      const verify = readJsonSafe<McpConfig>(config.configPath);\n      const verifyServers = verify?.[wrapperKey] as\n        | Record<string, McpEntry>\n        | undefined;\n      if (!entryMatches(verifyServers?.[\"agentmemory\"])) {\n        p.log.error(\n          `Verification failed: ${config.configPath} did not contain ${wrapperKey}.agentmemory after write.`,\n        );\n        return { kind: \"skipped\", reason: \"verification-failed\" };\n      }\n\n      logInstalled(config.displayName, config.configPath);\n\n      if (opts.withHooks && config.installHooks) {\n        const hookResult = config.installHooks(opts);\n        if (hookResult.kind === \"skipped\") {\n          p.log.warn(\n            `${config.displayName} hooks skipped: ${hookResult.reason}. MCP wiring still applied.`,\n          );\n        }\n      }\n\n      return {\n        kind: \"installed\",\n        mutatedPath: config.configPath,\n        ...(backupPath !== undefined && { backupPath }),\n      };\n    },\n  };\n}\n","sourceCodeStart":117,"sourceCodeEnd":149,"githubUrl":"https://github.com/rohitg00/agentmemory/blob/e04ba88819c365c9acf9d6661ea802143e728bd6/src/cli/connect/json-mcp-adapter.ts#L117-L149","documentation":"Raised after a successful (non-dry-run) MCP wiring of a JSON-config host: the agentmemory entry was written and verified, then the optional `--with-hooks` step invoked the host's `installHooks`, which returned kind 'skipped'. The warning makes clear the hooks were not installed but the MCP config write succeeded — this is a partial-success notice, not a failure.","triggerScenarios":"Running `agentmemory connect <host> --with-hooks` (no --dry-run) where the config write + verification succeeds but `installHooks(opts)` returns `{ kind: 'skipped', reason }` (hook manifest already present/current, unwritable path, unsupported host state).","commonSituations":"Fresh installs on hosts whose hook manifest already exists from a manual setup; restricted home-directory permissions; version drift where the installer recognizes the existing manifest as up-to-date and skips rewriting.","solutions":["Read the `reason` text after 'hooks skipped:' and fix that specific condition.","Re-run `agentmemory connect <host> --with-hooks --force` to redo wiring and retry hooks.","Verify the MCP entry landed (it did — 'MCP wiring still applied') and install hooks manually if needed."],"exampleFix":"// before\nagentmemory connect droid --with-hooks\ndroid hooks skipped: hook-manifest-already-installed.\n\n// after\nagentmemory connect droid --with-hooks --force\n# or manually merge hook entries into ~/.factory/hooks.json","handlingStrategy":"fallback","validationCode":"// Check hook-manifest prerequisites before connecting\nimport { accessSync, constants } from \"node:fs\";\ntry {\n  accessSync(hooksManifestPath, constants.W_OK);\n} catch {\n  console.log(\"Hooks manifest unwritable — run connect without --with-hooks or fix permissions.\");\n}","typeGuard":"function isSkipped(r: ConnectResult): r is { kind: \"skipped\"; reason: string } {\n  return r.kind === \"skipped\" && typeof (r as { reason?: unknown }).reason === \"string\";\n}","tryCatchPattern":"const result = await adapter.install({ ...opts, withHooks: true });\nif (result.kind === \"installed\") {\n  console.log(\"MCP wiring applied.\");\n  if (hookResult?.kind === \"skipped\") console.warn(`Hooks skipped: ${hookResult.reason} — wire hooks manually.`);\n}","preventionTips":["Verify MCP wiring succeeded first — this warning never invalidates the config write.","Fix the logged skip reason (permissions, existing manifest) before retrying with --force.","If hooks matter to your setup, validate the hook manifest afterwards instead of assuming success.","Keep hook manifests under your control to avoid installer-side skip decisions."],"tags":["cli","hooks","skipped","mcp"],"backgroundTag":"hooks-install-skipped","analyzedSha":"e04ba88819c365c9acf9d6661ea802143e728bd6","analyzedAt":"2026-08-30T01:07:40.754Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}