xai-org/x-algorithm · error · ConfigFailure
TypeName '$typename' does not match $typeNameRegex.
Error message
TypeName '$typename' does not match $typeNameRegex.
What it means
Type names in BotMaker configs must match typeNameRegex, defined in ServiceConfigs as ^[A-Z][a-zA-Z0-9_]*$ (UpperCamelCase alphanumerics/underscore). validateTypeName throws ConfigFailure when a generated or declared type name violates this.
Source
Thrown at botmaker/src/scala/com/twitter/botmaker/runtime/config/ServiceConfigs.scala:105
if (endpoint != "ScribeClient"
&& endpointRegex.findFirstIn(endpoint).isEmpty) {
throw ConfigFailure(
s"Endpoint '$endpoint' does not match $endpointRegex."
)
}
}
def validateDataset(dataset: String): Unit = {
if (datasetRegex.findFirstIn(dataset).isEmpty) {
throw ConfigFailure(
s"Dataset '$dataset' does not match $datasetRegex."
)
}
}
def validateTypeName(typename: String): Unit = {
if (typeNameRegex.findFirstIn(typename).isEmpty) {
throw ConfigFailure(
s"TypeName '$typename' does not match $typeNameRegex."
)
}
}
def validateTeamName(teamName: String): Unit = {
if (teamNameRegex.findFirstIn(teamName).isEmpty) {
throw ConfigFailure(
s"Team name '$teamName' does not match $teamNameRegex."
)
}
}
def validateClassName(className: String): Unit = {
ClassCache.forName(className)
}
override def addConfig(View on GitHub (pinned to 24c60942c5)
Solutions
- Capitalize and sanitize: name must match ^[A-Z][a-zA-Z0-9_]*$
- Apply a toUpperCamelCase converter to generated type names before registration
- Unit-test the name generator against typeNameRegex
Example fix
// before
typeName("content_scan_v2")
// after
typeName("ContentScanV2") Defensive patterns
Strategy: type-guard
Validate before calling
TYPE_NAME_RE = re.compile(r'^[A-Z][a-zA-Z0-9_]*$') def validTypeName(n): return bool(TYPE_NAME_RE.match(n))
Type guard
def isValidTypeName(name: str) -> bool:
return bool(re.match(r'^[A-Z][a-zA-Z0-9_]*$', name)) Prevention
- Capitalize generated type names via toUpperCamelCase
- Test generators against the regex
When it happens
Trigger: Registering a config containing a type whose name does not start with an uppercase letter or contains characters outside [a-zA-Z0-9_] — e.g. "contentScan", "Content-Scan", "2ndType", or an empty name.
Common situations: Autogenerating type names from lowercase dataset/field names without capitalizing; pluralization or prefixing logic producing leading digits or symbols.
Related errors
- Event type '$eventType' does not match $eventTypeRegex.
- Field name '$fieldName' does not match $fieldNameRegex.
- Func name '$funcName' does not match $funcNameRegex.
- Endpoint '$endpoint' does not match $endpointRegex.
- Dataset '$dataset' does not match $datasetRegex.
AI-assisted analysis of xai-org/x-algorithm@24c60942c5 (2026-08-28).
Data as JSON: /api/errors/10f5267a31c34c72.
Report an issue: GitHub.