different-ai/openwork · error

Invalid timestamp: expected finite number, got ${msecs}

Error message

Invalid timestamp: expected finite number, got ${msecs}

What it means

Error "Invalid timestamp: expected finite number, got ${msecs}" thrown in different-ai/openwork.

Source

Thrown at ee/packages/utils/src/typeid.ts:238

  return parsed.toString() as TypeId<T>
}

const typeIdWithTimestamp = <const T extends IdTypePrefixNames>(
  typeName: T,
  timestamp?: Date | number,
): TypeId<T> => {
  let msecs: number

  if (timestamp === undefined) {
    msecs = DateTime.now().toMillis()
  } else if (timestamp instanceof Date) {
    msecs = timestamp.getTime()
  } else {
    msecs = timestamp
  }

  if (!Number.isFinite(msecs)) {
    throw new Error(`Invalid timestamp: expected finite number, got ${msecs}`)
  }
  if (msecs < 0) {
    throw new Error(`Invalid timestamp: expected non-negative number, got ${msecs}`)
  }

  const uuid = uuidv7({ msecs })
  const prefix = idTypesMapNameToPrefix[typeName]
  return TypeID.fromUUID(prefix, uuid).toString() as TypeId<T>
}

const getColumnLength = <const T extends IdTypePrefixNames>(typeName: T) =>
  idTypesMapNameToPrefix[typeName].length + 1 + TYPE_ID_SUFFIX_LENGTH

export const typeId = {
  schema: typeIdZodSchema,
  generator: typeIdGenerator,
  generatorWithTimestamp: typeIdWithTimestamp,
  validator: validateTypeId,

View on GitHub (pinned to 2b7df46e8a)

When it happens

Trigger: Thrown at ee/packages/utils/src/typeid.ts:238 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/790a3578b82f882d. Report an issue: GitHub.