{"record":{"id":"5bd1ee1570a1b081","repo":"tinyhumansai/openhuman","slug":"failed-to-secure-recovery-phrase-please-try-again","errorCode":null,"errorMessage":"Failed to secure recovery phrase. Please try again.","messagePattern":"Failed to secure recovery phrase\\. Please try again\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/features/wallet/setupLocalWalletFromMnemonic.ts","lineNumber":28,"sourceCode":"  mnemonic: string;\n  source: WalletSetupSource;\n  setEncryptionKey: (value: string | null) => Promise<void>;\n  /**\n   * Set to `true` only when the user has explicitly confirmed wallet replacement\n   * through the double-confirmation dialog. Defaults to `false`.\n   */\n  force?: boolean;\n}): Promise<void> {\n  const { mnemonic, source, setEncryptionKey, force } = args;\n  const words = mnemonic.trim().split(/\\s+/).filter(Boolean);\n  if (words.length === 0) {\n    throw new Error('Recovery phrase is required.');\n  }\n  const normalizedMnemonic = words.join(' ');\n  const aesKey = deriveAesKeyFromMnemonic(normalizedMnemonic);\n  const encryptedMnemonic = (await openhumanEncryptSecret(normalizedMnemonic)).result?.trim();\n  if (!encryptedMnemonic) {\n    throw new Error('Failed to secure recovery phrase. Please try again.');\n  }\n\n  await setEncryptionKey(aesKey);\n  await setupLocalWallet({\n    consentGranted: true,\n    source,\n    mnemonicWordCount: words.length,\n    encryptedMnemonic,\n    accounts: deriveWalletAccountsFromMnemonic(normalizedMnemonic),\n    force,\n  });\n}\n","sourceCodeStart":10,"sourceCodeEnd":41,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/features/wallet/setupLocalWalletFromMnemonic.ts#L10-L41","documentation":"Argument-loop error from `openhuman memory clear`. Because clear is destructive, its accepted surface is intentionally minimal: only `--namespace/-n` (with a value), `-v/--verbose`, `-h/--help`. There is deliberately no --all, --force, or confirmation flag, and no positional form.","triggerScenarios":"`openhuman memory clear --all` (no bulk-wipe flag exists by design); `openhuman memory clear cli` (positional not accepted); `openhuman memory clear -f`.","commonSituations":"Scripts ported from other CLIs that use --force/--all idioms; attempts to bulk-reset memory during development; muscle memory from destructive commands elsewhere.","solutions":["Clear one namespace at a time: `openhuman memory clear --namespace <ns>`","To wipe everything, loop over `openhuman memory namespaces` output and clear each","Run `openhuman memory clear --help` to confirm the minimal surface"],"exampleFix":"# before\nopenhuman memory clear --all\n# after\nfor ns in $(openhuman memory namespaces); do openhuman memory clear --namespace \"$ns\"; done","handlingStrategy":"validation","validationCode":"# bash: clear accepts only --namespace <v>, -v, -h — reject destructive extras\nfor a in \"$@\"; do\n  case \"$a\" in\n    --namespace|-n|-v|--verbose|-h|--help) ;;\n    *) echo \"unknown clear arg: $a (only --namespace is accepted)\" >&2; exit 2 ;;\n  esac\ndone\nopenhuman memory clear \"$@\"","typeGuard":null,"tryCatchPattern":"if ! out=$(openhuman memory clear \"$@\" 2>&1); then\n  case \"$out\" in *\"unknown clear arg\"*) echo 'clear one namespace at a time: --namespace <ns>' >&2; exit 2;; esac\n  printf '%s\\n' \"$out\" >&2; exit 1\nfi","preventionTips":["There is no --all/--force by design; script an explicit loop over namespaces instead","Wrap clear behind a confirmation prompt in shared scripts — it deletes namespace contents"],"tags":["cli","usage","argument-parsing","memory","destructive"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}