pub struct ServerConfig {
pub bind: String,
pub port: u16,
pub gateway_url: String,
pub gateway_key: Option<String>,
pub model: String,
pub seed_kb: bool,
pub max_iterations: u32,
pub max_tokens: u32,
pub storage: StorageBackend,
pub widget_auth_strict: bool,
pub confirm_tools: Vec<String>,
pub judge_model: String,
}Expand description
Fully-resolved server configuration.
Fields§
§bind: StringIP address to bind (127.0.0.1 for local dev, 0.0.0.0 in containers).
port: u16Port to bind.
gateway_url: StringLLM gateway base URL.
gateway_key: Option<String>Optional gateway API key. None means LLM turns are unavailable and
send_message returns a clean error.
model: StringModel id.
seed_kb: boolWhether to seed the knowledge base with demo docs on startup.
max_iterations: u32Agent-loop iteration cap per turn.
max_tokens: u32max_tokens per LLM call.
storage: StorageBackendStorage backend (drives both the storage adapter and the matching durable
admin stores). Defaults to StorageBackend::Memory.
widget_auth_strict: boolFail-closed embeddable-widget auth: when true, a session for an agent
the WidgetAuthProvider
has no policy for is rejected (unknown/unregistered agents can’t be
embedded). When false (default), an absent policy is allowed — so the
permissive default provider leaves /ws open. Set WIDGET_AUTH_STRICT=1
in front of a real provider. Origin + authContext are always enforced
for agents that do have a policy, regardless of this flag.
confirm_tools: Vec<String>Write-confirmation HITL: tool-name substrings that require human
approval before the agent may run them. When non-empty, a turn that calls
a matching tool parks and emits a confirm_tool_action_required event;
the client resumes it with confirm_tool_action. Read from
SMOOTH_AGENT_CONFIRM_TOOLS (comma-separated). Empty (the default) means
no tool ever requires confirmation — no turn parks, byte-for-byte
unchanged from before HITL. Matched by core’s ConfirmationHook (contains).
judge_model: StringCheap fast-tier model for the post-turn conversation-workflow judge
(SMOODEV-590). Independent of model so the judge stays
cheap even when a turn runs on a bigger model. Read from
SMOOTH_AGENT_JUDGE_MODEL; defaults to DEFAULT_MODEL (haiku-tier).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Read configuration from the environment, applying documented defaults.
Sourcepub fn confirmation_tool_patterns(&self) -> Option<Vec<String>>
pub fn confirmation_tool_patterns(&self) -> Option<Vec<String>>
The configured write-confirmation tool patterns, or None when none are
configured (so the runner installs no ConfirmationHook and the turn
behaves exactly as before HITL). Some only when at least one non-empty
pattern is set.
Sourcepub fn has_llm(&self) -> bool
pub fn has_llm(&self) -> bool
true when a gateway key is present, so LLM turns can actually run.
Sourcepub fn llm_config(&self) -> Option<LlmConfig>
pub fn llm_config(&self) -> Option<LlmConfig>
Build the smooth-operator LlmConfig for live turns using the server’s
configured (env) gateway key.
Returns None when no gateway key is configured (callers should emit a
clean protocol error rather than attempting a turn).
In a multi-tenant flavor the per-turn key comes from a
GatewayKeyResolver
instead; use llm_config_with_key once the
per-org key is resolved.
Sourcepub fn llm_config_with_key(&self, key: String) -> LlmConfig
pub fn llm_config_with_key(&self, key: String) -> LlmConfig
Build the smooth-operator LlmConfig for live turns with an explicit
gateway key (gateway URL, model, and limits still come from this config).
This is the per-org seam’s entry point: a
GatewayKeyResolver
resolves the key for the turn’s org (falling back to the env key), and the
resolved key is threaded through here. With the default env resolver this
produces exactly the same config as llm_config.
Sourcepub fn placeholder_llm_config(&self) -> LlmConfig
pub fn placeholder_llm_config(&self) -> LlmConfig
Build an LlmConfig without requiring a gateway key, for the
test-only path where a MockLlmClient
is injected (the scenario-parity corpus). The mock replaces the client
built from this config, so its url/key/model are never used to make a
network call — this just satisfies the engine’s LlmConfig argument so a
keyless deterministic turn can run. Not reachable on the production path
(only consulted when chat_provider is Some).
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
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 ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request