{"record":{"id":"bac818f7f1796160","repo":"plandex-ai/plandex","slug":"model-stopped-with-error-status-the-model-is-not","errorCode":null,"errorMessage":"model stopped with error status | The model is not responding.","messagePattern":"model stopped with error status \\| The model is not responding\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/server/model/client_stream.go","lineNumber":193,"sourceCode":"\t\t\t\t// Previously we'd return an error if there were no choices, but some models do this and then keep streaming, so we'll just log it and continue\n\t\t\t\tlog.Println(\"processChatCompletionStream - no choices in response\")\n\t\t\t\t// err := fmt.Errorf(\"no choices in response\")\n\t\t\t\t// return accumulator.Result(false, err), err\n\t\t\t\temptyChoices = true\n\t\t\t}\n\n\t\t\t// We'll be more accepting of multiple choices and just take the first one\n\t\t\t// if len(response.Choices) > 1 {\n\t\t\t// \terr = fmt.Errorf(\"stream finished with more than one choice | The model failed to generate a valid response.\")\n\t\t\t// \treturn accumulator.Result(true, err), err\n\t\t\t// }\n\n\t\t\tif !emptyChoices {\n\t\t\t\tchoice := response.Choices[0]\n\n\t\t\t\tif choice.FinishReason != \"\" {\n\t\t\t\t\tif choice.FinishReason == \"error\" {\n\t\t\t\t\t\terr = fmt.Errorf(\"model stopped with error status | The model is not responding.\")\n\t\t\t\t\t\treturn accumulator.Result(true, err), err\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Reset the timer for the usage chunk\n\t\t\t\t\t\tif !timer.Stop() {\n\t\t\t\t\t\t\t<-timer.C\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimer.Reset(USAGE_CHUNK_TIMEOUT)\n\t\t\t\t\t\tstreamFinished = true\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif req.Tools != nil {\n\t\t\t\t\tif choice.Delta.ToolCalls != nil {\n\t\t\t\t\t\ttoolCall := choice.Delta.ToolCalls[0]\n\t\t\t\t\t\tcontent = toolCall.Function.Arguments\n\t\t\t\t\t}\n\t\t\t\t} else {","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/client_stream.go#L175-L211","documentation":"The provider sent a chunk whose first choice has FinishReason == \"error\", signaling the model stopped abnormally server-side. The library converts this into a hard error attached to the partial result. It is the in-band error signal as opposed to transport errors.","triggerScenarios":"A received response chunk has response.Choices[0].FinishReason exactly equal to \"error\" (non-empty choices), e.g. provider-side model crash, content policy abort, or upstream failure relayed by a proxy.","commonSituations":"Provider incidents/outages; requests routed to an unhealthy model replica; LiteLLM mapping an upstream failure into a synthetic 'error' finish reason; content filter terminating generation.","solutions":["Retry the request, ideally on a different model or provider fallback","Check provider status page for ongoing incidents","Inspect proxy (LiteLLM) logs to see the original upstream error mapped to finish_reason=error","Reduce request complexity (shorter prompt) if it consistently triggers the abort","Configure model fallbacks in modelConfig so the router picks a healthy model"],"exampleFix":"// before: single model, hard failure\nres, err := call(model)\n// after: fallback model on error finish reason\nres, err := call(model)\nif err != nil && strings.Contains(err.Error(), \"stopped with error status\") {\n    res, err = call(fallbackModel)\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":"func isModelErrorFinish(err error) bool { return err != nil && strings.Contains(err.Error(), \"stopped with error status\") }","tryCatchPattern":"result, err := call(primary)\nif isModelErrorFinish(err) {\n    result, err = call(fallback)\n}","preventionTips":["Configure multi-model fallbacks in model routing","Subscribe to provider status pages and route away during incidents","Inspect proxy logs to map finish_reason=error back to root causes","Cache a known-good model choice and health-check before routing"],"tags":["streaming","llm","provider-error","finish-reason"],"backgroundTag":"model-error-finish-reason","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"}