{"record":{"id":"3291b01d34e66d92","repo":"tinyhumansai/openhuman","slug":"payment-required","errorCode":null,"errorMessage":"PAYMENT_REQUIRED","messagePattern":"PAYMENT_REQUIRED","errorType":"http","errorClass":"PaymentRequiredError","httpStatus":402,"severity":"error","filePath":"app/src/lib/agentworld/invokeApiClient.ts","lineNumber":86,"sourceCode":"  params?: Record<string, unknown>,\n  timeoutMs?: number\n): Promise<T> {\n  try {\n    return await callCoreRpc<T>({\n      method,\n      params,\n      ...(timeoutMs !== undefined ? { timeoutMs } : {}),\n    });\n  } catch (err) {\n    // Core serialises 402 errors as a plain string \"PAYMENT_REQUIRED:<json>\".\n    const msg = String(err);\n    const prefix = 'PAYMENT_REQUIRED:';\n    if (msg.includes(prefix)) {\n      // Extract everything after the prefix, handling cases where the error\n      // message has extra surrounding text from JSON-RPC wrapping.\n      const idx = msg.indexOf(prefix);\n      const payload = msg.slice(idx + prefix.length);\n      throw new PaymentRequiredError(safeParseJson(payload));\n    }\n    throw err;\n  }\n}\n\n// ── Types (inline minimal stubs — replace with SDK types when available) ──────\n//\n// These are structural interfaces that describe what the tiny.place backend\n// returns. They mirror `sdk/typescript/src/types/`.  We declare them here\n// (import-type-only) so the renderer tree never bundles the HTTP SDK runtime.\n//\n// When `@tinyhumansai/tinyplace` is published and added as a dev-dep, replace\n// each `AgentQueryParams`, `AgentCard`, etc. with `import type { … } from\n// '@tinyhumansai/tinyplace'`.\n\ninterface AgentQueryParams {\n  q?: string;\n  skill?: string;","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/lib/agentworld/invokeApiClient.ts#L68-L104","documentation":"Required-flag error from `openhuman memory clear`. After the parsing loop, `--namespace` was never supplied. The requirement is deliberate: clear removes a namespace's contents, so there is no implicit default — you must name the target explicitly. This is the destructive twin of the query requirement (error 367).","triggerScenarios":"`openhuman memory clear -v`; `openhuman memory clear` with no arguments; a script whose namespace variable resolved empty so the flag was skipped.","commonSituations":"Running clear as a quick 'reset everything' and expecting a prompt or default; empty-variable interpolation in automation; onboarding docs that show clear without the flag.","solutions":["Pass the namespace explicitly: `openhuman memory clear --namespace cli`","List namespaces first with `openhuman memory namespaces` if unsure of the name","Quote and default-check the variable in scripts: `[ -n \"$NS\" ] || exit 1`"],"exampleFix":"# before\nopenhuman memory clear\n# after\nopenhuman memory clear --namespace cli","handlingStrategy":"validation","validationCode":"# bash: never invoke clear without an explicit namespace\n[ -n \"${NS:-}\" ] || { echo 'refusing to clear without --namespace' >&2; exit 2; }\nopenhuman memory clear --namespace \"$NS\"","typeGuard":null,"tryCatchPattern":"if ! out=$(openhuman memory clear \"$@\" 2>&1); then\n  case \"$out\" in *\"--namespace is required\"*) openhuman memory namespaces >&2; exit 2;; esac\n  printf '%s\\n' \"$out\" >&2; exit 1\nfi","preventionTips":["Treat an empty namespace variable as a hard script error before reaching the CLI","Keep clear commands explicit — the missing default is an intentional safety property, not a gap"],"tags":["cli","required-argument","destructive","memory"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}