can1357/oh-my-pi · error · Error

Plugin ID exceeds ${MAX_ID_LENGTH} characters: "${id}"

Error message

Plugin ID exceeds ${MAX_ID_LENGTH} characters: "${id}"

What it means

buildPluginId checks that the assembled `name@marketplace` ID fits within MAX_ID_LENGTH (128 characters) even though each segment alone is ≤64. This throw means both segments are individually valid but their combined length exceeds the canonical ID cap, so the ID cannot be stored/compared safely in the installed-plugins registry. It surfaces only when both segments are near their maximum length.

Source

Thrown at packages/coding-agent/src/extensibility/plugins/marketplace/types.ts:33

const MAX_NAME_LENGTH = 64;
const MAX_ID_LENGTH = 128;

/** Validate a plugin or marketplace name segment. */
export function isValidNameSegment(s: string): boolean {
	return s.length > 0 && s.length <= MAX_NAME_LENGTH && NAME_RE.test(s);
}

/** Build canonical plugin ID: `"name@marketplace"`. Both segments are validated. */
export function buildPluginId(name: string, marketplace: string): string {
	if (!isValidNameSegment(name)) {
		throw new Error(`Invalid plugin name: "${name}"`);
	}
	if (!isValidNameSegment(marketplace)) {
		throw new Error(`Invalid marketplace name: "${marketplace}"`);
	}
	const id = `${name}@${marketplace}`;
	if (id.length > MAX_ID_LENGTH) {
		throw new Error(`Plugin ID exceeds ${MAX_ID_LENGTH} characters: "${id}"`);
	}
	return id;
}

/** Parse `"name@marketplace"` → `{ name, marketplace }` or `null`. */
export function parsePluginId(id: string): { name: string; marketplace: string } | null {
	const atIndex = id.lastIndexOf("@");
	if (atIndex <= 0 || atIndex === id.length - 1) return null;

	const name = id.slice(0, atIndex);
	const marketplace = id.slice(atIndex + 1);

	if (!isValidNameSegment(name) || !isValidNameSegment(marketplace)) return null;

	return { name, marketplace };
}

// ── Marketplace catalog (from marketplace.json in a marketplace repo) ─

View on GitHub (pinned to 9690622007)

Solutions

  1. Shorten the plugin name and/or marketplace slug so the combined `name@marketplace` is ≤128 characters (practically: keep both well under 64).
  2. If the marketplace slug is long, register it under a shorter alias and use the alias in plugin IDs.
  3. Validate total length before building: `name.length + 1 + marketplace.length <= 128` and reject earlier with a clearer message.
  4. If this comes from an old stored ID, migrate it via parsePluginId and re-issue with truncated slugs.

Example fix

// before
const id = buildPluginId("a-very-long-descriptive-plugin-name-that-goes-on-and-on-forever-x", "an-equally-long-marketplace-slug-name-also-extremely-long");
// after
const id = buildPluginId("long-plugin-name", "acme");
Defensive patterns

Strategy: validation

Validate before calling

if (name.length + 1 + marketplace.length > 128) {
	throw new Error(`Plugin ID "${name}@${marketplace}" exceeds 128 chars; shorten one of the segments.`);
}

Type guard

function fitsIdLength(name: string, marketplace: string): boolean {
	return name.length + 1 + marketplace.length <= 128;
}

Try / catch

let id: string;
try {
	id = buildPluginId(name, marketplace);
} catch (err) {
	if (err instanceof Error && err.message.includes('exceeds 128 characters')) {
		id = buildPluginId(name.slice(0, 32), marketplace.slice(0, 32));
	} else throw err;
}

Prevention

When it happens

Trigger: Calling buildPluginId with a name and marketplace whose combined length plus the `@` exceeds 128 characters — e.g. a near-64-char plugin name plus a near-64-char marketplace slug summing past 128 with the `@` separator.

Common situations: Extremely long descriptive plugin names combined with long marketplace slugs (both auto-derived from URLs or package names); generated IDs from un-slugged paths; migrating legacy entries that predated the length cap.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/318beef1ad7387dd. Report an issue: GitHub.