Preserve mentions in cloud conversation transcripts (#63237)

## Why

The cloud client treated user messages containing mentions as opaque,
which prevented those messages from reaching callers as structured
transcript items.

## What changed

Decode mention names and paths in cloud history and live events, and
carry them through to the app-server protocol as `UserInput::Mention`.
Malformed or incomplete mentions still leave the containing item opaque.
Cloud turn submissions reject mention inputs.

## Testing

Extend tests to cover plugin mentions alongside text and images,
app mentions in app-server receipts, and malformed or incomplete
mention payloads.

GitOrigin-RevId: 938cd37a81630ffe4d06f00544972dd9239c0cb3
This commit is contained in:
Benjamin Carlsson
2026-11-23 02:13:58 +00:00
committed by copyberry
parent c9325ea78c
commit f1fd6c4c35
6 changed files with 55 additions and 3 deletions
@@ -137,6 +137,9 @@ pub(super) fn item_summary(item: cloud::ItemSummary) -> Option<protocol::ThreadI
}),
}
}
cloud::UserMessageInput::Mention { name, path } => {
protocol::UserInput::Mention { name, path }
}
})
.collect(),
},
@@ -4,7 +4,7 @@ use super::*;
use pretty_assertions::assert_eq;
#[test]
fn image_receipt_preserves_submission_identity_and_attachment() {
fn receipt_preserves_submission_identity_image_and_app_mention() {
let label = "[Image #1]";
let actual = item_summary(cloud::ItemSummary::UserMessage {
id: "item-1".into(),
@@ -22,6 +22,10 @@ fn image_receipt_preserves_submission_identity_and_attachment() {
placeholder: Some(label.into()),
}],
},
cloud::UserMessageInput::Mention {
name: "Example App".into(),
path: "app://connector_example".into(),
},
],
});
assert_eq!(
@@ -47,6 +51,10 @@ fn image_receipt_preserves_submission_identity_and_attachment() {
Some(label.into()),
)],
},
protocol::UserInput::Mention {
name: "Example App".into(),
path: "app://connector_example".into(),
},
],
},
))