mirror of
https://github.com/openai/codex.git
synced 2026-05-17 17:53:06 +00:00
Make skills trim warning test resilient
This commit is contained in:
@@ -330,10 +330,16 @@ async fn turn_start_emits_thread_scoped_warning_notification_for_trimmed_skills(
|
||||
let warning: WarningNotification =
|
||||
serde_json::from_value(params).expect("deserialize warning notification");
|
||||
assert_eq!(warning.thread_id.as_deref(), Some(thread.id.as_str()));
|
||||
assert_eq!(
|
||||
warning.message,
|
||||
"Exceeded skills context budget of 2%. All skill descriptions were removed and 7 additional skills were not included in the model-visible skills list."
|
||||
);
|
||||
let warning_prefix =
|
||||
"Exceeded skills context budget of 2%. All skill descriptions were removed and ";
|
||||
let warning_suffix = " additional skills were not included in the model-visible skills list.";
|
||||
let omitted_skill_count = warning
|
||||
.message
|
||||
.strip_prefix(warning_prefix)
|
||||
.and_then(|message| message.strip_suffix(warning_suffix))
|
||||
.expect("warning should include omitted skill count")
|
||||
.parse::<usize>()?;
|
||||
assert!(omitted_skill_count > 0);
|
||||
|
||||
timeout(
|
||||
DEFAULT_READ_TIMEOUT,
|
||||
|
||||
Reference in New Issue
Block a user