plandex-ai/plandex · error

No name tag found in XML response

Error message

No name tag found in XML response

What it means

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.

Source

Thrown at app/server/model/name.go:207

		Tools:         tools,
		ToolChoice:    toolChoice,
		SessionId:     sessionId,
		Settings:      settings,
		OrgUserConfig: orgUserConfig,
	})

	if err != nil {
		fmt.Printf("Error during piped data name model call: %v\n", err)
		return "", err
	}

	var name string
	content := modelRes.Content

	if baseModelConfig.PreferredOutputFormat == shared.ModelOutputFormatXml {
		name = utils.GetXMLContent(content, "name")
		if name == "" {
			return "", fmt.Errorf("No name tag found in XML response")
		}
	} else {
		if content == "" {
			fmt.Println("no namePipedData function call found in response")
			return "", fmt.Errorf("No namePipedData function call found in response. The model failed to generate a valid response.")
		}

		var nameRes prompts.PipedDataNameRes
		err = json.Unmarshal([]byte(content), &nameRes)
		if err != nil {
			fmt.Printf("Error unmarshalling piped data name response: %v\n", err)
			return "", err
		}
		name = nameRes.Name
	}

	return name, nil
}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Retry the generation; noncompliant formatting is often transient.
  2. Strengthen the prompt with an explicit XML schema example including <name>.
  3. Verify GetXMLContent parsing is case-consistent with the tags the model emits and handles fenced output.
  4. Confirm PreferredOutputFormat matches the prompt template actually used.
  5. Add a fallback parser that strips code fences / trailing text before extraction.

Example fix

// before
name := utils.GetXMLContent(content, "name")
// after: strip code fences first
content = strings.TrimSpace(strings.Trim(strings.TrimSpace(content), "`"))
name := utils.GetXMLContent(content, "name")
Defensive patterns

Strategy: validation

Validate before calling

if cfg.PreferredOutputFormat == shared.ModelOutputFormatXml && !strings.Contains(content, "<name>") {
    return "", errors.New("model XML response missing <name> tag")
}

Try / catch

name, err := model.GenPipedDataName(ctx, req)
if err != nil {
    if strings.Contains(err.Error(), "No name tag found in XML") {
        // fallback: retry or use default name
        name = defaultPipedDataName(req)
    } else { return err }
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/264ae9238ed9f5d3. Report an issue: GitHub.