{"record":{"id":"817e046cd45d06b2","repo":"plandex-ai/plandex","slug":"execstatusshouldcontinue-missing-required-xml-tag","errorCode":null,"errorMessage":"execStatusShouldContinue: missing required XML tags in response","messagePattern":"execStatusShouldContinue: missing required XML tags in response","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/model/plan/exec_status.go","lineNumber":179,"sourceCode":"\t})\n\n\tif err != nil {\n\t\tlog.Printf(\"[ExecStatus] Error in model call: %v\", err)\n\t\treturn execStatusShouldContinueResult{}, nil\n\t}\n\n\tcontent := modelRes.Content\n\n\tvar reasoning string\n\tvar subtaskFinished bool\n\n\tif baseModelConfig.PreferredOutputFormat == shared.ModelOutputFormatXml {\n\t\treasoning = utils.GetXMLContent(content, \"reasoning\")\n\t\tsubtaskFinishedStr := utils.GetXMLContent(content, \"subtaskFinished\")\n\t\tsubtaskFinished = subtaskFinishedStr == \"true\"\n\n\t\tif reasoning == \"\" || subtaskFinishedStr == \"\" {\n\t\t\tgo notify.NotifyErr(notify.SeverityError, fmt.Errorf(\"execStatusShouldContinue: missing required XML tags in response\"))\n\n\t\t\treturn execStatusShouldContinueResult{}, &shared.ApiError{\n\t\t\t\tType:   shared.ApiErrorTypeOther,\n\t\t\t\tStatus: http.StatusInternalServerError,\n\t\t\t\tMsg:    \"Missing required XML tags in response\",\n\t\t\t}\n\t\t}\n\t} else {\n\n\t\tif content == \"\" {\n\t\t\tlog.Printf(\"[ExecStatus] No function response found in model output\")\n\t\t\treturn execStatusShouldContinueResult{}, nil\n\t\t}\n\n\t\tvar res types.ExecStatusResponse\n\t\tif err := json.Unmarshal([]byte(content), &res); err != nil {\n\t\t\tlog.Printf(\"[ExecStatus] Failed to parse response: %v\", err)\n\t\t\treturn execStatusShouldContinueResult{}, nil","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/exec_status.go#L161-L197","documentation":"execStatusShouldContinue asks the LLM whether the current subtask is finished, using an XML response format with <reasoning> and <subtaskFinished> tags. If either required tag is missing or empty in the model output, it returns this 500 ApiError since the continuation decision cannot be made.","triggerScenarios":"The exec-status model replies without the required XML tags — wrong format adherence, truncated response due to small max_tokens, or a model that ignores the SysExecStatus prompt structure (common with small local models).","commonSituations":"Local models (Ollama, vLLM-hosted small models) not following XML instructions; switching PreferredOutputFormat to xml for a model not tuned for it; response truncation on long reasoning; provider incidents returning partial content.","solutions":["Switch the exec-status model to one that reliably follows the XML prompt format","Increase max_tokens so the full XML response fits","Retry the call — format adherence can be intermittent","Patch server to retry once on missing tags before failing the whole plan stream"],"exampleFix":"// before: small model with xml format\n\"ExecStatus\": {\"PreferredOutputFormat\": \"xml\", \"ModelName\": \"tiny-3b\"}\n// after\n\"ExecStatus\": {\"PreferredOutputFormat\": \"xml\", \"ModelName\": \"gpt-4o-mini\", \"MaxTokens\": 1024}","handlingStrategy":"retry","validationCode":"// verify required tags present before deciding to continue\nreasoning := utils.GetXMLContent(content, \"reasoning\")\nfinished := utils.GetXMLContent(content, \"subtaskFinished\")\nif reasoning == \"\" || finished == \"\" { return retryExecStatusCall() }","typeGuard":null,"tryCatchPattern":"res, apiErr := execStatusShouldContinue(...)\nif apiErr != nil && strings.Contains(apiErr.Msg, \"Missing required XML tags\") {\n    // retry once, then fail safe (stop the subtask)\n    res, apiErr = execStatusShouldContinue(...)\n    if apiErr != nil { return stopSubtask(planId) }\n}","preventionTips":["Use models known to follow XML prompts for exec-status checks","Keep max_tokens large enough for reasoning + tags","Prefer non-XML (tool-call) format for models weak at format adherence","Fail safe on repeated failures: end the subtask rather than looping forever"],"tags":["llm","xml-parsing","plan-execution"],"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-14T00:17:10.932Z"}