deepseek-ai/deepseek-harness · error

invariants: ${field} contains duplicate regex ${JSON.stringi

Error message

invariants: ${field} contains duplicate regex ${JSON.stringify(value)}

What it means

Error "invariants: ${field} contains duplicate regex ${JSON.stringify(value)}" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/runtime-diagnostics/invariants/src/index.ts:82

    this.packageName = packageName
  }
}

declare module '@deepseek-ai/cordis' {
  interface Context {
    invariants: InvariantRegistry
  }
}

/** Compile and validate one package-filter list. */
function compilePatterns(field: 'package_allowlist' | 'package_blocklist', values: readonly string[]): RegExp[] {
  const seen = new Set<string>()
  return values.map((value) => {
    if (value.length === 0 || value.trim() !== value) {
      throw new Error(`invariants: ${field} entries must be non-blank and have no surrounding whitespace`)
    }
    if (seen.has(value)) {
      throw new Error(`invariants: ${field} contains duplicate regex ${JSON.stringify(value)}`)
    }
    seen.add(value)
    try {
      return new RegExp(value)
    } catch (cause) {
      throw new Error(`invariants: ${field} contains invalid regex ${JSON.stringify(value)}`, { cause })
    }
  })
}

/** Package-owned invariant registry with global and regex-based selection. */
export class InvariantRegistry extends Service {
  static Config: Schema<Config> = z.object({
    enabled: z.boolean().default(true),
    package_allowlist: z.array(z.string()).default([]),
    package_blocklist: z.array(z.string()).default([]),
  })

View on GitHub (pinned to b150a551b8)

Solutions

  1. Remove the duplicate regex from the field.

When it happens

Trigger: Thrown at packages/runtime-diagnostics/invariants/src/index.ts:82 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/2eedb4e25cc5a56c. Report an issue: GitHub.