Keep the handoff continuation message when its turn is folded away

This commit is contained in:
Ian Gulliver
2026-10-15 11:16:50 -07:00
parent d83212d46b
commit 3fe0374ac5
7 changed files with 25 additions and 5 deletions
+7
View File
@@ -595,7 +595,11 @@ func TestCompactCarriesHandoff(t *testing.T) {
ev.AgentSessionId != nil && *ev.AgentSessionId != old.Id
})
continued := false
for _, ev := range events {
if ev.Kind == "user.message" && *ev.AgentSessionId != old.Id {
continued = ev.Payload["continuation"] == true
}
if ev.Kind == "turn.ended" && *ev.AgentSessionId == old.Id {
if ev.Payload["handoff"] != true || ev.Payload["inbox_item_id"] != nil {
t.Fatalf("handoff turn.ended %v: want handoff and no inbox summary", ev.Payload)
@@ -605,6 +609,9 @@ func TestCompactCarriesHandoff(t *testing.T) {
t.Fatalf("handoff prompt %v: want handoff flag", ev.Payload)
}
}
if !continued {
t.Fatalf("new session's first message lacks the continuation flag")
}
sessions, err := e.store.ListSessions(e.ctx, e.task.Id)
if err != nil {