From f80398313cedef50ad7aeb64a1fe3a8eacc2e63e Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Wed, 14 Oct 2026 17:48:15 -0500 Subject: [PATCH] perf(skills): skip inventory for an empty runtime selection Co-Authored-By: Paperclip --- server/src/services/company-skills.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/services/company-skills.ts b/server/src/services/company-skills.ts index c6da9f8bb86..0c4f5df645d 100644 --- a/server/src/services/company-skills.ts +++ b/server/src/services/company-skills.ts @@ -6143,6 +6143,8 @@ export function companySkillService(db: Db, options: { actor?: AuthorizationActo companyId: string, options: RuntimeSkillEntryOptions = {}, ): Promise { + if (options.onlyKeys?.size === 0 || (!options.onlyKeys && options.selectionConfig && !options.includeLegacy + && readPaperclipSkillSyncPreference(options.selectionConfig).desiredSkills.length === 0)) return []; const skills = await listFull(companyId); const selectedKeys = options.onlyKeys ?? (options.selectionConfig ? new Set( (options.includeLegacy ? resolveLegacyPaperclipDesiredSkillNames : resolvePaperclipDesiredSkillNames)(