can1357/oh-my-pi · error · Error

Invalid marketplace name: "${marketplace}"

Error message

Invalid marketplace name: "${marketplace}"

What it means

The marketplace segment of buildPluginId failed isValidNameSegment: it must be 1–64 characters, lowercase alphanumerics with internal dots/hyphens, no leading/trailing dot or hyphen, and no `@` (which would break the `name@marketplace` ID format). This indicates the marketplace identifier supplied to the ID builder is malformed — usually from a hand-edited or generated marketplace registry name.

Source

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

// ── Plugin ID helpers ────────────────────────────────────────────────

const NAME_RE = /^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$/;
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;

View on GitHub (pinned to 9690622007)

Solutions

  1. Fix the marketplace name in the config/catalog to a valid slug: /^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$/, ≤64 chars.
  2. Normalize programmatically (lowercase, strip invalid chars, trim edge dots/hyphens) before calling buildPluginId.
  3. Guard with isValidNameSegment(marketplace) before building and report a config error to the user naming the offending marketplace entry.
  4. If the marketplace identifier legitimately contains uppercase or underscores (e.g. an org name), mint a separate lowercase slug field for it.

Example fix

// before
const id = buildPluginId("my-tool", "Acme Market");
// after
const id = buildPluginId("my-tool", "acme-market");
Defensive patterns

Strategy: validation

Validate before calling

if (!isValidNameSegment(marketplace)) {
	throw new Error(`Marketplace name must match /^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$/ (1-64 chars, no "@"): "${marketplace}"`);
}

Type guard

function isMarketplaceName(v: unknown): v is string {
	return typeof v === "string" && /^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$/.test(v) && v.length <= 64 && !v.includes("@");
}

Try / catch

let id: string;
try {
	id = buildPluginId(name, marketplace);
} catch (err) {
	if (err instanceof Error && err.message.startsWith('Invalid marketplace name')) {
		throw new Error(`Fix the marketplace entry "${marketplace}" in your plugin config: lowercase slug required.`);
	}
	throw err;
}

Prevention

When it happens

Trigger: Calling buildPluginId(name, marketplace) with an empty marketplace string, one longer than 64 chars, containing uppercase/underscores/spaces/`@`, or a value like `my-market-` (trailing hyphen) or `Corp Market` (space).

Common situations: A user's marketplace config file has a marketplace key like `Work_Marketplace` or an empty name field; tooling derives the marketplace name from a URL (leaving `github.com` with slashes/dots in wrong places) or from a display label; marketplace renamed and old capitalized names remain in config.

Related errors


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