{"record":{"id":"d345a2700b8d491c","repo":"stablyai/orca","slug":"invalid-orca-profile-project-path","errorCode":null,"errorMessage":"invalid_orca_profile_project_path","messagePattern":"invalid_orca_profile_project_path","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/orca-profiles.ts","lineNumber":92,"sourceCode":"  const candidate = args as TransferOrcaProfileProjectArgs\n  const sourceProfileId = candidate.sourceProfileId?.trim()\n  const targetProfileId = candidate.targetProfileId?.trim()\n  const repoId = candidate.repoId?.trim()\n  const mode = candidate.mode\n  if (!sourceProfileId || !targetProfileId || !repoId || (mode !== 'move' && mode !== 'copy')) {\n    throw new Error('invalid_orca_profile_project_transfer')\n  }\n  return {\n    sourceProfileId,\n    targetProfileId,\n    repoId,\n    mode\n  }\n}\n\nfunction findProjectsByPathArgsFromUnknown(args: unknown): FindOrcaProfileProjectsByPathArgs {\n  if (!args || typeof args !== 'object') {\n    throw new Error('invalid_orca_profile_project_path')\n  }\n  const candidate = args as FindOrcaProfileProjectsByPathArgs\n  const path = typeof candidate.path === 'string' ? candidate.path.trim() : ''\n  if (!path) {\n    throw new Error('invalid_orca_profile_project_path')\n  }\n  let executionHostId: FindOrcaProfileProjectsByPathArgs['executionHostId'] = null\n  if (candidate.executionHostId !== null && candidate.executionHostId !== undefined) {\n    if (typeof candidate.executionHostId !== 'string') {\n      throw new Error('invalid_orca_profile_project_path')\n    }\n    executionHostId = normalizeExecutionHostId(candidate.executionHostId)\n    if (!executionHostId) {\n      throw new Error('invalid_orca_profile_project_path')\n    }\n  }\n  return {\n    path,","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/orca-profiles.ts#L74-L110","documentation":"Thrown by findProjectsByPathArgsFromUnknown() (line 92) when the payload for orcaProfiles:findProjectProfiles is not an object. This is the shape branch; content checks (path emptiness, executionHostId type/normalization) are separate throws on lines 97, 102, and 106. It runs before findOrcaProfileProjectsByPath, so malformed input never reaches the project-presence lookup.","triggerScenarios":"Invoking orcaProfiles:findProjectProfiles with undefined, null, a primitive, or a non-object value as the sole argument.","commonSituations":"The presence check is dispatched from a context-menu or watcher with no args bound, or a refactor moved the path into a nested object without updating the call site.","solutions":["Pass an object literal with at least { path } as the second IPC argument.","Construct the payload from a trimmed workspace/folder path, sourcing executionHostId only when an SSH/folder host context exists.","If the lookup is optional in the flow, guard the call on the path being present rather than passing undefined.","Keep connectionId / excludeProfileId optional — omit them rather than passing empty strings if unused."],"exampleFix":"// before\nawait ipcRenderer.invoke('orcaProfiles:findProjectProfiles', workspacePath)\n\n// after\nawait ipcRenderer.invoke('orcaProfiles:findProjectProfiles', { path: workspacePath })","handlingStrategy":"validation","validationCode":"function isFindProjectsArgs(v: unknown): v is { path: unknown } {\n  return typeof v === 'object' && v !== null && 'path' in v\n}\n\nif (!isFindProjectsArgs(payload)) return","typeGuard":"function isFindProjectsByPathArgsShape(v: unknown): v is { path: unknown; executionHostId?: unknown } {\n  return typeof v === 'object' && v !== null && 'path' in v\n}","tryCatchPattern":"try {\n  await ipcRenderer.invoke('orcaProfiles:findProjectProfiles', payload)\n} catch (e) {\n  if (e instanceof Error && e.message === 'invalid_orca_profile_project_path') {\n    setScanError('Provide a workspace path to scan.')\n  } else throw e\n}","preventionTips":["Pass an object literal { path } as the second IPC arg.","Omit optional fields (connectionId, executionHostId, excludeProfileId) rather than sending empty strings.","Skip the call entirely when no folder is open."],"tags":["ipc","validation","orca-profiles","argument-validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}