Add async delivery metadata to agent messages (#39312)

## What changed

- Add an optional `delivery` field to agent message events and app-server
  `agentMessage` items, with `"async"` identifying a user-visible message sent
  without ending the current turn.
- Preserve the marker through legacy event conversion, thread history
  materialization, replay, and generated JSON and TypeScript schemas.
- Require delivery of async agent message completion notifications on the
  in-process app-server transport.

## Testing

- Cover preservation of async delivery metadata in thread history.
- Cover delivery-required classification for async agent messages.

GitOrigin-RevId: f92ba25de1293ee271404badfdf0d117d6530329
This commit is contained in:
rka-oai authored and copyberry committed 2026-08-18 23:05:52 +00:00
1 parent 7d9990fa30
commit fb356f3d2c
64 files changed
+467 -21

No files matched your search

@@ -135,6 +135,7 @@ pub(super) fn rollout_items_from_messages(messages: Vec<ConversationMessage>) ->
message: message.text.clone(),
phase: None,
memory_citation: None,
delivery: None,
},
)));
items.push(RolloutItem::ResponseItem(response_item(message).into()));
@@ -156,6 +157,7 @@ fn external_session_imported_marker_item() -> RolloutItem {
message: EXTERNAL_SESSION_IMPORTED_MARKER.to_string(),
phase: None,
memory_citation: None,
delivery: None,
}))
}
@@ -251,6 +253,7 @@ mod tests {
text: EXTERNAL_SESSION_IMPORTED_MARKER.into(),
phase: None,
memory_citation: None,
delivery: None,
}
);
}
@@ -283,6 +286,7 @@ mod tests {
text: EXTERNAL_SESSION_IMPORTED_MARKER.into(),
phase: None,
memory_citation: None,
delivery: None,
})
);
let last_turn_complete = imported