{"record":{"id":"0bc0c593eb05e25a","repo":"Significant-Gravitas/AutoGPT","slug":"unsupported-import-in-artifact-preview-name","errorCode":null,"errorMessage":"Unsupported import in artifact preview: ${name}","messagePattern":"Unsupported import in artifact preview: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"autogpt_platform/frontend/src/app/(platform)/copilot/components/ArtifactPanel/components/reactArtifactPreview.ts","lineNumber":238,"sourceCode":"                }\n              }\n              if (key !== undefined) props.key = key;\n              var children =\n                config != null && \"children\" in config ? config.children : undefined;\n              if (Array.isArray(children)) {\n                return React.createElement.apply(\n                  null,\n                  [type, props].concat(children),\n                );\n              }\n              return children === undefined\n                ? React.createElement(type, props)\n                : React.createElement(type, props, children);\n            }\n            return { Fragment: React.Fragment, jsx: jsx, jsxs: jsx };\n          }\n\n          throw new Error(\"Unsupported import in artifact preview: \" + name);\n        }\n\n        class PreviewErrorBoundary extends React.Component {\n          constructor(props) {\n            super(props);\n            this.state = { error: null };\n          }\n\n          static getDerivedStateFromError(error) {\n            return { error };\n          }\n\n          render() {\n            if (this.state.error) {\n              const propsHelp =\n                this.props.componentExpectsProps && !this.props.hasPreviewProps\n                  ? \"\\\\n\\\\nThis component appears to expect props. Export a named previewProps object with sample values to render it in artifact preview.\"\n                  : \"\";","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/frontend/src/app/(platform)/copilot/components/ArtifactPanel/components/reactArtifactPreview.ts#L220-L256","documentation":"ValueError raised inside _validate_resource_ownership when the active AgentGraph exists but its organizationId differs from the org the caller claims as the source. Transfer creation verifies the resource actually belongs to the source org to prevent transferring other orgs' graphs.","triggerScenarios":"Creating a transfer with resourceType='AgentGraph' where the graph's owning org differs from the caller's active org — e.g. a multi-org user selecting a graph owned by org B while org A is active, or deliberately probing another org's graph id.","commonSituations":"Wrong active org selected in the UI; graph shared/visible across orgs but owned by another; copying a graph id from another workspace.","solutions":["Before creating the transfer, check the graph's organizationId equals the active org; otherwise prompt an org switch.","Filter graph pickers to graphs owned by the currently active org.","Re-fetch the graph and confirm ownership client-side before submission."],"exampleFix":"# before\nawait create_transfer(\"AgentGraph\", gid, source_org=active_org, ...)\n\n# after\ng = await get_graph(gid)\nif g.organization_id != active_org:\n    raise PermissionError(\"Graph not owned by active org\")\nawait create_transfer(\"AgentGraph\", gid, source_org=active_org, ...)","handlingStrategy":"type-guard","validationCode":"g = await get_graph(resource_id)\nif g.organization_id != active_org_id:\n    raise PermissionError(\"Graph not owned by active org\")","typeGuard":"def graph_owned_by_org(g: AgentGraphResponse, org_id: str) -> bool:\n    return g.organization_id == org_id","tryCatchPattern":"try:\n    await create_transfer(\"AgentGraph\", gid, ...)\nexcept ValueError as e:\n    if \"does not belong\" in str(e):\n        prompt_org_switch()\n    else:\n        raise","preventionTips":["Scope graph pickers to the active org's owned graphs","Verify ownership client-side before submitting the transfer"],"tags":["transfers","ownership","authorization"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}