{"record":{"id":"f580f5db620586ae","repo":"plandex-ai/plandex","slug":"no-commitmsg-tag-found-in-xml-response","errorCode":null,"errorMessage":"no commitMsg tag found in XML response","messagePattern":"no commitMsg tag found in XML response","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/model/plan/commit_msg.go","lineNumber":132,"sourceCode":"\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"error during plan description model call: %v\", err))\n\n\t\treturn nil, &shared.ApiError{\n\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\tStatus: http.StatusInternalServerError,\n\t\t\tMsg:    fmt.Sprintf(\"error during plan description model call: %v\", err),\n\t\t}\n\t}\n\n\tlog.Println(\"Plan description model call complete\")\n\n\tcontent := modelRes.Content\n\n\tvar commitMsg string\n\n\tif baseModelConfig.PreferredOutputFormat == shared.ModelOutputFormatXml {\n\t\tcommitMsg = utils.GetXMLContent(content, \"commitMsg\")\n\t\tif commitMsg == \"\" {\n\t\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"no commitMsg tag found in XML response\"))\n\n\t\t\treturn nil, &shared.ApiError{\n\t\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\t\tStatus: http.StatusInternalServerError,\n\t\t\t\tMsg:    \"No commitMsg tag found in XML response\",\n\t\t\t}\n\t\t}\n\t} else {\n\n\t\tif content == \"\" {\n\t\t\tfmt.Println(\"no describePlan function call found in response\")\n\n\t\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"no describePlan function call found in response\"))\n\n\t\t\treturn nil, &shared.ApiError{\n\t\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\t\tStatus: http.StatusInternalServerError,\n\t\t\t\tMsg:    \"No describePlan function call found in response. The model failed to generate a valid response.\",","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/commit_msg.go#L114-L150","documentation":"When the CommitMsg model is configured with XML preferred output format, genPlanDescription extracts the commit message from a <commitMsg> tag in the model's reply via utils.GetXMLContent. If the model's response lacks that tag (or it's empty), the server treats it as an invalid response and returns a 500 ApiError.","triggerScenarios":"The model configured for commit messages ignores the SysDescribeXml prompt and replies in free text, Markdown, or a different tag name; the response was truncated by a low max_tokens setting; a weaker/quantized local model fails to follow the XML format.","commonSituations":"Custom model packs pointing at small local models (Ollama/llama.cpp) that don't reliably emit XML; switching PreferredOutputFormat to xml on a model that isn't instruction-tuned for it; temperature/top_p settings making format adherence erratic.","solutions":["Switch the CommitMsg model config to the plain (function-call/JSON) output format instead of XML","Use a stronger instruction-following model for commit messages","Increase max_tokens so the response isn't truncated before the closing tag","Re-run — LLM output is non-deterministic, a retry often produces the tag"],"exampleFix":"// before: XML format on a weak local model\n\"CommitMsg\": {\"PreferredOutputFormat\": \"xml\", \"ModelName\": \"tiny-7b\"}\n// after: let the model use tool-call format\n\"CommitMsg\": {\"PreferredOutputFormat\": \"default\", \"ModelName\": \"gpt-4o-mini\"}","handlingStrategy":"validation","validationCode":"// check the model's raw output before relying on it\nmsg := utils.GetXMLContent(content, \"commitMsg\")\nif msg == \"\" {\n    log.Printf(\"model did not emit commitMsg tag; raw: %.200s\", content)\n}","typeGuard":null,"tryCatchPattern":"desc, apiErr := genPlanDescription(...)\nif apiErr != nil && strings.Contains(apiErr.Msg, \"commitMsg tag\") {\n    // fallback: synthesize a commit message locally or retry once\n    return fallbackCommitMsg(planId), nil\n}","preventionTips":["Only enable XML output format for models proven to follow it","Use a strong instruction-following model for CommitMsg","Raise max_tokens to avoid truncation before the closing tag","Log raw model output to diagnose format drift quickly"],"tags":["llm","xml-parsing","model-output"],"backgroundTag":"llm-output-format-mismatch","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"}