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: usizePre-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>where
FR: FactRepository,
SR: SessionRepository,
EP: EmbeddingProvider,
LE: LlmExtractor,
C: Clock,
D: Delay,
impl<FR, SR, EP, LE, C, D> ImportOpencodeSession<FR, SR, EP, LE, C, D>where
FR: FactRepository,
SR: SessionRepository,
EP: EmbeddingProvider,
LE: LlmExtractor,
C: Clock,
D: Delay,
Sourcepub async fn execute(
&self,
turns: Vec<AssistantTurn>,
memory_key: &MemoryKey,
session_id: &SessionId,
agent_filter: Option<&[String]>,
) -> Result<ImportStats, UseCaseError>
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).