applyError unwinds the turn on a stream error: preserve content streamed before the error (so the user keeps failure context), emit the one-line hint, drop the pending queue, reset turn state.
(e llm.Event)
| 831 | m.phase = phaseStreaming |
| 832 | } |
| 833 | m.streamingEstimate += len(e.Content) / 4 |
| 834 | case llm.EventToolCall: |
| 835 | m.applyToolCall(e) |
| 836 | case llm.EventDone: |
| 837 | m.applyDone(e) |
| 838 | case llm.EventError: |
| 839 | return m, m.applyError(e) |
| 840 | } |
| 841 | return m, readEvent(m.stream) |
| 842 | } |
| 843 | |
| 844 | // applyContent writes one streamed text chunk to the live buffer and promotes |
| 845 | // phase from thinking to streaming on the first chunk so the status bar shows |
| 846 | // tokens flowing. View() renders the buffer live above the prompt; once the |
no test coverage detected