Merge 99ef3ed879 into sapling-pr-archive-bolinfest

This commit is contained in:
Michael Bolin
2026-04-29 10:03:45 -07:00
committed by GitHub
51 changed files with 1933 additions and 1259 deletions
@@ -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,