deepseek-ai/deepseek-harness · error · Error

harness.defineTool ${path} must contain only own enumerable

Error message

harness.defineTool ${path} must contain only own enumerable string keys

What it means

Error "harness.defineTool ${path} must contain only own enumerable string keys" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/extensions/cordis-host-runner/src/guard.ts:82

    && hasIntrinsicConstructor(objectPrototype, 'Object')
}
/* jscpd:ignore-end */

/** Whether a schema list is a dense intrinsic array with no JSON-invisible decorations. */
function isDensePlainArray(value: unknown): value is unknown[] {
  if (!Array.isArray(value) || !hasPlainArrayPrototype(value) || Reflect.ownKeys(value).length !== value.length + 1) {
    return false
  }
  for (let index = 0; index < value.length; index++) {
    if (!Object.hasOwn(value, index)) return false
  }
  return true
}

/** Reject schema records whose declarations would disappear from object enumeration. */
function assertSchemaContainerKeys(value: Record<string, unknown>, path: string): void {
  if (Reflect.ownKeys(value).some(key => typeof key !== 'string' || !Object.prototype.propertyIsEnumerable.call(value, key))) {
    throw new Error(`harness.defineTool ${path} must contain only own enumerable string keys`)
  }
}

/** Where one cloned JSON value is installed. */
type CloneDestination =
  | { kind: 'root' }
  | { kind: 'array'; target: unknown[]; index: number }
  | { kind: 'object'; target: Record<string, unknown>; key: string }

/** Deferred work for stack-safe cross-realm JSON cloning. */
type CloneTask =
  | { kind: 'visit'; value: unknown; path: string; destination: CloneDestination }
  | { kind: 'array-item'; source: unknown[]; index: number; path: string; target: unknown[] }
  | { kind: 'leave'; source: object }

/** Materialize realm-foreign lossless JSON without allowing JSON.stringify coercions; `path` carries the caller's own error prefix. */
function cloneJson(value: unknown, path: string): unknown {
  const ancestors = new Set<object>()

View on GitHub (pinned to b150a551b8)

When it happens

Trigger: Thrown at packages/extensions/cordis-host-runner/src/guard.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/7e2d7555e6b05940. Report an issue: GitHub.