fix(claude-connector): fix TransportOutcome::Completed and duplicate V3Config in tests
This commit is contained in:
parent
fcad6ed3f7
commit
80a19bf818
3 changed files with 10 additions and 70 deletions
|
|
@ -835,17 +835,16 @@ mod tests {
|
|||
};
|
||||
let result = claim.call().transported(
|
||||
Vec::new(),
|
||||
model_connector::TransportOutcome::Succeeded {
|
||||
text: "ok".to_string(),
|
||||
tool_calls: Vec::new(),
|
||||
model_connector::TransportOutcome::Completed {
|
||||
provider_response_id: Some("resp-1".to_string()),
|
||||
stop_reason: model_connector::StopReason::EndTurn,
|
||||
usage: Some(model_connector::Usage {
|
||||
usage: model_connector::Usage {
|
||||
input_tokens: 1_000_000,
|
||||
cache_read_tokens: 0,
|
||||
cache_write_tokens: 0,
|
||||
output_tokens: 500_000,
|
||||
reasoning_tokens: 0,
|
||||
}),
|
||||
reasoning_tokens: None,
|
||||
},
|
||||
},
|
||||
);
|
||||
locked.complete(*claim, result, 65_536).unwrap();
|
||||
|
|
|
|||
|
|
@ -185,64 +185,6 @@ fn a_dollar_era_config_is_refused_at_load() {
|
|||
assert!(matches!(load_config(&path), Err(ConfigError::Store)));
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(type = "gamecult.model_connector.connector_config.v3")]
|
||||
struct V3Config {
|
||||
#[cultcache(key = 0)]
|
||||
listen: String,
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn v3_config_is_refused_at_load() {
|
||||
let scratch = Scratch::new();
|
||||
let v3_path = scratch.path("v3.cc");
|
||||
{
|
||||
let mut cache = CultCache::new();
|
||||
cache.register_entry_type::<V3Config>().unwrap();
|
||||
cache
|
||||
.add_generic_backing_store(SingleFileMessagePackBackingStore::new(&v3_path))
|
||||
.unwrap();
|
||||
cache
|
||||
.put(
|
||||
"runtime".to_string(),
|
||||
&V3Config {
|
||||
listen: "127.0.0.1:7443".to_string(),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
assert!(matches!(load_config(&v3_path), Err(ConfigError::Store)));
|
||||
|
||||
let v4_path = scratch.path("v4.cc");
|
||||
let mut config = valid();
|
||||
config.models[0].price = Some(PriceRow {
|
||||
base: TokenRates {
|
||||
input: 270_000,
|
||||
cache_read: 27_000,
|
||||
cache_write: 0,
|
||||
output: 1_100_000,
|
||||
},
|
||||
bands: vec![PriceBand {
|
||||
weekdays: vec![
|
||||
Weekday::Mon,
|
||||
Weekday::Tue,
|
||||
Weekday::Wed,
|
||||
Weekday::Thu,
|
||||
Weekday::Fri,
|
||||
],
|
||||
utc_hours: vec![1, 2, 3, 6, 7, 8, 9],
|
||||
rates: TokenRates {
|
||||
input: 540_000,
|
||||
cache_read: 54_000,
|
||||
cache_write: 0,
|
||||
output: 2_200_000,
|
||||
},
|
||||
}],
|
||||
});
|
||||
write_config(&v4_path, &config).unwrap();
|
||||
assert_eq!(load_config(&v4_path).unwrap(), config);
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(type = "gamecult.model_connector.claude_connector_config.v2")]
|
||||
struct V2Config {
|
||||
|
|
|
|||
|
|
@ -749,17 +749,16 @@ fn a_readout_returns_live_communal_spend_rows_across_callers() {
|
|||
};
|
||||
let result = claim.call().transported(
|
||||
Vec::new(),
|
||||
TransportOutcome::Succeeded {
|
||||
text: "ok".to_string(),
|
||||
tool_calls: Vec::new(),
|
||||
TransportOutcome::Completed {
|
||||
provider_response_id: Some("resp-communal".to_string()),
|
||||
stop_reason: StopReason::EndTurn,
|
||||
usage: Some(Usage {
|
||||
usage: Usage {
|
||||
input_tokens: 1_000_000,
|
||||
cache_read_tokens: 0,
|
||||
cache_write_tokens: 0,
|
||||
output_tokens: 200_000,
|
||||
reasoning_tokens: 0,
|
||||
}),
|
||||
reasoning_tokens: None,
|
||||
},
|
||||
},
|
||||
);
|
||||
service.complete(*claim, result, 65_536).unwrap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue