fix(stream): close thinking block before text or tool output
If upstream omits reasoning-end and starts emitting text-delta or tool-call events, the thinking block remained open causing thinking_start -> thinking_delta -> text_start -> ... -> thinking_end ordering. Now endThinking() is called at the start of text-delta and tool-call handlers so thinking_end always precedes text_start or toolcall_start. Adds 2 regression tests for the missing reasoning-end edge case.
P
Patrick Wozniak committed
3fba807abf68adb507fcd0aedfc843ebf16041e5
Parent: 52ed72a