Skip to main content

wrap_with_debug_capture

Function wrap_with_debug_capture 

Source
pub fn wrap_with_debug_capture(
    inner: Arc<dyn InferenceAdapter>,
    role: impl Into<String>,
    sink: Option<&Arc<DebugCaptureSink>>,
) -> Arc<dyn InferenceAdapter> ⓘ
Expand description

Wrap inner in debug capture when sink is configured; otherwise return inner UNCHANGED.

Why: this is the single call-site helper run_task::execute_run_task and task::executor::run_and_record both call (once per role: "pm" and the engineer’s agent name) — returning inner verbatim when capture is off means the disabled path allocates no wrapper and adds no indirection, satisfying #2264’s “zero overhead and no behavior change” requirement exactly. What: Some(sink) → wraps in a new DebugCaptureLlmClient cloning sink’s Arc; None → returns inner. Test: debug_capture::tests::wrap_with_debug_capture_*.