Skip to main content

Crate kcode_k1_chat_thread_session_actor

Crate kcode_k1_chat_thread_session_actor 

Source
Expand description

§K1 chat-thread session actor

§Public contract

  • open(adapter, key, session, kmap, web_search) recovers one durable thread, spawns its serialized actor, and returns its established command handle. web_search is the configured kcode-k1-codex-websearch::Runner.
  • The public inner Ktool is the strict object WebSearch { query: string, model: string, reasoning_effort?: string }. Unknown fields, aliases, nulls, and nonstrings fail locally. The model must start with exact case-sensitive codex/; the prefix is stripped once. Omitted effort becomes medium; supplied strings pass unchanged.
  • Each accepted WebSearch Tool Call records its absolute 60-minute deadline before launch, runs once in the background, emits no progress messages, and later records exactly one correlated terminal Tool Result while this actor remains alive. Concurrent calls retain their original ToolCallId. Actor teardown or inference failure cancels all outstanding calls.
  • Handle retains the actor-channel contract. snapshot() retains its live snapshot, while snapshot_with_events() returns that snapshot with cloned durable events in recorded order.

The actor owns FIFO commands, Codex turn effects, managed runtime model-usage lifecycle, stage acknowledgements, restart generations, WebSearch task correlation, and teardown. Durable state owns canonical conversation transitions and persistence. This package owns no persistence format, provider prompt, HTTP, migration, daemon composition, deployment, or progress-event surface.

Functions§

open