From 5f6efd3126ef9883bc065cf0c7d498c6b7c0c3a6 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 6 Dec 2026 04:04:15 +0100 Subject: [PATCH] test(model-connector): avoid regen race in wire_golden_v5 --- .../model-connector/tests/wire_golden_v5.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/crates/model-connector/tests/wire_golden_v5.rs b/crates/model-connector/tests/wire_golden_v5.rs index c25c5b2..4afd54a 100644 --- a/crates/model-connector/tests/wire_golden_v5.rs +++ b/crates/model-connector/tests/wire_golden_v5.rs @@ -114,6 +114,15 @@ fn completed() -> TransportOutcome { } } +fn input_reasoning_state() -> InputItem { + let reasoning = (0x80..=0xff_u8).collect::>(); + InputItem::ReasoningState { + provider: "anthropic-messages".to_string(), + model: "claude-opus-4-5".to_string(), + state: reasoning, + } +} + #[test] fn wire_golden_v5() { let invocation = invocation(); @@ -123,14 +132,7 @@ fn wire_golden_v5() { // The reasoning bytes are all >= 0x80 so a byte-array encoding cannot pass // for MessagePack bin. let reasoning = || (0x80..=0xff_u8).collect::>(); - assert_wire( - "input_reasoning_state.mp", - &InputItem::ReasoningState { - provider: "anthropic-messages".to_string(), - model: "claude-opus-4-5".to_string(), - state: reasoning(), - }, - ); + assert_wire("input_reasoning_state.mp", &input_reasoning_state()); let transported = TransportResult { schema_id: RESULT_SCHEMA_ID.to_string(), @@ -263,6 +265,7 @@ fn the_golden_carriage_frame_decrypts_and_validates_under_the_fixed_key() { /// as an array of integers. #[test] fn reasoning_state_is_messagepack_bin() { + assert_wire("input_reasoning_state.mp", &input_reasoning_state()); let golden = std::fs::read(fixtures().join("input_reasoning_state.mp")).unwrap(); let marker = golden.windows(3).any(|window| window == [0xc4, 0x80, 0x80]); assert!(marker, "state must be a bin 8 of 128 bytes starting 0x80");