{"record":{"id":"42e304883fa41109","repo":"LykosAI/StabilityMatrix","slug":"expected-opening-bracket","errorCode":null,"errorMessage":"Expected opening bracket.","messagePattern":"Expected opening bracket\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/PromptSyntax/PromptSyntaxBuilder.cs","lineNumber":241,"sourceCode":"            }\n            else\n            {\n                // It's part of the content.\n                node.Content.Add(ParseNode()); // Recursively parse nested nodes.\n            }\n        }\n\n        return node;\n    }\n\n    private NetworkNode ParseNetwork()\n    {\n        var beginNetworkToken = ConsumeToken();\n        if (\n            beginNetworkToken is null\n            || !beginNetworkToken.Scopes.Contains(\"punctuation.definition.network.begin.prompt\")\n        )\n            throw new InvalidOperationException(\"Expected opening bracket.\");\n\n        // type\n        var typeToken = PeekToken();\n        if (typeToken is null || !typeToken.Scopes.Contains(\"meta.embedded.network.type.prompt\"))\n            throw new InvalidOperationException(\"Expected network type.\");\n        var type = ParseIdentifier();\n\n        // colon\n        var colonToken = ConsumeToken();\n        if (colonToken is null || !colonToken.Scopes.Contains(\"punctuation.separator.variable.prompt\"))\n            throw new InvalidOperationException(\"Expected colon.\");\n\n        // name\n        var nameToken = PeekToken();\n        if (nameToken is null || !nameToken.Scopes.Contains(\"meta.embedded.network.model.prompt\"))\n            throw new InvalidOperationException(\"Expected network name.\");\n        var name = ParseText();\n","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/PromptSyntax/PromptSyntaxBuilder.cs#L223-L259","documentation":"Thrown by ParseNetwork at the start of parsing a network (LoRA/LyCORIS) directive, which must begin with a '<' token scoped as 'punctuation.definition.network.begin.prompt'. If the consumed token is missing or lacks that scope, the parser assumes the '<xyz:...>' syntax was attempted but malformed.","triggerScenarios":"Parsing a prompt containing '<' that is not a valid network opener, e.g. '<lora' cut off, or a stray '<' used as a comparison/text character that the tokenizer did not scope as a network begin.","commonSituations":"A1111/ComfyUI users paste LoRA tags like '<lora:model:1>' from other tools into a prompt that Stability Matrix tokenizes differently; truncated '<lora' tags when copying prompts; XML-like fragments in prompt text.","solutions":["Write the full network tag: '<lora:name:0.8>' with opening '<' and closing '>'","Remove stray '<' characters that are not network tags from the prompt","Verify the tokenizer grammar recognizes the '<' as punctuation.definition.network.begin.prompt","Catch InvalidOperationException and show the user which part of the prompt is malformed"],"exampleFix":"// before\nvar prompt = \"lora:myModel:0.8\"; // missing < >\n// after\nvar prompt = \"<lora:myModel:0.8>\";","handlingStrategy":"validation","validationCode":"static readonly System.Text.RegularExpressions.Regex NetworkTag = new(\"<lora:[^:<>]+(:[0-9.]+)?(:[0-9.]+)?>\"); bool HasWellFormedNetworkTag(string prompt) => NetworkTag.IsMatch(prompt);","typeGuard":"null","tryCatchPattern":"try { var node = builder.Parse(prompt); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"opening bracket\")) { // flag stray '<' characters in the prompt }","preventionTips":["Escape or remove '<' used as plain text in prompts","Only emit complete '<lora:name:weight>' tags from generators","Validate network tags with a regex before parsing","Copy LoRA tags whole, never partially"],"tags":["parser","prompt-syntax","lora","network-tag"],"backgroundTag":"invalid-argument-format","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}