test(model-connector): avoid regen race in wire_golden_v5
This commit is contained in:
parent
38699f3d3b
commit
5f6efd3126
1 changed files with 11 additions and 8 deletions
|
|
@ -114,6 +114,15 @@ fn completed() -> TransportOutcome {
|
|||
}
|
||||
}
|
||||
|
||||
fn input_reasoning_state() -> InputItem {
|
||||
let reasoning = (0x80..=0xff_u8).collect::<Vec<u8>>();
|
||||
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::<Vec<u8>>();
|
||||
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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue