{"record":{"id":"17ad4ffc7a07b5a5","repo":"plandex-ai/plandex","slug":"no-namenote-function-call-found-in-response-the-m","errorCode":null,"errorMessage":"No nameNote function call found in response. The model failed to generate a valid response.","messagePattern":"No nameNote function call found in response\\. The model failed to generate a valid response\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/server/model/name.go","lineNumber":310,"sourceCode":"\t})\n\n\tif err != nil {\n\t\tfmt.Printf(\"Error during note 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 nameNote function call found in response\")\n\t\t\treturn \"\", fmt.Errorf(\"No nameNote function call found in response. The model failed to generate a valid response.\")\n\t\t}\n\n\t\tvar nameRes prompts.NoteNameRes\n\t\terr = json.Unmarshal([]byte(content), &nameRes)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Error unmarshalling note 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}\n","sourceCodeStart":292,"sourceCodeEnd":324,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/name.go#L292-L324","documentation":"GenNoteName, in the non-XML path, expects a nameNote function call whose content is JSON for prompts.NoteNameRes. When the response Content is empty — i.e. the model made no nameNote function call — this error is returned, meaning no structured name was produced.","triggerScenarios":"PreferredOutputFormat != XML and the LLM response lacks a nameNote function call: plain-text answer, refusal, missing/misconfigured tools, or provider silently dropping tool_call fields.","commonSituations":"Switching to models with weaker function calling, API version drift changing tool_call shape, prompts encouraging direct answers, or token truncation before the tool call.","solutions":["Retry the request once before failing the operation.","Set tool_choice to force the nameNote function.","Verify nameNote is registered in the tools list with a valid schema.","Raise max_tokens and keep format instructions explicit.","Prefer models with reliable native function calling."],"exampleFix":"// before\nmodelReq{Prompt: prompt, Tools: tools}\n// after\nmodelReq{Prompt: prompt, Tools: tools, ToolChoice: {Type: \"function\", Function: {Name: \"nameNote\"}}}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func hasContent(res *shared.ModelRes) bool { return res != nil && res.Content != \"\" }","tryCatchPattern":"name, err := model.GenNoteName(ctx, req)\nif err != nil {\n    if strings.Contains(err.Error(), \"No nameNote function call found\") {\n        name, err = model.GenNoteName(ctx, req) // one retry\n    }\n    if err != nil { return fmt.Errorf(\"note naming failed: %w\", err) }\n}","preventionTips":["Force tool_choice to nameNote","Verify tools registration and JSON schema for nameNote","Avoid prompts that encourage free-form answers","Use temperature 0-0.3 for structured naming tasks"],"tags":["llm","function-calling","model-response"],"backgroundTag":"llm-empty-tool-call-response","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"}