{"record":{"id":"7105d56202777744","repo":"paperclipai/paperclip","slug":"no-environment-selected","errorCode":null,"errorMessage":"No environment selected","messagePattern":"No environment selected","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/pages/CompanyEnvironments.tsx","lineNumber":1376,"sourceCode":"  });\n  const createSecret = useMutation({\n    mutationFn: (input: { name: string; value: string }) => {\n      if (!selectedCompanyId) throw new Error(\"Select a company to create secrets\");\n      return secretsApi.create(selectedCompanyId, input);\n    },\n    onSuccess: async () => {\n      if (!selectedCompanyId) return;\n      await queryClient.invalidateQueries({ queryKey: queryKeys.secrets.list(selectedCompanyId) });\n    },\n  });\n\n  // Managed (platform-provisioned) environments accept exactly one tenant\n  // edit: the env var map. The server's write floor rejects everything\n  // else, so this mutation sends an envVars-only PATCH — the one body\n  // shape the floor admits.\n  const managedEnvironmentEnvVarsMutation = useMutation({\n    mutationFn: async (envVars: EnvironmentFormState[\"envVars\"]) => {\n      if (!editingEnvironmentId) throw new Error(\"No environment selected\");\n      return await environmentsApi.update(editingEnvironmentId, { envVars }, selectedCompanyId);\n    },\n    onSuccess: async (environment) => {\n      if (selectedCompanyId) {\n        await queryClient.invalidateQueries({\n          queryKey: queryKeys.environments.list(selectedCompanyId),\n        });\n      }\n      initializedFormKeyRef.current = null;\n      setEnvironmentForm(createEmptyEnvironmentForm());\n      setEnvironmentFormBaselineKey(null);\n      setEnvironmentVariablesDirty(false);\n      navigate(ENVIRONMENTS_PATH, { replace: true });\n      pushToast({\n        title: \"Environment variables updated\",\n        body: `${environment.name} will inject the updated variables into future runs.`,\n        tone: \"success\",\n      });","sourceCodeStart":1358,"sourceCodeEnd":1394,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/ui/src/pages/CompanyEnvironments.tsx#L1358-L1394","documentation":"Placeholder error recorded for the 'No environment selected' state in CompanyEnvironments.tsx. It fires when an environment-scoped action (secret or environment operation) is attempted while the environment selection is empty — a precondition sentinel, not a server response.","triggerScenarios":"Thrown at ui/src/pages/CompanyEnvironments.tsx:1348 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Select an environment before performing this action."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}