Skip to main content

ImportOpencodeSession

Struct ImportOpencodeSession 

Source
pub struct ImportOpencodeSession<FR, SR, EP, LE, C, D> {
    pub facts: FR,
    pub sessions: SR,
    pub embedder: EP,
    pub extractor: LE,
    pub clock: C,
    pub delay: D,
    pub confidence_cfg: Arc<ConfidenceConfig>,
    pub extraction_cfg: Arc<ExtractionConfig>,
    pub enable_response_extraction: bool,
    pub min_chars: usize,
}
Expand description

Import an opencode transcript by re-running the live extraction pipeline.

Owns the same six port dependencies ExtractFactsFromResponse needs (facts, sessions, embedder, extractor, clock, delay) plus the configuration knobs the per-turn extraction relies on. The concrete TokioDelay adapter is wired by the CLI binary; unit tests inject a no-op delay so the retry backoff is instantaneous.

Fields§

§facts: FR§sessions: SR§embedder: EP§extractor: LE§clock: C§delay: D§confidence_cfg: Arc<ConfidenceConfig>§extraction_cfg: Arc<ExtractionConfig>

Semantic-dedup safety net, threaded into the per-turn ExtractFactsFromResponse bundle so the import path and the live response path share one source of truth.

§enable_response_extraction: bool§min_chars: usize

Pre-extraction content floor. Turns below this length AND without tool calls are skipped. Wired from extract_facts_from_response::MIN_INPUT_CHARS by the CLI binary so the import path and the live response path share one source of truth.

Implementations§

Source§

impl<FR, SR, EP, LE, C, D> ImportOpencodeSession<FR, SR, EP, LE, C, D>

Source

pub async fn execute( &self, turns: Vec<AssistantTurn>, memory_key: &MemoryKey, session_id: &SessionId, agent_filter: Option<&[String]>, ) -> Result<ImportStats, UseCaseError>

Import turns under (memory_key, session_id).

Reuses ExtractFactsFromResponse per turn so the extraction contract is identical to the live response pipeline. Returns aggregate stats; never raises on a per-turn extraction failure (the extractor’s retry loop already swallows transient failures per §12 fail-open).

Auto Trait Implementations§

§

impl<FR, SR, EP, LE, C, D> Freeze for ImportOpencodeSession<FR, SR, EP, LE, C, D>
where FR: Freeze, SR: Freeze, EP: Freeze, LE: Freeze, C: Freeze, D: Freeze,

§

impl<FR, SR, EP, LE, C, D> RefUnwindSafe for ImportOpencodeSession<FR, SR, EP, LE, C, D>

§

impl<FR, SR, EP, LE, C, D> Send for ImportOpencodeSession<FR, SR, EP, LE, C, D>
where FR: Send, SR: Send, EP: Send, LE: Send, C: Send, D: Send,

§

impl<FR, SR, EP, LE, C, D> Sync for ImportOpencodeSession<FR, SR, EP, LE, C, D>
where FR: Sync, SR: Sync, EP: Sync, LE: Sync, C: Sync, D: Sync,

§

impl<FR, SR, EP, LE, C, D> Unpin for ImportOpencodeSession<FR, SR, EP, LE, C, D>
where FR: Unpin, SR: Unpin, EP: Unpin, LE: Unpin, C: Unpin, D: Unpin,

§

impl<FR, SR, EP, LE, C, D> UnsafeUnpin for ImportOpencodeSession<FR, SR, EP, LE, C, D>

§

impl<FR, SR, EP, LE, C, D> UnwindSafe for ImportOpencodeSession<FR, SR, EP, LE, C, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more