mirror of
https://github.com/zed-industries/zed.git
synced 2026-08-24 16:34:46 +00:00
The inline assistant's streaming-tool path waited for the first `rewrite_section` output, but treated any other completion event as terminal. Responses API providers can emit `ReasoningDetails`, `Thinking`, and other metadata before the tool call. This stopped the stream early and marked generation as done without applying a replacement. EOF was not handled explicitly. Parse errors, provider errors, incomplete tool calls, and truncated responses could also be reported as successful completions. Continue consuming informational events until a supported tool call arrives. Track the rewrite tool call's streaming state, reject a second `rewrite_section` call instead of concatenating unrelated outputs, accept `failure_message` only after its input is complete, and reject a `rewrite_section` arriving after a failure message (and vice versa). Stop, EOF, malformed tool input, and stream errors now surface as `CodegenStatus::Error` instead of silently completing. A completed tool call followed by `Stop(MaxTokens)` or `Stop(Refusal)` is also an error: the OpenAI Responses mapper flushes truncated tool calls as complete before emitting the stop reason, so the stop reason must be checked even when the tool input parsed. Completed failure messages are stored before `Finished` is emitted, and a failure message left over from a previous generation is now cleared when a new one starts. Add regression coverage for metadata around streamed rewrites, Stop and EOF without a tool call, incomplete rewrites, interrupted responses, multiple rewrite calls, failure messages, malformed input, mixed tool calls, and stream errors before and after rewrite output begins. --- Closes #52714 Release Notes: - Fixed the inline assistant doing nothing when the model emits reasoning before its tool call. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||