{"record":{"id":"f9b525cfaccd65dc","repo":"zed-industries/zed","slug":"inline-assistant-response-was-interrupted-reason","errorCode":null,"errorMessage":"Inline assistant response was interrupted ({reason:?})","messagePattern":"Inline assistant response was interrupted \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/buffer_codegen.rs","lineNumber":1323,"sourceCode":"                                        return;\n                                    }\n                                }\n                            }\n                        }\n                    }\n                    Ok(LanguageModelCompletionEvent::UsageUpdate(token_usage)) => {\n                        *last_token_usage.lock() = token_usage;\n                    }\n                    Ok(LanguageModelCompletionEvent::Stop(reason)) => {\n                        if !failure_complete {\n                            finish_with_status(\n                                CodegenStatus::Error(anyhow!(\n                                    \"Inline assistant stopped before completing \\\n                                     `{REWRITE_SECTION_TOOL_NAME}` or \\\n                                     `{FAILURE_MESSAGE_TOOL_NAME}` ({reason:?})\"\n                                )),\n                                cx,\n                            );\n                        } else if matches!(reason, StopReason::MaxTokens | StopReason::Refusal) {\n                            finish_with_status(\n                                CodegenStatus::Error(anyhow!(\n                                    \"Inline assistant response was interrupted ({reason:?})\"\n                                )),\n                                cx,\n                            );\n                        } else {\n                            finish_with_status(CodegenStatus::Done, cx);\n                        }\n                        return;\n                    }\n                    Ok(LanguageModelCompletionEvent::ToolUseJsonParseError {\n                        tool_name,\n                        json_parse_error,\n                        ..\n                    }) => {\n                        finish_with_status(","sourceCodeStart":1305,"sourceCodeEnd":1341,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/agent_ui/src/buffer_codegen.rs#L1305-L1341","documentation":"Emitted when the inline assistant's completion stream stops with StopReason::MaxTokens or StopReason::Refusal before the edit completes. The response was terminated by the provider for length or policy reasons rather than finishing normally; the offending condition is the interruption stop reason on the model stream, not the tool input itself.","triggerScenarios":"Thrown at crates/agent_ui/src/buffer_codegen.rs:1321 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the assist, or reduce the selection size to fit the output limit","For refusal stops, rephrase the request to avoid policy-triggering content","Switch to a model with a larger context/output budget"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}