fix: skip a late tool event that has no name

A terminal tool event can arrive without its starting one; adding a
blank row for it is worse than waiting for the next page read.

Bump version to 0.1.12 (build 13).
This commit is contained in:
blumia committed 2026-11-16 20:11:14 +08:00
1 parent e67490e768
commit 4c6fcf4cbe
2 files changed
+8 -2

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "OpenChamber", "name": "OpenChamber",
"id": "com.openchamber.native", "id": "com.openchamber.native",
"version": "0.1.11", "version": "0.1.12",
"build": 12, "build": 13,
"orientations": ["portrait", "landscape"] "orientations": ["portrait", "landscape"]
} }
+6
View File
@@ -554,6 +554,12 @@ func (ch *chat) applyToolEvent(ev ocapi.Event) {
} }
} }
if idx < 0 { if idx < 0 {
// A terminal event can arrive without the starting one (a
// stream joined late). Without a name the row would be
// blank; the next page read adds the call properly.
if d.Name == "" {
return
}
m.Content = append(m.Content, ocapi.ContentPart{ m.Content = append(m.Content, ocapi.ContentPart{
Type: "tool", ID: d.ID, Name: d.Name, Type: "tool", ID: d.ID, Name: d.Name,
State: &ocapi.ToolState{Status: "running"}, State: &ocapi.ToolState{Status: "running"},