{"record":{"id":"1a95131bef600349","repo":"stablyai/orca","slug":"sending-diagnostics-is-not-configured-for-this-bui","errorCode":null,"errorMessage":"sending diagnostics is not configured for this build","messagePattern":"sending diagnostics is not configured for this build","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/ipc/diagnostics.ts","lineNumber":267,"sourceCode":"      // Consent gate: main is the consent enforcement boundary; the\n      // renderer-side button-hide is UX, not security. Re-check here in case\n      // the user toggled the setting off between collect and upload.\n      if (!getDiagnosticsStatus().bundleEnabled) {\n        throw new Error('sending diagnostics is disabled')\n      }\n      const confirmed = await confirmBundleUpload(pendingForConfirmation.bundle)\n      if (!confirmed) {\n        return { canceled: true }\n      }\n      // Why: the preview can be discarded or diagnostics can be disabled\n      // while the native confirmation dialog is open.\n      const { bundle, payload } = getPendingBundleForUpload(bundleSubmissionId)\n      if (!getDiagnosticsStatus().bundleEnabled) {\n        throw new Error('sending diagnostics is disabled')\n      }\n      const tokenEndpoint = resolveDiagnosticTokenEndpoint()\n      if (!tokenEndpoint) {\n        throw new Error('sending diagnostics is not configured for this build')\n      }\n      const result = await uploadDiagnosticBundle({\n        tokenEndpoint,\n        payload,\n        bundleSubmissionId: bundle.bundleSubmissionId\n      })\n      const uploadedPending = pendingBundles.get(bundle.bundleSubmissionId)\n      if (uploadedPending) {\n        deletePendingBundle(bundle.bundleSubmissionId)\n      }\n      return result\n    }\n  )\n\n  ipcMain.handle('diagnostics:openBundlePreview', async (_event, bundleSubmissionId: unknown) => {\n    const previewFilePath = getPendingPreviewFilePath(bundleSubmissionId)\n    const errorMessage = await shell.openPath(previewFilePath)\n    if (errorMessage) {","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/diagnostics.ts#L249-L285","documentation":"Thrown by `diagnostics:uploadBundle` when `resolveDiagnosticTokenEndpoint()` returns null. That resolver returns null when an official build (stable/rc) had its build-time `ORCA_DIAGNOSTICS_TOKEN_URL` constant left unsubstituted by CI, or when a dev build has neither the `ORCA_DIAGNOSTICS_TOKEN_URL` env var nor the build constant set. The upload endpoint URL never crosses IPC, so the renderer cannot supply it; main must resolve it from build/env configuration.","triggerScenarios":"Invoking `diagnostics:uploadBundle` on a build where `resolveDiagnosticTokenEndpoint()` is null: a local dev build with `ORCA_DIAGNOSTICS_TOKEN_URL` unset, or an official build whose CI did not inject the token URL constant.","commonSituations":"Running an unpackaged dev build without the diagnostics env var; CI release pipeline that skipped the secret-substitution step for the token URL; a forked/unofficial build that never configured the endpoint.","solutions":["For dev builds: set `ORCA_DIAGNOSTICS_TOKEN_URL` in the environment before launching Orca.","For official builds: ensure the release CI step substitutes `ORCA_DIAGNOSTICS_TOKEN_URL` (and `ORCA_BUILD_IDENTITY`) at build time.","Hide/disable the upload affordance in the renderer when `diagnostics:getStatus` indicates no endpoint is configured."],"exampleFix":"// before (dev run, no env)\norca --dev   # then click Upload Bundle -> throws\n\n// after\nORCA_DIAGNOSTICS_TOKEN_URL=https://tokens.example.dev/v1/diagnostics orca --dev","handlingStrategy":"validation","validationCode":"// Only offer upload when the build actually has a token endpoint.\n// Expose endpoint-configured via diagnostics:getStatus (or a dedicated channel)\n// and gate the upload button on it.\nif (!buildHasDiagnosticEndpoint()) {\n  showNotice('Diagnostic upload is not configured for this build.')\n  return\n}\nawait ipcRenderer.invoke('diagnostics:uploadBundle', submissionId)","typeGuard":"function endpointIsConfigured(): boolean {\n  // for dev builds, check the env var presence in main; for official builds, trust the build flag\n  return Boolean(process.env.ORCA_DIAGNOSTICS_TOKEN_URL)\n}","tryCatchPattern":"try {\n  await ipcRenderer.invoke('diagnostics:uploadBundle', submissionId)\n} catch (e) {\n  if (e instanceof Error && e.message === 'sending diagnostics is not configured for this build') {\n    showBuildConfigNotice()\n    return\n  }\n  throw e\n}","preventionTips":["For dev runs, always export ORCA_DIAGNOSTICS_TOKEN_URL before launching.","In release CI, assert the token URL constant is substituted before signing the build.","Hide the upload UI on builds where the endpoint cannot resolve."],"tags":["diagnostics","configuration","build-config","network","env"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}