paperclipai/paperclip · error · Error
No company found by ID '${selector}'.
Error message
No company found by ID '${selector}'. What it means
Thrown by resolveCompanyForDeletion when by==='id' (or the auto path is forced to id) and no company in the provided list has an id equal to the selector. The lookup is exact and case-sensitive against company.id.
Source
Thrown at cli/src/commands/client/company.ts:1287
return company.issuePrefix.toUpperCase() === selector.toUpperCase();
}
export function resolveCompanyForDeletion(
companies: Company[],
selectorRaw: string,
by: CompanyDeleteSelectorMode = "auto",
): Company {
const selector = normalizeSelector(selectorRaw);
if (!selector) {
throw new Error("Company selector is required.");
}
const idMatch = companies.find((company) => company.id === selector);
const prefixMatch = companies.find((company) => matchesPrefix(company, selector));
if (by === "id") {
if (!idMatch) {
throw new Error(`No company found by ID '${selector}'.`);
}
return idMatch;
}
if (by === "prefix") {
if (!prefixMatch) {
throw new Error(`No company found by shortname/prefix '${selector}'.`);
}
return prefixMatch;
}
if (idMatch && prefixMatch && idMatch.id !== prefixMatch.id) {
throw new Error(
`Selector '${selector}' is ambiguous (matches both an ID and a shortname). Re-run with --by id or --by prefix.`,
);
}
if (idMatch) return idMatch;View on GitHub (pinned to 67001ec6eb)
Solutions
- Run 'paperclipai company list' and copy the exact 'id' value.
- If you meant the prefix, use '--by prefix' instead.
- Drop --by entirely to let auto-resolution try both id and prefix.
- Ensure the companies list passed in is complete (refresh / paginate) before resolving.
Example fix
# before paperclipai company delete cmp_ABC --by id --yes --confirm cmp_ABC # after (correct id from `company list`) paperclipai company delete cmp_abc123 --by id --yes --confirm cmp_abc123
Defensive patterns
Strategy: validation
Validate before calling
function ensureCompanyById(companies: { id: string }[], selector: string): void {
if (!companies.some((c) => c.id === selector)) {
throw new Error(`No company with id '${selector}'. Run 'company list'.`);
}
} Type guard
function companyIdExists(companies: { id: string }[], selector: string): boolean {
return companies.some((c) => c.id === selector);
} Prevention
- Fetch a fresh, paginated company list before resolving by id.
- Copy ids verbatim from list output.
- Prefer '--by id' only when you hold the canonical id.
When it happens
Trigger: Passing --by id with a selector that is a prefix instead of an id. Typing the id with wrong case, extra whitespace, or a stale id from a deleted company. Calling resolveCompanyForDeletion with a companies list that does not include the target (e.g. wrong tenant/page).
Common situations: User copies an issue prefix (PAP) thinking it is the id. The company was deleted by another operator. Pagination meant the target was not in the fetched list. Case mismatch on a case-sensitive id.
Related errors
- No company found by shortname/prefix '${selector}'.
- Selector '${selector}' is ambiguous (matches both an ID and
- No company found for selector '${selector}'. Use company ID
- Company selector is required.
- Deletion requires --yes.
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/11799ae313b666d4.
Report an issue: GitHub.