Commit bac195c
committed
fix: don't trigger content-type transition on finish-only stream events
_current_content_type now returns None for events with no message content
(e.g. {"finishReason": "COMPLETE"}). The transition branch in
_transform_v2_event is skipped when event_content_type is None, so a
finish-only event after a thinking block no longer opens a spurious empty
text block before emitting content-end.1 parent b644eb3 commit bac195c
2 files changed
Lines changed: 33 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
956 | | - | |
| 956 | + | |
957 | 957 | | |
958 | 958 | | |
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
962 | | - | |
963 | | - | |
964 | | - | |
| 962 | + | |
| 963 | + | |
965 | 964 | | |
966 | 965 | | |
967 | 966 | | |
968 | 967 | | |
969 | 968 | | |
970 | 969 | | |
| 970 | + | |
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
| |||
981 | 981 | | |
982 | 982 | | |
983 | 983 | | |
984 | | - | |
| 984 | + | |
985 | 985 | | |
986 | 986 | | |
987 | 987 | | |
988 | | - | |
989 | | - | |
| 988 | + | |
| 989 | + | |
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
957 | 983 | | |
958 | 984 | | |
959 | 985 | | |
| |||
0 commit comments