{"record":{"id":"714c3991ba5a7721","repo":"tinyhumansai/openhuman","slug":"payment-required-714c39","errorCode":"PAYMENT_REQUIRED","errorMessage":"PAYMENT_REQUIRED","messagePattern":"PAYMENT_REQUIRED","errorType":"exception","errorClass":"PaymentRequiredError","httpStatus":402,"severity":"error","filePath":"app/src/lib/orchestration/orchestrationClient.ts","lineNumber":244,"sourceCode":"  }\n}\n\n/**\n * Call a `openhuman.orchestration_*` method and return the typed result.\n *\n * The core serialises 402 errors as a plain string `\"PAYMENT_REQUIRED:<json>\"`;\n * we decode it into a {@link PaymentRequiredError} so callers can render the\n * paywall state, matching `invokeApiClient`. All other errors propagate as-is.\n */\nasync function call<T>(method: string, params?: Record<string, unknown>): Promise<T> {\n  try {\n    return await callCoreRpc<T>({ method, params: params ?? {} });\n  } catch (err) {\n    const msg = String(err);\n    const prefix = 'PAYMENT_REQUIRED:';\n    const idx = msg.indexOf(prefix);\n    if (idx >= 0) {\n      throw new PaymentRequiredError(safeParseJson(msg.slice(idx + prefix.length)));\n    }\n    throw err;\n  }\n}\n\n// ── Public API ────────────────────────────────────────────────────────────────\n\nexport const orchestrationClient = {\n  /** List all orchestration chats (pinned master + subconscious, plus sessions). */\n  sessionsList: () => call<SessionsListResponse>('openhuman.orchestration_sessions_list', {}),\n\n  /** Create a new empty session for a contact; returns the created summary. */\n  sessionsCreate: (params: { agentId: string; label?: string }) =>\n    call<SessionCreateResponse>('openhuman.orchestration_sessions_create', {\n      agentId: params.agentId,\n      ...(params.label !== undefined ? { label: params.label } : {}),\n    }),\n","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/lib/orchestration/orchestrationClient.ts#L226-L262","documentation":"Missing-value error from `parse_tick_flags` in the subconscious CLI. `--mode`/`-m` expects its value (simple|aggressive) as the immediately next token; when the flag is last on the line, `args.get(i + 1)` is None and this error fires. Note this is distinct from the follow-on validation error: a PRESENT but invalid value yields \"unknown mode '{other}', expected simple|aggressive\" instead.","triggerScenarios":"`openhuman subconscious tick --mode` at end of line; `-m` as the final token; the value line of a backslash-continued command deleted.","commonSituations":"Truncated command lines; scripts appending the flag with an empty mode variable.","solutions":["Pass the mode as the next token: `--mode aggressive` (or `--mode simple`)","Or omit the flag to use the configured/default mode","Validate the value client-side against {simple, aggressive} before invoking"],"exampleFix":"# before\nopenhuman subconscious tick --mode\n# after\nopenhuman subconscious tick --mode aggressive","handlingStrategy":"validation","validationCode":"# bash: validate mode value AND pairing before invoking\ncase \"${MODE:-}\" in \"\"|simple|aggressive) ;; *) echo \"mode must be simple|aggressive\" >&2; exit 2;; esac\nif [ -n \"$MODE\" ]; then set -- --mode \"$MODE\" \"$@\"; fi\nopenhuman subconscious tick \"$@\"","typeGuard":"is_subconscious_mode() { case \"$1\" in simple|aggressive) return 0;; *) return 1;; esac; }","tryCatchPattern":"if ! out=$(openhuman subconscious tick \"$@\" 2>&1); then\n  case \"$out\" in *\"missing value for --mode\"*) echo 'pass simple|aggressive as the next token' >&2; exit 2;; *\"unknown mode\"*) echo 'expected simple|aggressive' >&2; exit 2;; esac\n  printf '%s\\n' \"$out\" >&2; exit 1\nfi","preventionTips":["Validate the mode value against {simple, aggressive} client-side — it also prevents the sibling 'unknown mode' error"],"tags":["cli","usage","argument-parsing","subconscious"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}