pub struct TurnDriverConfig {Show 17 fields
pub url: String,
pub model: String,
pub kind: BackendKind,
pub api_key: Option<String>,
pub workspace: String,
pub caveats: Caveats,
pub max_tool_rounds: usize,
pub workflow_grace_rounds: usize,
pub tool_output_lines: usize,
pub num_ctx: Option<u32>,
pub connect_timeout_secs: u64,
pub inference_timeout_secs: u64,
pub mid_loop_trim_threshold: usize,
pub mid_loop_trim_tokens: Option<usize>,
pub max_ok_input: Option<u32>,
pub build_check_cmd: Option<String>,
pub safe_context: Option<u32>,
}Expand description
Owned, 'static configuration for one TurnDriver — the cloneable
counterpart of the borrow-heavy ChatCtx. The driver clones it into each
spawned turn task so nothing borrows across the async boundary.
The fields mirror the inference-relevant subset of ChatCtx; the
session-bound &mut handles (note sink, recall, permission gate, summarizer,
compress state) are intentionally absent — a driven cowork turn is headless.
Fields§
§url: StringInference endpoint base URL.
model: StringModel name.
kind: BackendKindWire protocol of the backend.
api_key: Option<String>Bearer token for authenticated OpenAI-compatible endpoints.
workspace: StringAbsolute workspace path the tool loop runs against.
caveats: CaveatsPermission caveats enforced for this turn’s tool calls.
max_tool_rounds: usizeMaximum tool-call rounds before a forced final completion.
workflow_grace_rounds: usizeAdditional progress-aware rounds after max_tool_rounds; 0 makes the
normal cap hard.
tool_output_lines: usizeMax lines of tool output shown inline.
num_ctx: Option<u32>Ollama options.num_ctx (ignored on the OpenAI path).
connect_timeout_secs: u64TCP connect timeout.
inference_timeout_secs: u64Total inference timeout.
mid_loop_trim_threshold: usizeMessage count at which the in-flight conversation is trimmed mid-turn.
mid_loop_trim_tokens: Option<usize>Token threshold that also triggers a mid-loop trim. None disables it.
max_ok_input: Option<u32>Highest input-token count the model has accepted (pre-send budget gate).
build_check_cmd: Option<String>Shell command run after every successful write for ground-truth feedback.
safe_context: Option<u32>Empirically safe context size used to detect likely overflow.
Implementations§
Source§impl TurnDriverConfig
impl TurnDriverConfig
Sourcepub fn new(
url: impl Into<String>,
model: impl Into<String>,
kind: BackendKind,
workspace: impl Into<String>,
) -> Self
pub fn new( url: impl Into<String>, model: impl Into<String>, kind: BackendKind, workspace: impl Into<String>, ) -> Self
Construct a config with sensible cowork defaults; only the endpoint, the
model, the backend kind, and the workspace are required. Caveats default
to Caveats::top — the downstream
consumer is expected to narrow them.
Trait Implementations§
Source§impl Clone for TurnDriverConfig
impl Clone for TurnDriverConfig
Source§fn clone(&self) -> TurnDriverConfig
fn clone(&self) -> TurnDriverConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TurnDriverConfig
impl RefUnwindSafe for TurnDriverConfig
impl Send for TurnDriverConfig
impl Sync for TurnDriverConfig
impl Unpin for TurnDriverConfig
impl UnsafeUnpin for TurnDriverConfig
impl UnwindSafe for TurnDriverConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more