{"record":{"id":"264ae9238ed9f5d3","repo":"plandex-ai/plandex","slug":"no-name-tag-found-in-xml-response","errorCode":null,"errorMessage":"No name tag found in XML response","messagePattern":"No name tag found in XML response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/server/model/name.go","lineNumber":207,"sourceCode":"\t\tTools:         tools,\n\t\tToolChoice:    toolChoice,\n\t\tSessionId:     sessionId,\n\t\tSettings:      settings,\n\t\tOrgUserConfig: orgUserConfig,\n\t})\n\n\tif err != nil {\n\t\tfmt.Printf(\"Error during piped data name model call: %v\\n\", err)\n\t\treturn \"\", err\n\t}\n\n\tvar name string\n\tcontent := modelRes.Content\n\n\tif baseModelConfig.PreferredOutputFormat == shared.ModelOutputFormatXml {\n\t\tname = utils.GetXMLContent(content, \"name\")\n\t\tif name == \"\" {\n\t\t\treturn \"\", fmt.Errorf(\"No name tag found in XML response\")\n\t\t}\n\t} else {\n\t\tif content == \"\" {\n\t\t\tfmt.Println(\"no namePipedData function call found in response\")\n\t\t\treturn \"\", fmt.Errorf(\"No namePipedData function call found in response. The model failed to generate a valid response.\")\n\t\t}\n\n\t\tvar nameRes prompts.PipedDataNameRes\n\t\terr = json.Unmarshal([]byte(content), &nameRes)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Error unmarshalling piped data name response: %v\\n\", err)\n\t\t\treturn \"\", err\n\t\t}\n\t\tname = nameRes.Name\n\t}\n\n\treturn name, nil\n}","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/name.go#L189-L225","documentation":"GenPipedDataName, when the base model is configured for XML output, extracts the generated name via utils.GetXMLContent(content, \"name\"). If the response has no <name> element (or extraction yields an empty string), this error is returned. It indicates the model produced XML that is missing the required name tag.","triggerScenarios":"PreferredOutputFormat == shared.ModelOutputFormatXml and the model's content either is not valid XML, lacks a <name>...</name> element, or the tag is present but empty/misspelled (e.g. <Name> with case-sensitive parsing).","commonSituations":"Model wraps XML in markdown code fences, adds prose before/after the XML, or the prompt's format instructions were weakened; also common when switching models that obey format instructions differently.","solutions":["Retry the generation; noncompliant formatting is often transient.","Strengthen the prompt with an explicit XML schema example including <name>.","Verify GetXMLContent parsing is case-consistent with the tags the model emits and handles fenced output.","Confirm PreferredOutputFormat matches the prompt template actually used.","Add a fallback parser that strips code fences / trailing text before extraction."],"exampleFix":"// before\nname := utils.GetXMLContent(content, \"name\")\n// after: strip code fences first\ncontent = strings.TrimSpace(strings.Trim(strings.TrimSpace(content), \"`\"))\nname := utils.GetXMLContent(content, \"name\")","handlingStrategy":"validation","validationCode":"if cfg.PreferredOutputFormat == shared.ModelOutputFormatXml && !strings.Contains(content, \"<name>\") {\n    return \"\", errors.New(\"model XML response missing <name> tag\")\n}","typeGuard":null,"tryCatchPattern":"name, err := model.GenPipedDataName(ctx, req)\nif err != nil {\n    if strings.Contains(err.Error(), \"No name tag found in XML\") {\n        // fallback: retry or use default name\n        name = defaultPipedDataName(req)\n    } else { return err }\n}","preventionTips":["Include an explicit XML example with <name> in the naming prompt","Strip markdown fences before XML extraction","Keep output-format config and prompt template in sync","Validate XML parseability in tests against real model samples"],"tags":["llm","xml-parsing","model-response"],"backgroundTag":"llm-missing-xml-tag","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}