mirror of
https://github.com/openai/codex.git
synced 2026-11-02 19:43:24 +00:00
## What changed - Pass metrics bound to the active turn's model to approval-review contributors. - Add counter support to `ExtensionMetrics` while preserving host session attribution. - Record Guardian v2 tool-call score lag and count stale-score fallbacks with the `score_lag` reason. ## Testing - Cover counter forwarding and session metadata tags. - Verify Guardian v2 metric samples for current and stale scores. GitOrigin-RevId: 0ec34736d29d2e37ed217a27e773b4f6230ae38a
12 lines
539 B
Rust
12 lines
539 B
Rust
/// Host-provided metrics capability for extension-owned behavior.
|
|
///
|
|
/// Implementations are expected to attach the host's session attribution before
|
|
/// forwarding samples to the configured metrics backend.
|
|
pub trait ExtensionMetrics: Send + Sync {
|
|
/// Increments a counter with optional extension-provided tags.
|
|
fn counter(&self, name: &str, inc: i64, tags: &[(&str, &str)]);
|
|
|
|
/// Records one histogram sample with optional extension-provided tags.
|
|
fn histogram(&self, name: &str, value: i64, tags: &[(&str, &str)]);
|
|
}
|