test(xiaoyi): verify pending tool events are accepted

This commit is contained in:
WuYongJie 2026-11-26 02:17:03 +08:00
parent 4dd63cbee3
commit 079cd8169a

View File

@ -845,8 +845,11 @@ mod tests {
fn malformed_or_foreign_tool_events_do_not_write_history_and_legacy_events_still_work() {
let (mut w, mut app, input) = activity_fixture();
let before = w.messages.clone();
let mut pending = input["event"].clone();
pending["status"] = json!("pending");
assert_eq!(tool_activity(&w, &pending).unwrap()["summary"], "待核查:读取画布");
for (field, value) in [("toolCallId", json!("private argument")), ("toolName", json!("secret")),
("status", json!("pending")), ("timestampMs", json!(-1)), ("version", json!(2))] {
("status", json!("invalid")), ("timestampMs", json!(-1)), ("version", json!(2))] {
let mut bad = input.clone();
bad["event"][field] = value;
assert!(action(&mut w, &mut app, "pi-activity", &bad).is_ok(), "invalid presentation data must not interrupt tool execution: {field}");