{"record":{"id":"7a568f2293a0754a","repo":"stablyai/orca","slug":"authentication-unconfigured","errorCode":"authentication_unconfigured","errorMessage":"${operation.message}","messagePattern":"\\$\\{operation\\.message\\}","errorType":"exception","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/handlers/artifacts.ts","lineNumber":163,"sourceCode":"    ...cloudOptions(ctx)\n  }\n  if (Buffer.byteLength(JSON.stringify(request), 'utf8') > ARTIFACT_CLI_MAX_RPC_BYTES) {\n    throw new RuntimeClientError(\n      'invalid_argument',\n      'Artifact is too large for the Orca CLI transport. Use the browser upload page instead.'\n    )\n  }\n  return request\n}\n\nfunction requireOperation<T>(operation: ArtifactCloudOperation<T>): T {\n  if (operation.status === 'ok') {\n    return operation.value\n  }\n  if (operation.status === 'reconnect-required') {\n    throw new RuntimeClientError('authentication_required', 'Sign in to Orca and try again.')\n  }\n  throw new RuntimeClientError('authentication_unconfigured', operation.message)\n}\n\nexport const ARTIFACT_HANDLERS: Record<string, CommandHandler> = {\n  'artifacts list': async (ctx) => {\n    rejectRemoteSelectionFlags(ctx)\n    const cursor = stringFlag(ctx, 'cursor')\n    const response = await ctx.client.call<ArtifactCloudOperation<ArtifactListPage>>(\n      'artifacts.list',\n      {\n        ...cloudOptions(ctx),\n        ...(cursor ? { cursor } : {})\n      }\n    )\n    const value = requireOperation(response.result)\n    printResult({ ...response, result: value }, ctx.json, formatArtifactListPage)\n  },\n  'artifacts share': async (ctx) => {\n    rejectRemoteSelectionFlags(ctx)","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/handlers/artifacts.ts#L145-L181","documentation":"Thrown by requireOperation() as the fallback when an artifact cloud operation status is neither 'ok' nor 'reconnect-required' — i.e. 'unconfigured' or any other non-recoverable auth state. The message is the operation's own message (operation.message), so the exact text comes from the cloud layer. This indicates authentication was never set up, not merely expired.","triggerScenarios":"Any artifacts command whose RPC response has a status other than ok/reconnect-required: cloud account not linked, no auth token configured, the desktop account lacks cloud entitlement, or the operation reported an auth-misconfig message. Falls through the final throw in requireOperation().","commonSituations":"Fresh install with no Orca cloud account linked; the user signed in to a local-only account; ORCA_CLOUD_AUTH_TOKEN unset and no desktop sign-in; team plan without artifact entitlement; the cloud backend returned an unconfigured-state message.","solutions":["Complete Orca cloud account setup / sign-in so authentication is configured, not just reconnect-able.","Read operation.message for the specific reason and address it (e.g. link a cloud account, grant entitlement).","If using ORCA_CLOUD_AUTH_TOKEN, ensure it is set and valid; otherwise rely on desktop sign-in.","Confirm your plan/team includes artifact cloud entitlement."],"exampleFix":"# before\norca artifacts list   # ERROR authentication_unconfigured: <operation.message>\n\n# after\n# link Orca cloud account in desktop app, then\norca artifacts list","handlingStrategy":"type-guard","validationCode":"// Inspect the operation status before requireOperation throws.\nif (op.status !== 'ok' && op.status !== 'reconnect-required') {\n  // op.message holds the cloud layer's reason; show it, do not call requireOperation\n}","typeGuard":"const isAuthUnconfigured = (op: ArtifactCloudOperation<unknown>): boolean =>\n  op.status !== 'ok' && op.status !== 'reconnect-required'","tryCatchPattern":"try {\n  await dispatch('artifacts share', ctx)\n} catch (e) {\n  if (e instanceof RuntimeClientError && e.code === 'authentication_unconfigured') {\n    // e.message is operation.message — guide user to link a cloud account\n  }\n  throw e\n}","preventionTips":["Distinguish 'unconfigured' (never set up) from 'reconnect-required' (expired) — they need different remediation.","Check operation.status in the RPC response before delegating to requireOperation.","Ensure cloud entitlement is provisioned before scripting artifacts."],"tags":["artifacts","authentication","cloud","auth-unconfigured","auth"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}