From f04de5e9a0d12f7d610450c9c34245a5e0b9c6bf Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 2 Dec 2026 20:16:47 +0100 Subject: [PATCH] Seeded Begin tests: read a request through its serialization Co-Authored-By: Claude Sonnet 5.5 --- crates/ghostlight-dungeon/src/begin.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/crates/ghostlight-dungeon/src/begin.rs b/crates/ghostlight-dungeon/src/begin.rs index 0ef0fae..af10664 100644 --- a/crates/ghostlight-dungeon/src/begin.rs +++ b/crates/ghostlight-dungeon/src/begin.rs @@ -646,15 +646,10 @@ pub(crate) mod tests { ) } - /// Everything the model was shown in one request. + /// Everything the model was shown in one request, as the request's own + /// serialization: purpose, instructions and input. fn prompt_text(request: &ghostlight::InferenceRequest) -> String { - let mut text = request.provider.instructions.clone(); - for item in &request.provider.input { - if let model_connector::InputItem::UserText { text: more } = item { - text.push_str(more); - } - } - text + serde_json::to_string(request).unwrap() } pub(crate) async fn eventually(mut probe: impl AsyncFnMut() -> Option) -> T { @@ -722,7 +717,7 @@ pub(crate) mod tests { assert_eq!((person.target, person.qualified, person.deficit), (8, 4, 4)); let seed = rig.port.seen_requests(); assert!( - seed.iter().take(2).all(|request| request.purpose == ghostlight::InferencePurpose::Elaboration), + seed.iter().take(2).all(|request| prompt_text(request).contains("Elaboration")), "two seed sessions asked the model" ); assert!(