{"record":{"id":"4c06f2515698e977","repo":"paperclipai/paperclip","slug":"no-company-found-by-id-normalizedselector","errorCode":null,"errorMessage":"No company found by ID '${normalizedSelector}'.","messagePattern":"No company found by ID '(.+?)'\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1947,"sourceCode":"      .action(async (selector: string, opts: CompanyDeleteOptions) => {\n        try {\n          const by = (opts.by ?? \"auto\").trim().toLowerCase() as CompanyDeleteSelectorMode;\n          if (![\"auto\", \"id\", \"prefix\"].includes(by)) {\n            throw new Error(`Invalid --by mode '${opts.by}'. Expected one of: auto, id, prefix.`);\n          }\n\n          const ctx = resolveCommandContext(opts);\n          const normalizedSelector = normalizeSelector(selector);\n          assertDeleteFlags(opts);\n\n          let target: Company | null = null;\n          const shouldTryIdLookup = by === \"id\" || (by === \"auto\" && isUuidLike(normalizedSelector));\n          if (shouldTryIdLookup) {\n            const byId = await ctx.api.get<Company>(apiPath`/api/companies/${normalizedSelector}`, { ignoreNotFound: true });\n            if (byId) {\n              target = byId;\n            } else if (by === \"id\") {\n              throw new Error(`No company found by ID '${normalizedSelector}'.`);\n            }\n          }\n\n          if (!target && ctx.companyId) {\n            const scoped = await ctx.api.get<Company>(apiPath`/api/companies/${ctx.companyId}`, { ignoreNotFound: true });\n            if (scoped) {\n              try {\n                target = resolveCompanyForDeletion([scoped], normalizedSelector, by);\n              } catch {\n                // Fallback to board-wide lookup below.\n              }\n            }\n          }\n\n          if (!target) {\n            try {\n              const companies = (await ctx.api.get<Company[]>(\"/api/companies\")) ?? [];\n              target = resolveCompanyForDeletion(companies, normalizedSelector, by);","sourceCodeStart":1929,"sourceCodeEnd":1965,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/company.ts#L1929-L1965","documentation":"In the delete flow with --by id, no company in the resolved list matches the normalized selector as an ID; the lookup guard failed to find the target.","triggerScenarios":"Thrown at cli/src/commands/client/company.ts:1947 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the company ID with `paperclipai company list` and re-run with the correct ID."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}