deepseek-ai/deepseek-harness · error · InvalidPresetIdError

agent-presets: preset id ${presetId} must match /^[a-z0-9][a

Error message

agent-presets: preset id ${presetId} must match /^[a-z0-9][a-z0-9-]*$/ — the id is a directory name, so anything else could escape the preset root

What it means

Error "agent-presets: preset id ${presetId} must match /^[a-z0-9][a-z0-9-]*$/ — the id is a directory name, so anything else could escape the preset root" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/preset/agent-presets/src/authoring.ts:142

 * `order` are not — a copy presenting itself identically to its source, or
 * sorted into the shipped set's declared order, would make the roster stop
 * distinguishing them. With no name given and no description to keep, the
 * file is removed so the copy publishes nothing rather than a blank.
 * @param roots - the configured roots; the first `user` one receives the copy.
 * @param source - the resolved preset the copy starts from.
 * @param id - the new preset's id, which becomes its directory name.
 * @param name - display name for the copy; omitted falls back to the id.
 * @returns the absolute path of the new preset directory.
 * @throws when the id is unusable or already occupied on disk, or the
 * deployment configures no writable root.
 */
export async function copyComposition(
  roots: readonly PresetRoot[],
  source: AgentPreset,
  id: string,
  name?: string,
): Promise<string> {
  if (!PRESET_ID.test(id)) throw new InvalidPresetIdError(id)
  const dir = join(writableRoot(roots), id)
  // The roster check upstream only sees discovered presets; a directory with
  // no composition file still occupies the name and deserves a readable
  // refusal rather than a filesystem error code.
  if (await occupied(dir)) throw new PresetExistsError(id)
  try {
    await cp(dirname(source.path), dir, {
      recursive: true, dereference: true, force: false, errorOnExist: true,
    })
    await tightenModes(dir)
    const rendered = renderPresetMetadata({
      ...name === undefined ? {} : { name },
      ...source.description === undefined ? {} : { description: source.description },
    })
    const metadataPath = join(dir, METADATA_FILE)
    if (rendered === undefined) {
      await rm(metadataPath, { force: true })
    } else {

View on GitHub (pinned to b150a551b8)

Solutions

  1. Use a preset id matching /^[a-z0-9][a-z0-9-]*$/.

When it happens

Trigger: Thrown at packages/preset/agent-presets/src/authoring.ts:142 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/944ad9b621da6e49. Report an issue: GitHub.