{"record":{"id":"a9b7ea5ebc244680","repo":"thedotmack/claude-mem","slug":"cmem-pro-requires-a-signed-in-claude-mem-account","errorCode":null,"errorMessage":"CMEM Pro requires a signed-in claude-mem account.","messagePattern":"CMEM Pro requires a signed-in claude-mem account\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/npx-cli/commands/install.ts","lineNumber":1151,"sourceCode":"        p.cancel('Installation cancelled.');\n        process.exit(1);\n      }\n      if (providerResult.length === 1) {\n        selectedProvider = providerResult[0];\n        break;\n      }\n      log.warn('Select exactly one provider.');\n    }\n  }\n\n  // CMEM Pro: no new provider code. The worker's OpenRouter client is a generic\n  // OpenAI-compatible client whose endpoint and model both come from settings,\n  // so \"use the CMEM observer model\" is four settings writes and nothing else.\n  if (selectedProvider === 'cmem') {\n    if (!pairing) {\n      // Unreachable via the flag that skips login (it forces 'claude'), but a\n      // future caller passing null here would otherwise enroll against nothing.\n      throw new Error('CMEM Pro requires a signed-in claude-mem account.');\n    }\n    // The billing disclosure lives on the checkout page, not here. It is a term\n    // of the charge, so it belongs on the screen that takes the payment method,\n    // where it can be shown next to the price and the card field. Re-asking for\n    // it in the terminal made the user consent twice to the same thing, before\n    // ever seeing what they were agreeing to.\n    const enrollment = await completeCmemTrialPairing(pairing, version);\n    if (!enrollment) {\n      p.cancel('CMEM Pro setup was not completed. Run npx claude-mem install to try again.');\n      process.exit(1);\n    }\n    const cmemCredentials = resolveCmemMemoryCredentials(enrollment, persistedSettings);\n    if (!cmemCredentials) {\n      p.cancel('CMEM Pro did not return memory credentials. Run npx claude-mem install to try again.');\n      process.exit(1);\n    }\n\n    const wrote = mergeSettings(buildCmemActivationSettings(cmemCredentials));","sourceCodeStart":1133,"sourceCodeEnd":1169,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/npx-cli/commands/install.ts#L1133-L1169","documentation":"The 'cmem' provider (CMEM Pro) requires billing against a signed-in claude-mem account; installing for it needs a valid `pairing` object. The code throws if pairing is null. As the source comment notes, this is currently unreachable through the normal flag flow (the skip-login flag forces provider 'claude') but guards future callers passing null pairing.","triggerScenarios":"selectProvider-style flow resolves selectedProvider === 'cmem' while the pairing argument is null/undefined — i.e. no signed-in account/pairing credentials were established before provider selection.","commonSituations":"Programmatic callers invoking the install provider-selection function without performing the login/pairing step; future refactorings that drop the skip-login coercion; test harnesses passing null pairing with provider 'cmem'.","solutions":["Complete claude-mem account sign-in/pairing before selecting the cmem provider.","If automating, use the documented skip-login path (which forces provider 'claude') or pass a valid pairing object.","As a library caller, never pass null pairing when provider is 'cmem'; resolve credentials first."],"exampleFix":"// before\nawait selectProvider({ provider: 'cmem', pairing: null });\n// after\nconst pairing = await completeLogin();\nawait selectProvider({ provider: 'cmem', pairing });","handlingStrategy":"type-guard","validationCode":"if (provider === 'cmem' && pairing == null) throw new Error('complete login/pairing before selecting cmem provider');","typeGuard":"function hasPairing(p: Pairing | null): p is Pairing { return p != null && typeof p === 'object' && 'token' in p; }","tryCatchPattern":"try { await selectProvider(opts); } catch (e) { if (e.message.includes('CMEM Pro requires a signed-in')) { await login(); await selectProvider({ ...opts, pairing: currentPairing() }); } else throw e; }","preventionTips":["Always run the login/pairing step before provider selection in scripts","Type the pairing parameter as non-nullable when provider is 'cmem'","Prefer provider 'claude' in headless automation that skips login"],"tags":["authentication","account","provider"],"backgroundTag":"authentication-required","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}