mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
## What changed Add the disabled-by-default `omit_skill_descriptions` feature flag to omit descriptions from model-visible host, executor, and cloud skill catalogs while retaining names and locators. Adapt catalog introductions, usage instructions, and alias budget accounting to the selected policy. Persist the description policy in catalog snapshots and refresh usage instructions when it changes. Ignore description-only edits in catalog deltas while descriptions are omitted. ## Testing Add coverage for alias token budgets, policy changes with older snapshots, and suppressed description-only updates. Extend scenario snapshots to cover plugin visibility and catalog deduplication with descriptions omitted. GitOrigin-RevId: 5bf1dcee8c04059c7a78998affc1efcdef8ec883
72 lines
2.0 KiB
Rust
72 lines
2.0 KiB
Rust
use std::sync::Mutex;
|
|
|
|
use codex_extension_api::ExtensionMetrics;
|
|
use codex_otel::THREAD_SKILLS_DESCRIPTION_TRUNCATED_CHARS_METRIC;
|
|
use codex_otel::THREAD_SKILLS_ENABLED_TOTAL_METRIC;
|
|
use codex_otel::THREAD_SKILLS_KEPT_TOTAL_METRIC;
|
|
use codex_otel::THREAD_SKILLS_TRUNCATED_METRIC;
|
|
use pretty_assertions::assert_eq;
|
|
|
|
use super::*;
|
|
|
|
#[derive(Default)]
|
|
struct RecordingMetrics {
|
|
samples: Mutex<Vec<(String, i64)>>,
|
|
}
|
|
|
|
impl ExtensionMetrics for RecordingMetrics {
|
|
fn histogram_with_boundaries(
|
|
&self,
|
|
name: &str,
|
|
value: i64,
|
|
_boundaries: &[f64],
|
|
tags: &[(&str, &str)],
|
|
) {
|
|
self.histogram(name, value, tags);
|
|
}
|
|
|
|
fn counter(&self, name: &str, _inc: i64, _tags: &[(&str, &str)]) {
|
|
panic!("unexpected counter: {name}");
|
|
}
|
|
|
|
fn histogram(&self, name: &str, value: i64, _tags: &[(&str, &str)]) {
|
|
self.samples
|
|
.lock()
|
|
.unwrap_or_else(std::sync::PoisonError::into_inner)
|
|
.push((name.to_string(), value));
|
|
}
|
|
}
|
|
|
|
#[test]
|
|
fn empty_catalog_records_zero_metrics_without_a_fragment() {
|
|
let metrics = RecordingMetrics::default();
|
|
|
|
let rendered = render_catalog(
|
|
Some(&metrics),
|
|
CatalogSurface::ThreadContext,
|
|
&SkillCatalog::default(),
|
|
/*include_skills_usage_instructions*/ false,
|
|
SkillCatalogRenderPolicy::EXTENSION_COMPATIBLE,
|
|
SkillMetadataBudget::Characters(8_000),
|
|
);
|
|
|
|
assert!(rendered.fragment.is_none());
|
|
assert_eq!(rendered.warning_message, None);
|
|
|
|
assert_eq!(
|
|
*metrics
|
|
.samples
|
|
.lock()
|
|
.unwrap_or_else(std::sync::PoisonError::into_inner),
|
|
vec![
|
|
(THREAD_SKILLS_ENABLED_TOTAL_METRIC.to_string(), 0),
|
|
(THREAD_SKILLS_KEPT_TOTAL_METRIC.to_string(), 0),
|
|
(THREAD_SKILLS_TRUNCATED_METRIC.to_string(), 0),
|
|
(
|
|
THREAD_SKILLS_DESCRIPTION_TRUNCATED_CHARS_METRIC.to_string(),
|
|
0,
|
|
),
|
|
]
|
|
);
|
|
}
|