mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
Merge 99ef3ed879 into sapling-pr-archive-bolinfest
This commit is contained in:
@@ -325,10 +325,20 @@ 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,
|
||||
"Warning: 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 prefix = "Exceeded skills context budget of 2%. All skill descriptions were removed and ";
|
||||
let plural_suffix = " additional skills were not included in the model-visible skills list.";
|
||||
let singular_suffix = " additional skill was not included in the model-visible skills list.";
|
||||
let omitted_count = warning
|
||||
.message
|
||||
.strip_prefix(prefix)
|
||||
.and_then(|message| {
|
||||
message
|
||||
.strip_suffix(plural_suffix)
|
||||
.or_else(|| message.strip_suffix(singular_suffix))
|
||||
})
|
||||
.and_then(|count| count.parse::<usize>().ok())
|
||||
.expect("warning should report an omitted skill count");
|
||||
assert!(omitted_count >= 1, "expected at least one omitted skill");
|
||||
|
||||
timeout(
|
||||
DEFAULT_READ_TIMEOUT,
|
||||
|
||||
Reference in New Issue
Block a user