pub struct Config {Show 104 fields
pub model_http_policy: Option<Arc<dyn ModelHttpPolicy>>,
pub account_profile: Option<String>,
pub plugin_oauth_read_only: bool,
pub account_model_access: Arc<RwLock<Option<AccountModelAccess>>>,
pub session_provider_keys_only: bool,
pub session_provider_keys: Arc<RwLock<HashMap<ProviderIdentity, (String, Credential)>>>,
pub required_account_model_owner: Option<String>,
pub extra_trusted_paths: Vec<PathBuf>,
pub custom_models: Option<Vec<ConfiguredModel>>,
pub stop_words: Option<Vec<String>>,
pub provider: Option<String>,
pub http_headers: Option<HashMap<String, String>>,
pub title: Option<String>,
pub default_text_model: Option<String>,
pub legacy_model: Option<String>,
pub auth_mode: Option<String>,
pub reasoning_effort: Option<String>,
pub reasoning_effort_inferred_from_legacy_alias: bool,
pub fleet_operator_route_applied: bool,
pub fleet_operator_reasoning_applied: bool,
pub migrated_deepseek_model_alias: Option<String>,
pub runtime_chat_isolated: bool,
pub runtime_thread_inference_unrelated: bool,
pub tools: Option<ToolsConfig>,
pub skills_dir: Option<String>,
pub mcp_config_path: Option<String>,
pub mcp_oauth_callback_port: Option<u16>,
pub mcp_oauth_callback_url: Option<String>,
pub notes_path: Option<String>,
pub memory_path: Option<String>,
pub strict_tool_mode: Option<bool>,
pub instructions: Option<Vec<String>>,
pub allow_shell: Option<bool>,
pub prompt_suggestion: Option<bool>,
pub approval_policy: Option<String>,
pub sandbox_mode: Option<String>,
pub sandbox_network_access: Option<bool>,
pub project_instruction_imports: Vec<String>,
pub instruction_budget: Option<InstructionBudgetConfig>,
pub telemetry: Option<bool>,
pub fallback_providers: Vec<ProviderKind>,
pub yolo: Option<bool>,
pub verbosity: Option<String>,
pub sandbox_backend: Option<String>,
pub sandbox_url: Option<String>,
pub sandbox_api_key: Option<String>,
pub prefer_bwrap: Option<bool>,
pub tool_launcher: Option<Vec<String>>,
pub bwrap_ro_roots: Vec<PathBuf>,
pub bwrap_dev_roots: Vec<PathBuf>,
pub sandbox_denied_read_paths: Vec<PathBuf>,
pub sandbox_read_denylist_defaults: Option<bool>,
pub sandbox_read_denylist_exempt: Vec<PathBuf>,
pub managed_config_path: Option<String>,
pub requirements_path: Option<String>,
pub max_subagents: Option<usize>,
pub retry: Option<RetryConfig>,
pub stream: Option<StreamConfig>,
pub features: Option<FeaturesToml>,
pub extension_host: Option<ExtensionHostConfig>,
pub plugins: Option<BTreeMap<String, PluginSettings>>,
pub auto_review: Option<AutoReviewConfig>,
pub tui: Option<TuiConfig>,
pub transcript: Option<TranscriptConfig>,
pub hooks: Option<HooksConfig>,
pub lifecycle_outbox: Option<LifecycleOutboxToml>,
pub control_socket: Option<ControlSocketToml>,
pub providers: Option<ProvidersConfig>,
pub notifications: Option<NotificationsConfig>,
pub approval: Option<ApprovalConfig>,
pub network: Option<NetworkPolicyToml>,
pub verifier: Option<VerifierConfigToml>,
pub advisor: Option<AdvisorConfigToml>,
pub skills: Option<SkillsConfig>,
pub snapshots: Option<SnapshotsConfig>,
pub search: Option<SearchConfig>,
pub goal: Option<GoalConfig>,
pub reasoning_only: Option<ReasoningOnlyConfig>,
pub memory: Option<MemoryConfig>,
pub speech: Option<SpeechConfig>,
pub auto: Option<AutoConfig>,
pub hotbar: Option<Vec<HotbarBindingToml>>,
pub update: Option<UpdateConfig>,
pub cloud_facts: Option<CloudFactsConfig>,
pub lsp: Option<LspConfigToml>,
pub context: ContextConfig,
pub compaction: Option<CompactionSettings>,
pub fleet: Option<FleetConfigToml>,
pub workflow: Option<WorkflowConfigToml>,
pub subagents: Option<SubagentsConfig>,
pub runtime_api: Option<RuntimeApiConfig>,
pub workshop: Option<WorkshopConfig>,
pub vision_model: Option<VisionModelConfig>,
pub redaction: Option<RedactionToml>,
pub loaded_config_path: Option<PathBuf>,
pub network_layer_is_managed: bool,
pub remembered_selection_scope: Option<bool>,
pub environment_model_applied: bool,
pub route_provenance: RouteProvenance,
pub route_preferences_version: Option<u32>,
pub exec_policy_engine: ExecPolicyEngine,
pub base_url_env_receipt: BaseUrlEnvReceipt,
pub legacy_root: LegacyRootMigration,
pub mini_window: Option<MiniWindowConfig>,
/* private fields */
}Expand description
Resolved CLI configuration, including defaults and environment overrides.
Fields§
§model_http_policy: Option<Arc<dyn ModelHttpPolicy>>§account_profile: Option<String>§plugin_oauth_read_only: boolDiagnostic clones must never refresh or mutate plugin OAuth credentials.
account_model_access: Arc<RwLock<Option<AccountModelAccess>>>Never deserialized from disk or exposed as provider configuration.
session_provider_keys_only: bool§session_provider_keys: Arc<RwLock<HashMap<ProviderIdentity, (String, Credential)>>>§required_account_model_owner: Option<String>§extra_trusted_paths: Vec<PathBuf>Runtime-only extra roots the tool layer may read and write outside the
workspace, set by codewhale exec --add-dir.
custom_models: Option<Vec<ConfiguredModel>>Persisted exact-route declarations, separate from provider credentials.
stop_words: Option<Vec<String>>Single-token inputs that cancel the active turn before dispatch.
provider: Option<String>§http_headers: Option<HashMap<String, String>>Optional extra HTTP headers sent to model API requests.
title: Option<String>Optional user-facing tab/window title shown as [title] … in front of
the terminal window title (the Codewhale / reasoning… / done.
states). This is the default for every session in this config scope;
the /title command overrides it per session, and /config title … --save persists a new default here. Multi-window setups can point each
workspace at its own --config file (or profile) so alt-tabbed
sessions are identifiable at a glance.
default_text_model: Option<String>§legacy_model: Option<String>Read-only compatibility for the dispatcher’s historical root model.
New durable choices are written to the provider model slot.
auth_mode: Option<String>§reasoning_effort: Option<String>DeepSeek reasoning-effort tier: "auto" | "off" | "low" | "medium" | "high" | "max".
Defaults to "auto" at runtime if unset.
reasoning_effort_inferred_from_legacy_alias: boolTrue only when compatibility migration inferred reasoning_effort
from a retiring DeepSeek alias. This distinguishes that inferred value
from a user override during an in-session provider switch.
fleet_operator_route_applied: boolRuntime-only receipt that a fresh launch adopted the selected Fleet’s
operator provider/model pair. App initialization uses it to prevent
generic remembered /model preferences from replacing that selected
Fleet route later in the same launch.
fleet_operator_reasoning_applied: boolRuntime-only receipt that the selected Fleet also supplied a reasoning tier. Kept separate because an operator with no tier deliberately inherits the ordinary session/settings reasoning preference.
migrated_deepseek_model_alias: Option<String>Original first-party DeepSeek alias captured before model normalization. This runtime-only receipt lets diagnostics explain why the resolved model changed without persisting compatibility state back to config.
runtime_chat_isolated: boolRuntime-only isolation boundary for account-owned managed Chat.
This is never user-configurable or serialized. The Runtime Chat relay sets it on its private config clone so the Engine suppresses all host workspace metadata and constructs no model-visible MCP, sub-agent, or native tool surface for those turns.
Runtime-only marker for an independent RuntimeThreadManager store.
Those threads are not projected into the interactive TUI’s attached CWC run, so their provider requests do not participate in that run’s exclusive Chat ownership gate. RuntimeThreadManager sets this marker on its private config clone; it is never user-configurable or serialized.
tools: Option<ToolsConfig>Native tool catalog controls. This table controls built-in tool loading policy.
skills_dir: Option<String>§mcp_config_path: Option<String>§mcp_oauth_callback_port: Option<u16>§mcp_oauth_callback_url: Option<String>§notes_path: Option<String>§memory_path: Option<String>§strict_tool_mode: Option<bool>When true, set tool_choice: "required" and opt compatible function
schemas into DeepSeek beta strict mode. Schemas with root alternatives
stay non-strict to avoid changing optional/one-of tool semantics.
instructions: Option<Vec<String>>Additional user-owned system-prompt sources concatenated in declared
order (#454). Paths are expanded via expand_path so ~ and env vars
work. Project-scope config is not allowed to set this field; the TUI
project overlay ignores instructions so a cloned repo cannot choose
arbitrary local files to place into the prompt. Each configured file is
loaded, capped at 100 KiB, and skipped (with a warning) on read errors so
a missing optional file doesn’t fail the launch.
allow_shell: Option<bool>§prompt_suggestion: Option<bool>Opt-in ghost-text follow-up prompt suggestion after each completed turn. Default: false — the user must explicitly set this to true to enable.
approval_policy: Option<String>§sandbox_mode: Option<String>§sandbox_network_access: Option<bool>Whether a workspace-write sandbox also grants the shell outbound
network access. Defaults to false: editing the workspace is not a
reason to be able to reach the internet. Network comes from an explicit
opt-in here, from a danger-full-access posture, or from the
post-denial elevation prompt. yolo/Bypass is unaffected — it
resolves to danger-full-access, which is unsandboxed by definition.
project_instruction_imports: Vec<String>Foreign-agent instruction formats to import as project instructions.
Empty by default: a CLAUDE.md, .cursorrules, or
.github/copilot-instructions.md written as law for another tool is
not silently treated as law for this one. Accepts claude, cursor,
cline, windsurf, gemini, copilot, muse, or all.
instruction_budget: Option<InstructionBudgetConfig>Per-scope standing-instruction budgets (#6526).
User config only, like instructions: the project-scope overlay
cannot set it, so a cloned repository cannot shrink the user’s global
budget or force policy = "refuse".
telemetry: Option<bool>telemetry as written to the config file, before environment and
default resolution. Kept so doctor and config displays can state the
resolved consent with its source (default | env | config) instead of
reading “unset” while batches ship (#5441).
fallback_providers: Vec<ProviderKind>§yolo: Option<bool>§verbosity: Option<String>§sandbox_backend: Option<String>External sandbox backend: "none" or "opensandbox".
When set, exec_shell routes commands through the backend’s HTTP API
instead of spawning a local process.
sandbox_url: Option<String>Base URL for the external sandbox backend (default: "http://localhost:8080").
sandbox_api_key: Option<String>Optional API key for the external sandbox backend (sent as Bearer token).
prefer_bwrap: Option<bool>When true and bubblewrap actually works on this Linux host, route
sandboxed exec_shell commands through it (#2184).
Defaults to true — an unset key means sandboxed commands run under
bwrap whenever /usr/bin/bwrap is installed and can create its
namespaces. An explicit prefer_bwrap = false opts out and leaves
Linux commands unwrapped (the posture then reports policy-only).
Requires the bubblewrap package to be installed separately — we do
NOT vendor bwrap.
tool_launcher: Option<Vec<String>>§bwrap_ro_roots: Vec<PathBuf>Additional host paths to bind read-only inside the bubblewrap sandbox
(Linux, prefer_bwrap = true, #5410). The default root bind already
exposes the host filesystem read-only; these cover setups where a
policy or future default narrows it. Non-existent paths are skipped.
bwrap_dev_roots: Vec<PathBuf>Host device nodes to bind read-write inside the bubblewrap sandbox
(#5410), e.g. /dev/null for shell redirection against the host node.
Only character/block devices are honored — never directories — so
this key cannot become a writable-root escape hatch. Non-existent or
non-device paths are skipped. The default private /dev already
provides fresh device nodes, so most users never need this.
sandbox_denied_read_paths: Vec<PathBuf>Opt-in sandbox read deny-list (S1, #5568). Listed subpaths are
unreadable inside sandboxed shell commands even though the sandbox
otherwise grants full-disk read: Seatbelt appends last-match-wins
deny rules; bubblewrap masks each existing path with an empty tmpfs
(directories) or a /dev/null bind (files). A leading ~ expands to
the user’s home. Empty (the default) preserves current behavior.
Example: sandbox_denied_read_paths = ["~/.ssh", "~/.aws"].
sandbox_read_denylist_defaults: Option<bool>Apply the built-in credential-store read deny-list (S1). Defaults to
true: ~/.ssh, cloud credential dirs, keychains, browser profiles,
.env files, and Codewhale’s own secret stores are unreadable by the
file-reading tools and by sandboxed shell commands. Set to false to
restore the pre-S1 full-disk-read behavior. See
sandbox::read_guard for the exact list and its honest limits — it is
defense-in-depth, not a security boundary.
sandbox_read_denylist_exempt: Vec<PathBuf>Subtract paths from the built-in deny-list defaults when a project
genuinely needs one of them. Has no effect on
sandbox_denied_read_paths: an explicit deny always wins.
managed_config_path: Option<String>§requirements_path: Option<String>§max_subagents: Option<usize>§retry: Option<RetryConfig>§stream: Option<StreamConfig>§features: Option<FeaturesToml>§extension_host: Option<ExtensionHostConfig>Experimental TypeScript extension host settings.
plugins: Option<BTreeMap<String, PluginSettings>>Per-plugin settings ([plugins."<name>".config]). User config only.
auto_review: Option<AutoReviewConfig>Deterministic user-level auto-review policy for tool calls. The engine applies these rules after built-in safety floors, so config cannot bypass publish/destructive-background holds.
tui: Option<TuiConfig>TUI configuration (alternate screen, etc.)
transcript: Option<TranscriptConfig>Transcript rendering controls ([transcript] table). Absent means
prose uses the full content width (#5436).
hooks: Option<HooksConfig>Lifecycle hooks configuration
lifecycle_outbox: Option<LifecycleOutboxToml>Lifecycle event outbox ([lifecycle_outbox]). Opt-in: an unset or
empty path disables the feature and leaves behavior unchanged.
Fires for interactive TUI sessions and headless codewhale exec runs.
control_socket: Option<ControlSocketToml>Per-session control socket ([control_socket]). Opt-in: an absent
table or enabled = false (the default) leaves the feature off.
When enabled, the interactive TUI binds a unix socket per running
session (see crate::tui::control_socket).
providers: Option<ProvidersConfig>Provider-specific credentials and defaults shared with the codewhale facade.
notifications: Option<NotificationsConfig>Desktop notification settings (OSC 9 / BEL on long turn completion).
approval: Option<ApprovalConfig>Approval-card presentation ([approval]). Absent means deny-by-default
preselection.
network: Option<NetworkPolicyToml>Per-domain network policy (#135). When absent, network tools fall back to a permissive default that mirrors pre-v0.7.0 behavior.
verifier: Option<VerifierConfigToml>Verifier-preview behavior (#2093). When absent, automatic verifier preview stays off and verifier verdicts use the hunt policy.
advisor: Option<AdvisorConfigToml>Background advisor watcher (#3982). When absent, the advisor is off
by default. Enable with [advisor] enabled = true or /advisor on.
skills: Option<SkillsConfig>Community skill installer settings (#140). When absent, installer
commands fall back to the bundled defaults
(codewhale_skill_install::install::DEFAULT_REGISTRY_URL +
codewhale_skill_install::install::DEFAULT_MAX_SIZE_BYTES).
snapshots: Option<SnapshotsConfig>Workspace side-git snapshots (#137). Defaults to enabled with 7-day retention when the table is absent.
search: Option<SearchConfig>Web search provider configuration. When absent, defaults to keyless
Firecrawl. Other API services require credentials; SearXNG requires a
trusted base_url.
goal: Option<GoalConfig>Persistent-goal loop controls (#5052). When absent, goals have no
continuation ceiling. Users can opt into one with
[goal] max_continuations.
reasoning_only: Option<ReasoningOnlyConfig>Reasoning-only recovery controls. When absent, the engine uses the
built-in default (2 retries, no custom message). Configure with
[reasoning_only] max_reprompts, reprompt_message, and on_output_limit.
memory: Option<MemoryConfig>User-level memory (#489). Default behaviour is opt-in:
loading + injection happens only when [memory] enabled = true or
DEEPSEEK_MEMORY=on is set. The surviving store is the native
Markdown + SQLite FTS5 system (memory/global/MEMORY.md).
speech: Option<SpeechConfig>Xiaomi MiMo speech/TTS defaults.
auto: Option<AutoConfig>Tunables for --model auto (#1207). When absent, the auto router
keeps its existing balanced behaviour.
hotbar: Option<Vec<HotbarBindingToml>>Optional 1-8 hotbar slot bindings (#2064). When absent, hotbar UI and
dispatch layers use the built-in defaults from codewhale_config.
update: Option<UpdateConfig>Startup update-check behavior. When absent, the TUI keeps the default fire-and-forget latest-release check.
cloud_facts: Option<CloudFactsConfig>Cloud facts overlay ([cloud_facts]). Absent/false = off.
lsp: Option<LspConfigToml>Post-edit LSP diagnostics injection (#136). When absent, the engine
applies the defaults documented in codewhale_config::LspConfigToml.
context: ContextConfigContext configuration (project context pack; legacy seam keys are parsed but ignored since the 2026-07-23 removal).
compaction: Option<CompactionSettings>Compaction summarizer tuning (#5956). Absent keeps the built-in summarizer prompt and the 20 000-token verbatim retention budget.
fleet: Option<FleetConfigToml>Agent Fleet trust/security/role/exec config.
workflow: Option<WorkflowConfigToml>Workflow automatic-launch, approval, isolation, and activity
persistence knobs (#4128). When absent, consumers use
codewhale_config::WorkflowConfigToml::default via
Self::workflow_config.
subagents: Option<SubagentsConfig>Sub-agent model overrides.
runtime_api: Option<RuntimeApiConfig>Runtime API server tuning (codewhale serve --http). Currently only
hosts the CORS allow-list extension (whalescale#255 / #561). When the
table is absent, the daemon ships with localhost:3000 / localhost:1420
as the only allowed dev origins.
workshop: Option<WorkshopConfig>Workshop / large-tool-output routing (#548). When absent, the global default threshold of 4 096 tokens applies and routing is active.
vision_model: Option<VisionModelConfig>Vision model configuration for the image_analyze tool.
redaction: Option<RedactionToml>Model-bound credential redaction policy ([redaction]). When absent,
masking is enabled — the shipped security default. A "disabled"
request only takes effect after a TUI restart and an explicit
confirmation on the startup gate; see
codewhale_config::redaction.
loaded_config_path: Option<PathBuf>Local provenance of the config actually loaded, including –config and CODEWHALE_CONFIG_PATH. Consent must not borrow another config’s receipt.
network_layer_is_managed: boolRuntime-only receipt that a higher-precedence layer supplied [network]
— a managed overlay. The resolved policy is then not the user
document’s to replace: a mid-session re-read of that document must not
widen what the higher layer set.
remembered_selection_scope: Option<bool>A resolved startup snapshot never reads remembered route choices again. False means an explicit config/profile owns the route instead.
environment_model_applied: boolAn explicit model applied by the environment/CLI layer outranks project defaults, including when it equals the previously saved model.
route_provenance: RouteProvenance§route_preferences_version: Option<u32>Atomic migration receipt: provider/model selections now belong to this config document. Settings route fields are legacy inputs only.
exec_policy_engine: ExecPolicyEngineSibling permissions.toml ask-rules compiled for runtime checks.
This is deliberately not part of config.toml; it is loaded from the
companion permissions file after profile/env/managed config resolution.
base_url_env_receipt: BaseUrlEnvReceiptReceipt describing what the environment layer did to this config’s effective base URL.
This provenance cannot be reconstructed from the merged provider table:
environment overrides are written into the same base_url field as
file-owned routes. Keep the receipt so a saved provider/root key (or a
configured api_key_env) cannot silently follow an env-selected custom
host, and so a cross-provider child cannot borrow an ambient generic
host that was never addressed to it.
legacy_root: LegacyRootMigrationWhat loading moved in memory from legacy top-level base_url /
api_key keys (#6394). Reported by doctor; never rewrites the file.
mini_window: Option<MiniWindowConfig>Mini-window (pinned, always-on-top) mode layout preferences
([mini_window] in config.toml). When the host terminal window is
pinned into its small always-on-top form, the TUI switches to a
compact layout that keeps only the elements listed here.
Implementations§
Source§impl Config
impl Config
Sourcepub fn prefers_bwrap(&self) -> bool
pub fn prefers_bwrap(&self) -> bool
Whether Linux shell commands prefer bubblewrap confinement.
On by default: an unset prefer_bwrap means sandboxed commands use
the OS wrapper whenever /usr/bin/bwrap works on this host, matching
the Seatbelt behavior macOS already has. An explicit false opts out
and leaves Linux commands unwrapped.
pub fn stop_words(&self) -> Vec<String>
Sourcepub fn external_credential_consent_status(
&self,
identity: &ProviderIdentity,
) -> Option<ExternalCredentialConsentStatus>
pub fn external_credential_consent_status( &self, identity: &ProviderIdentity, ) -> Option<ExternalCredentialConsentStatus>
Structural external-credential status for user-facing inventory. This resolves only environment/config strings and performs no filesystem or network access.
Sourcepub fn runtime_preset_blocker(
&self,
config_path: Option<&Path>,
profile: Option<&str>,
workspace: &Path,
) -> Option<&'static str>
pub fn runtime_preset_blocker( &self, config_path: Option<&Path>, profile: Option<&str>, workspace: &Path, ) -> Option<&'static str>
Return the non-root source that prevents an interactive runtime preset from safely rewriting approval, shell, and sandbox posture. Presets may edit user-owned root keys, but must never overwrite a profile, env, managed, requirements, or project constraint in the live merged Config.
Sourcepub fn approval_policy_control(
&self,
config_path: Option<&Path>,
profile: Option<&str>,
workspace: &Path,
) -> ApprovalPolicyControl
pub fn approval_policy_control( &self, config_path: Option<&Path>, profile: Option<&str>, workspace: &Path, ) -> ApprovalPolicyControl
Identify whether the effective approval policy can safely be edited by changing the root user config. Sources applied later in the load chain are deliberately treated as controlling even when their value happens to equal the root value; equality is not provenance.
Sourcepub fn allow_shell_control(
&self,
config_path: Option<&Path>,
profile: Option<&str>,
workspace: &Path,
) -> ShellAccessControl
pub fn allow_shell_control( &self, config_path: Option<&Path>, profile: Option<&str>, workspace: &Path, ) -> ShellAccessControl
Identify whether shell availability can safely be edited through the user-owned root config. Later sources are controlling even when their effective value happens to match the root value.
Sourcepub fn approval_policy_is_requirements_managed(&self) -> bool
pub fn approval_policy_is_requirements_managed(&self) -> bool
Whether organization requirements, rather than a user-editable config
key, own approval posture. User config still outranks TUI settings, but
/config approval_mode ... --save may edit that user-owned key.
Sandbox requirements also lock posture: Full Access changes the implicit
sandbox. This conservatively locks even posture changes that would fit.
pub fn search_provider_resolution(&self) -> SearchProviderResolution
pub fn search_provider(&self) -> SearchProvider
Sourcepub fn search_native(&self) -> Option<bool>
pub fn search_native(&self) -> Option<bool>
Whether provider-native search may lead the search chain.
[search] native = true|false is explicit. Unset, a user-chosen
provider (config, env, or a Tavily key) wins over provider-native
search (Some(false)); with no provider configured it stays None,
which keeps native search first on routes that offer it.
Sourcepub fn set_search_provider(
&mut self,
provider: SearchProvider,
) -> SearchProvider
pub fn set_search_provider( &mut self, provider: SearchProvider, ) -> SearchProvider
Store a session/config provider choice and return the effective runtime provider after applying the documented environment precedence.
Sourcepub fn auto_cost_saving(&self) -> bool
pub fn auto_cost_saving(&self) -> bool
Return true if the [auto] cost_saving = true opt-in is set
(#1207). When true, the auto-mode router biases toward the active
provider’s validated fast sibling for ambiguous requests instead of
its strong tier. Providers without a known sibling stay on the active
model. Default: false (balanced behaviour).
Sourcepub fn auto_cross_provider(&self) -> bool
pub fn auto_cross_provider(&self) -> bool
Return true only when [auto] cross_provider = true is persisted in
config (#4411). Auto mode otherwise stays on the active provider: the
classifier never sees other providers’ routes, and the local fallback
never selects one. There is no interactive toggle — enabling
cross-provider Auto is an explicit, durable config edit.
Sourcepub fn auto_router_timeout_secs(&self) -> u64
pub fn auto_router_timeout_secs(&self) -> u64
Classifier call timeout for [auto.router] in seconds. Defaults to
DEFAULT_AUTO_ROUTER_TIMEOUT_SECS (4); 0 means “use the default”.
Values above MAX_AUTO_ROUTER_TIMEOUT_SECS (300) are clamped so a
hung local router cannot stall a turn indefinitely.
Sourcepub fn auto_router_min_confidence(&self) -> f64
pub fn auto_router_min_confidence(&self) -> f64
Decision-router confidence floor, clamped to 0..=1; absent or
non-finite values use DEFAULT_AUTO_ROUTER_MIN_CONFIDENCE.
pub fn tools_always_load(&self) -> HashSet<String>
Sourcepub fn user_input_timeout(&self) -> Option<Duration>
pub fn user_input_timeout(&self) -> Option<Duration>
Effective wait for a user-input answer or an approval decision
(#6003). None or 0 waits until the person answers or cancels.
A positive value bounds that one wait; values above 24h clamp.
Sourcepub fn task_human_wait_cap(&self) -> Duration
pub fn task_human_wait_cap(&self) -> Duration
Effective ceiling for how long one durable task may stay parked on a
human answer. Absent or 0 is the 30 minute default; other values
clamp to 1..=86_400 seconds.
Sourcepub fn from_saved_document(
contents: &str,
profile: Option<&str>,
) -> Result<Self>
pub fn from_saved_document( contents: &str, profile: Option<&str>, ) -> Result<Self>
Parse persisted configuration through the same profile precedence used at startup, without environment, credentials, or filesystem writes.
pub fn migrated_legacy_ollama_cloud_route(&self) -> bool
pub fn load_with( path: Option<PathBuf>, profile: Option<&str>, environment_policy: ConfigEnvironmentPolicy, extend: &mut dyn FnMut(&mut Config) -> Result<()>, ) -> Result<Self>
Sourcepub fn legacy_selection_identity(
&self,
key: &str,
) -> Result<ProviderIdentity, String>
pub fn legacy_selection_identity( &self, key: &str, ) -> Result<ProviderIdentity, String>
Old chooser memory used the public Cloud key even when the active
hosted Ollama route still owns the legacy ollama table.
Sourcepub fn apply_saved_selection(&mut self, settings: &Settings) -> bool
pub fn apply_saved_selection(&mut self, settings: &Settings) -> bool
Resolve the existing startup preferences into the Config snapshot shared by the TUI, inventory and Runtime. Never touch persisted preferences or reread them while binding a saved thread’s route.
Sourcepub fn prose_measure(&self) -> Option<u16>
pub fn prose_measure(&self) -> Option<u16>
Resolved prose wrap cap from [transcript] prose_measure (#5436).
None (absent or 0) means prose uses the full content width,
consistent with tool/status cells. Invalid values are rejected by
Config::validate, which every load path runs, so this resolver
cannot fail here.
Sourcepub fn active_provider_identity(&self) -> Result<ProviderIdentity, String>
pub fn active_provider_identity(&self) -> Result<ProviderIdentity, String>
Resolve the currently selected live route, keeping its exact id.
Sourcepub fn provider_identities(&self) -> Vec<ProviderIdentity>
pub fn provider_identities(&self) -> Vec<ProviderIdentity>
Snapshot admitted identities in descriptor order, then exact custom-key order. This lists routes through the same resolver used by final dispatch; it neither activates them nor reads credentials.
Sourcepub fn unadmitted_provider_keys(&self) -> Vec<&str>
pub fn unadmitted_provider_keys(&self) -> Vec<&str>
Preserve broken/manual selections in diagnostic rosters without admitting them.
pub fn builtin_provider_identity( &self, kind: ProviderKind, ) -> Result<ProviderIdentity, String>
Sourcepub fn resolve_provider_identity(
&self,
persisted: &str,
) -> Result<ProviderIdentity, String>
pub fn resolve_provider_identity( &self, persisted: &str, ) -> Result<ProviderIdentity, String>
Resolve a persisted provider key against the current live config.
Named custom providers are exact and fail closed: a removed, renamed,
or malformed table can never fall through to DeepSeek or whichever
provider happens to be selected now. The literal legacy value custom
remains loadable only for the old root-field config shape where the live
provider is also literally custom and both base_url and
default_text_model identify one valid route.
Sourcepub fn resolve_provider_pin_identity(
&self,
provider_id: &str,
) -> Result<ProviderIdentity, String>
pub fn resolve_provider_pin_identity( &self, provider_id: &str, ) -> Result<ProviderIdentity, String>
Resolve a provider explicitly pinned by a current Fleet/subagent declaration.
A scoped legacy Ollama Cloud config retains its migration marker so the
active client can keep reading [providers.ollama] and the old secret
slot. That marker is provenance for the active route, not an alias for a
newly declared ollama-cloud pin: the explicit pin must bind the
first-class table and credential slot even when it is declared by a
child of the migrated route.
Sourcepub fn resolve_provider_selection_identity(
&self,
provider_id: &str,
) -> Result<ProviderIdentity, String>
pub fn resolve_provider_selection_identity( &self, provider_id: &str, ) -> Result<ProviderIdentity, String>
Resolve a provider a user is selecting now (codewhale config set provider <name>). A name that is neither a built-in provider nor a
configured table is a typo, not a saved session missing its route, so
it gets config validation’s wording instead of the resume wording.
Sourcepub fn resolve_persisted_provider_identity(
&self,
provider_kind: Option<&str>,
provider_id: Option<&str>,
) -> Result<ProviderIdentity, String>
pub fn resolve_persisted_provider_identity( &self, provider_kind: Option<&str>, provider_id: Option<&str>, ) -> Result<ProviderIdentity, String>
Resolve the two-field provider route written by current session/thread schemas without erasing which field supplied the identity.
provider_kind is the generic wire/provider class (custom for every
named OpenAI-compatible endpoint); provider_id is the additive exact
configured key. Older records have no id and may have overloaded the
kind field with an exact custom name. Keeping those cases distinct is
security-sensitive: a legacy built-in record must never be captured by
a later same-key custom table, while a current custom + exact-id pair
must retain that user-owned table identity.
Sourcepub fn scope_to_provider_identity(
&mut self,
identity: &ProviderIdentity,
) -> Result<(), String>
pub fn scope_to_provider_identity( &mut self, identity: &ProviderIdentity, ) -> Result<(), String>
Scope a runtime clone to one admitted identity; the parse-bound table remains present and every later table projection revalidates its receipt.
pub fn selects_literal_custom_provider(&self) -> bool
Sourcepub fn provider_wire_dialect(&self, identity: &ProviderIdentity) -> Option<&str>
pub fn provider_wire_dialect(&self, identity: &ProviderIdentity) -> Option<&str>
Trimmed, non-empty wire dialect preference for provider’s config
table ([providers.<name>] wire = "responses" | "anthropic" | "chat").
Single source for the client wire resolver and the capability reporter
so the two cannot drift. None means “no preference” — the provider’s
static policy applies.
pub fn provider_responses_profile( &self, identity: &ProviderIdentity, ) -> Option<&str>
pub fn verify_provider_identity( &self, identity: &ProviderIdentity, ) -> Result<(), String>
pub fn provider_config_for( &self, identity: &ProviderIdentity, ) -> Option<&ProviderConfig>
Sourcepub fn openrouter_vendor(&self) -> Result<Option<String>>
pub fn openrouter_vendor(&self) -> Result<Option<String>>
Resolve the pin from the selected provider only, before any request.
pub fn subagent_provider_config( &self, identity: &ProviderIdentity, ) -> Option<&SubagentProviderConfig>
pub fn provider_config_for_mut( &mut self, identity: &ProviderIdentity, ) -> Result<&mut ProviderConfig>
Sourcepub fn set_provider_model_override(
&mut self,
identity: &ProviderIdentity,
model: Option<String>,
) -> Result<()>
pub fn set_provider_model_override( &mut self, identity: &ProviderIdentity, model: Option<String>, ) -> Result<()>
Apply a runtime model override to the route’s own table.
Sourcepub fn set_provider_base_url_override(
&mut self,
identity: &ProviderIdentity,
base_url: Option<String>,
) -> Result<()>
pub fn set_provider_base_url_override( &mut self, identity: &ProviderIdentity, base_url: Option<String>, ) -> Result<()>
Apply a runtime endpoint override to the route’s own table.
Sourcepub fn set_provider_api_key_override(
&mut self,
identity: &ProviderIdentity,
api_key: Option<String>,
) -> Result<()>
pub fn set_provider_api_key_override( &mut self, identity: &ProviderIdentity, api_key: Option<String>, ) -> Result<()>
Apply an in-memory credential update to the route’s own table.
pub fn clear_codewhale_owned_chatgpt_oauth(&mut self) -> Result<()>
Sourcepub fn refresh_provider_routes_from(&mut self, fresh: &Self)
pub fn refresh_provider_routes_from(&mut self, fresh: &Self)
Refresh only model-provider route material from a newly loaded disk
snapshot. The receiver is the already-effective interactive Config,
including CLI feature toggles and workspace/project permission overlays;
replacing it wholesale during /load could silently loosen those
controls. Provider tables carry their endpoint, auth, headers, TLS,
model-passthrough, and per-route limits as one atomic registry.
Sourcepub fn provider_max_concurrency(
&self,
identity: &ProviderIdentity,
) -> Option<usize>
pub fn provider_max_concurrency( &self, identity: &ProviderIdentity, ) -> Option<usize>
Return the configured provider request concurrency cap.
None means the client does not apply an extra in-flight request
semaphore. Z.ai/GLM gets a conservative default because its SSE endpoint
times out under sustained parallel stream opens well below the advertised
service concurrency (#3496). Operators can raise it with
[providers.zai] max_concurrency = N; 0 explicitly disables the
client-side cap for that provider.
pub fn provider_config(&self) -> Option<&ProviderConfig>
pub fn insecure_skip_tls_verify(&self) -> bool
Sourcepub fn allow_insecure_http(&self) -> bool
pub fn allow_insecure_http(&self) -> bool
Per-provider consent to a plain-HTTP base_url (#5991). Loopback is
always allowed without it; this covers named LAN/internal hosts the
user explicitly trusts. Narrower than the env-var override, which
applies to every provider in the process.
pub fn context_window_for_provider_config( &self, identity: &ProviderIdentity, ) -> Option<u32>
Sourcepub fn model_context_windows_for(
&self,
identity: &ProviderIdentity,
) -> Option<&BTreeMap<String, u32>>
pub fn model_context_windows_for( &self, identity: &ProviderIdentity, ) -> Option<&BTreeMap<String, u32>>
[providers.<id>.model_context_windows] for this provider, keyed by
exact wire model id (#6108). Follows the same SiliconFlow CN sibling
fallback as Self::context_window_for_provider_config.
pub fn http_headers(&self) -> HashMap<String, String>
Sourcepub fn active_deepseek_alias_deprecation(&self) -> Option<ModelAliasDeprecation>
pub fn active_deepseek_alias_deprecation(&self) -> Option<ModelAliasDeprecation>
Describe a first-party DeepSeek alias that was migrated for the active route. Custom endpoints retain ownership of the same model strings and must not receive DeepSeek’s deprecation claim.
Sourcepub fn root_model_alias_owned_by_outgoing(
&self,
incoming: &ProviderIdentity,
) -> Option<(ProviderIdentity, String)>
pub fn root_model_alias_owned_by_outgoing( &self, incoming: &ProviderIdentity, ) -> Option<(ProviderIdentity, String)>
The root default_text_model alias is the active route’s fallback.
When a switch to incoming leaves a route that has no model leaf of its
own and was actually resolving the alias, return that outgoing identity
and value: the choice belongs to the outgoing route and must follow it
onto its own leaf, rather than stay at the root where the incoming route
would inherit it and the outgoing route would forget it (falling back to
its catalog default on the way back). The alias is default_text_model
or, when that is unset, the legacy root model it falls back to. A
persisted writer that moves it clears both roots
(config_persistence::unset_root_model_aliases); clearing only the
first would resurrect the second on the incoming route after reload.
pub fn default_model(&self) -> String
pub fn default_model_uses_root_default_text_model(&self) -> bool
pub fn configured_model_error(&self) -> Option<String>
Sourcepub fn active_route_base_url(&self) -> String
pub fn active_route_base_url(&self) -> String
Return the configured API base URL (normalized) for the selected route.
Sourcepub fn base_url_for_route(&self, identity: &ProviderIdentity) -> String
pub fn base_url_for_route(&self, identity: &ProviderIdentity) -> String
Resolve provider’s endpoint from the layers that provider actually
owns, in precedence order:
- its own
[providers.<table>]entry (including in-memory runtime overrides; DeepSeek-CN also reads[providers.deepseek]). A legacy top-levelbase_urlwas moved into its owner’s table on parse (#6394); - its provider-specific environment contract (
MOONSHOT_BASE_URL,OPENAI_BASE_URL, …), which names exactly one provider and is therefore sound to read for a route that is not the session’s; - the generic
CODEWHALE_BASE_URL/DEEPSEEK_BASE_URLoverride, but only when this config is still the route that override selected; - the provider’s canonical default endpoint.
Step 3 is why this is identity-aware instead of a bare env read.
CODEWHALE_BASE_URL is documented as “base URL for the active
provider”, and apply_env_overrides writes it onto exactly one
provider entry. Every cross-provider construction seam — a pinned
subagent/fleet child, the per-turn auto-router, tool routing, a picker
preview — works by cloning the session config and re-pointing
provider, so without the ownership check a Moonshot/Z.ai/MiniMax
child in a DeepSeek session would silently inherit the DeepSeek host
and dispatch a pinned model to the wrong vendor.
Sourcepub fn provider_uses_custom_endpoint(&self, identity: &ProviderIdentity) -> bool
pub fn provider_uses_custom_endpoint(&self, identity: &ProviderIdentity) -> bool
Whether provider’s effective endpoint is a custom host rather than its
shipped one. Resolved through the same identity-aware resolver the
client is built from, so this predicate cannot disagree with the URL the
request will actually be sent to.
Sourcepub fn config_credentials_are_bound_to_provider_endpoint(
&self,
identity: &ProviderIdentity,
) -> bool
pub fn config_credentials_are_bound_to_provider_endpoint( &self, identity: &ProviderIdentity, ) -> bool
Whether file-owned credential slots are bound to provider’s
effective endpoint.
The environment can replace the active route’s base URL after config
parsing. In that case, a root/provider api_key or configured
api_key_env still belongs to the file-owned endpoint and must not
follow a newly selected custom host. An explicit source-marked CLI key
remains a deliberate endpoint override and is handled before this
predicate by the runtime resolver.
Sourcepub fn active_route_endpoint_configured(&self) -> bool
pub fn active_route_endpoint_configured(&self) -> bool
The active route names its own endpoint: its [providers.<name>]
base_url (where a legacy top-level base_url lands too) or an
environment endpoint override. An endpoint is a configured route even
without a model or a working key.
Sourcepub fn model_ids_pass_through_for_provider(
&self,
identity: &ProviderIdentity,
) -> bool
pub fn model_ids_pass_through_for_provider( &self, identity: &ProviderIdentity, ) -> bool
Whether model ids for provider belong to the configured endpoint.
Every route — active or pinned — is judged on the endpoint it will
actually be dispatched to, so a pinned child cannot canonicalize model
ids for a host that owns its own namespace (or pass through ids on a
route that resolves to a canonical endpoint). The resolver behind
Config::provider_uses_custom_endpoint is identity-aware, so this no
longer risks attributing the session’s endpoint to another provider.
pub fn model_ids_pass_through(&self) -> bool
pub fn auth_mode_for_provider( &self, identity: &ProviderIdentity, ) -> Option<String>
Sourcepub fn external_credential_read_consent_configured(
&self,
identity: &ProviderIdentity,
source: ExternalCredentialSource,
) -> bool
pub fn external_credential_read_consent_configured( &self, identity: &ProviderIdentity, source: ExternalCredentialSource, ) -> bool
Whether a structurally valid read-only consent record exists for an external credential source. This never stats or reads the selected file and never mints the capability required to do so.
pub fn should_skip_secret_store_for_provider( &self, identity: &ProviderIdentity, ) -> bool
pub fn bind_account_model_owner(&mut self, owner: &str) -> Result<()>
pub fn session_provider_api_key( &self, identity: &ProviderIdentity, ) -> Option<String>
pub fn preserve_runtime_credentials(&mut self, current: &Self)
pub fn retain_compatible_session_keys(&self)
pub fn session_policy_without_key( &self, identity: &ProviderIdentity, ) -> Option<CredentialSource>
pub fn account_model_api_key( &self, identity: &ProviderIdentity, ) -> Option<String>
Sourcepub fn readonly_health_credential_generation(
&self,
identity: &ProviderIdentity,
) -> Option<CredentialGeneration>
pub fn readonly_health_credential_generation( &self, identity: &ProviderIdentity, ) -> Option<CredentialGeneration>
Prove a current health-cache credential generation without commands, refresh, secret-store reads, or external credential files. Opaque sources deliberately remain unchecked; this is not a credential resolver.
Sourcepub fn active_route_api_key(&self) -> Result<String>
pub fn active_route_api_key(&self) -> Result<String>
Read the API key.
Precedence: required account owner → session key → route-specific explicitly consented OAuth token → source-marked explicit CLI key → provider/root config → configured custom-provider environment → secret store → ambient provider environment.
An in-memory provider-table key is only honored when the user
explicitly set the field (not the legacy API_KEYRING_SENTINEL
placeholder, not empty whitespace).
Sourcepub fn active_route_api_key_with_source(&self) -> Result<(String, String)>
pub fn active_route_api_key_with_source(&self) -> Result<(String, String)>
The active route’s key with a display label naming its source
(secret store slot, config file, env var name, CLI, OAuth, …) for
authentication diagnostics. The key is normalized with
codewhale_secrets::normalize_api_key (#6528).
pub fn active_route_api_key_with_owner( &self, ) -> Result<(ResolvedApiKey, Option<String>)>
Sourcepub fn xai_oauth_route_credentials(
&self,
) -> Option<Result<OwnedOAuthCredentials>>
pub fn xai_oauth_route_credentials( &self, ) -> Option<Result<OwnedOAuthCredentials>>
The resolver’s xAI OAuth step: Some when the active route is xAI on
the official endpoint with auth_mode = "oauth" and a usable sign-in
exists (configured owned generation, legacy owned file, or consented
Grok CLI import), holding that sign-in’s credentials.
Sourcepub fn active_route_api_key_read_only(&self) -> Result<String>
pub fn active_route_api_key_read_only(&self) -> Result<String>
Resolve an API key for a diagnostic without migrating a legacy secret store or opening a write-capable secret backend.
This retains ordinary credential precedence, including a legacy
file-backed secret as a fallback, but it must only be used by static
diagnostic/reporting paths. Normal runtime and authentication paths use
Self::active_route_api_key and preserve their existing migration
behavior.
Sourcepub fn with_read_only_api_key_for_diagnostic(&self) -> Result<Self>
pub fn with_read_only_api_key_for_diagnostic(&self) -> Result<Self>
Clone this route with a diagnostic-only credential in its in-memory provider slot.
A live doctor probe still needs to construct the ordinary client. By
materializing the credential on an isolated clone first, that client
never reaches the normal migrating secret-store resolver while it is
only checking connectivity. The clone is process-local and is never
persisted.
Sourcepub fn skills_dir(&self) -> PathBuf
pub fn skills_dir(&self) -> PathBuf
Resolve the skills directory path.
pub fn bundled_skills_install_dir(&self) -> Option<PathBuf>
Sourcepub fn mcp_config_path(&self) -> PathBuf
pub fn mcp_config_path(&self) -> PathBuf
Resolve the MCP config path.
Sourcepub fn notes_path(&self) -> PathBuf
pub fn notes_path(&self) -> PathBuf
Resolve the notes file path.
Sourcepub fn memory_path(&self) -> PathBuf
pub fn memory_path(&self) -> PathBuf
Resolve the memory file path.
Sourcepub fn speech_output_dir(&self) -> Option<PathBuf>
pub fn speech_output_dir(&self) -> Option<PathBuf>
Resolve the default speech/TTS output directory, if configured.
Sourcepub fn instructions_paths(&self) -> Vec<PathBuf>
pub fn instructions_paths(&self) -> Vec<PathBuf>
Resolve the configured instructions = [...] array (#454)
to absolute paths, in declared order. Empty when unset or
when every entry is empty after trimming. Each entry runs
through expand_path so ~ and env vars are honoured.
pub fn auto_review_disabled(&self) -> bool
pub fn auto_review_review_all_shell(&self) -> bool
pub fn auto_review_reviewer_model(&self) -> Option<&str>
pub fn auto_review_environment(&self) -> &[String]
Sourcepub fn memory_enabled(&self) -> bool
pub fn memory_enabled(&self) -> bool
Whether the user-memory feature is enabled. The default is off
to preserve zero-overhead behavior for users who haven’t opted in.
Flips to true when [memory] enabled = true in config.toml or
DEEPSEEK_MEMORY=on is set in the environment.
Sourcepub fn goal_max_continuations(&self) -> u32
pub fn goal_max_continuations(&self) -> u32
Effective safety backstop on automatic goal continuation passes
(#5052). Goals are unlimited by default. [goal] max_continuations
opts into a ceiling; 0 disables it so only terminal status or user
control stops an operate-mode goal run.
Sourcepub fn goal_max_steps(&self) -> u32
pub fn goal_max_steps(&self) -> u32
Per-engine-turn model-step budget while a goal is active (#6512). Uses the ordinary turn resolver: omitted or zero is uncapped, and explicit positive ceilings are clamped to its supported range.
Sourcepub fn goal_enforce_token_budget(&self) -> bool
pub fn goal_enforce_token_budget(&self) -> bool
Whether a goal’s token_budget is a hard stop (#6013). Default false
keeps the advisory/telemetry behavior.
Sourcepub fn goal_complete_judge(&self) -> bool
pub fn goal_complete_judge(&self) -> bool
Whether update_goal complete is gated by an independent judge (#6013).
Sourcepub fn goal_blocked_judge(&self) -> bool
pub fn goal_blocked_judge(&self) -> bool
Whether update_goal blocked is gated by an independent judge (#6013).
Sourcepub fn goal_continuation_delay_seconds(&self) -> u64
pub fn goal_continuation_delay_seconds(&self) -> u64
Quiet period between successful interactive goal turns (#5508). Absent/zero keeps the existing immediate-continuation behavior.
pub fn reasoning_only_on_output_limit(&self) -> bool
Sourcepub fn reasoning_only_max_reprompts(&self) -> u32
pub fn reasoning_only_max_reprompts(&self) -> u32
Maximum number of automatic re-requests when the model returns only
reasoning without any answer or tool call. Defaults to 2.
Set via [reasoning_only] max_reprompts in config.toml.
Sourcepub fn reasoning_only_reprompt_message(&self) -> &str
pub fn reasoning_only_reprompt_message(&self) -> &str
Optional custom message sent to the model on each re-request when the
model returns only reasoning without any answer or tool call.
Set via [reasoning_only] reprompt_message in config.toml.
When unset, the built-in default is used.
Sourcepub fn memory_backend(&self) -> MemoryBackend
pub fn memory_backend(&self) -> MemoryBackend
Resolve the explicit local-memory backend.
Sourcepub fn vision_model_config(&self) -> Option<VisionModelConfig>
pub fn vision_model_config(&self) -> Option<VisionModelConfig>
Return the configured vision model config. A [vision_model] that
used to inherit the top-level api_key carries its own copy since
parsing moved that key (#6394). An unset runtime HTTP policy inherits
from the main config; provider credentials never follow
vision_model.base_url to another host.
pub fn project_context_pack_enabled(&self) -> bool
Sourcepub fn allow_shell(&self) -> bool
pub fn allow_shell(&self) -> bool
Return whether shell execution is allowed for noninteractive and
durable-task profiles. Defaults to false: in headless, app-server, and
background-task contexts there is no human to approve commands, so shell
access must be opted into explicitly (GHSA-72w5-pf8h-xfp4).
Sourcepub fn interactive_allow_shell(&self) -> bool
pub fn interactive_allow_shell(&self) -> bool
Return whether shell execution is allowed for an interactive TUI Agent
session. Defaults to true: the interactive composer always gates each
shell command behind an approval prompt, so the catalog can expose shell
by default while still preserving consent (GHSA-72w5-pf8h-xfp4). An
explicit allow_shell = false still hides shell tools. This is the
single source of truth for the interactive default; both startup
(run_interactive) and the durable Agent permission baseline read it so
the default cannot drift between them.
Sourcepub fn prompt_suggestion_enabled(&self) -> bool
pub fn prompt_suggestion_enabled(&self) -> bool
Whether ghost-text prompt suggestion is enabled (opt-in, default off).
Sourcepub fn compaction_summary_instructions(&self) -> Option<String>
pub fn compaction_summary_instructions(&self) -> Option<String>
Standing operator instructions for the compaction summarizer
([compaction] summary_instructions, #5956).
Trimmed; empty or whitespace-only reads as unset so an accidentally blank key cannot append an empty delimited section to every prompt. The character cap is applied where the suffix is built, so the warning fires once per compaction pass rather than once per turn.
Sourcepub fn compaction_retained_user_message_tokens(&self) -> usize
pub fn compaction_retained_user_message_tokens(&self) -> usize
Verbatim retention budget for recent plain user messages in the
compaction replacement history ([compaction] retained_user_message_tokens, #5956).
Unset returns the historical hard-coded 20 000. Explicit values clamp
to 2_000..=200_000: below the floor the replacement history stops
carrying a usable amount of the user’s own words, above the ceiling
the “compacted” history is large enough to re-trigger compaction on
the next turn.
Sourcepub fn max_subagents(&self) -> usize
pub fn max_subagents(&self) -> usize
Return the maximum number of concurrent sub-agents.
Checks [subagents] max_concurrent first, then top-level max_subagents,
then falls back to DEFAULT_MAX_SUBAGENTS.
Sourcepub fn max_subagents_for_provider(&self, identity: &ProviderIdentity) -> usize
pub fn max_subagents_for_provider(&self, identity: &ProviderIdentity) -> usize
Return the provider-specific maximum number of concurrent sub-agents.
[subagents.providers.<provider>] max_concurrent inherits from the
global [subagents] value when unset.
Sourcepub fn subagents_enabled(&self) -> bool
pub fn subagents_enabled(&self) -> bool
Whether the model-facing agent tool is available after applying the
feature flag, explicit [subagents] enabled switch, and legacy
zero-valued opt-outs.
Sourcepub fn subagents_enabled_for_provider(
&self,
identity: &ProviderIdentity,
) -> bool
pub fn subagents_enabled_for_provider( &self, identity: &ProviderIdentity, ) -> bool
Whether the model-facing agent tool is available for this provider
after applying global and provider-specific sub-agent controls.
Sourcepub fn subagents_disabled_reason(&self) -> Option<&'static str>
pub fn subagents_disabled_reason(&self) -> Option<&'static str>
Machine-readable reason sub-agents are disabled, in precedence order.
Sourcepub fn subagent_max_spawn_depth(&self) -> u32
pub fn subagent_max_spawn_depth(&self) -> u32
How many levels of nested sub-agents the interactive agent tool may
spawn. Reads [subagents] max_depth; when unset it defaults to
codewhale_protocol::fleet::DEFAULT_SPAWN_DEPTH. 0 is a valid value that
blocks the agent tool at this runtime depth. Positive owner choices
are preserved without another product ceiling.
Sourcepub fn subagent_max_spawn_depth_for_provider(
&self,
identity: &ProviderIdentity,
) -> u32
pub fn subagent_max_spawn_depth_for_provider( &self, identity: &ProviderIdentity, ) -> u32
Return the provider-specific maximum sub-agent recursion depth.
Sourcepub fn launch_concurrency(&self) -> usize
pub fn launch_concurrency(&self) -> usize
Number of direct (depth-1) sub-agents that may execute concurrently
before further launches queue for a launch slot (#3095). Reads
[subagents] launch_concurrency (or the deprecated
interactive_max_launch alias); when unset it defaults to the full
resolved max_subagents() (no artificial throttle), and any explicit
value is clamped to [1, max_subagents].
Sourcepub fn launch_concurrency_for_provider(
&self,
identity: &ProviderIdentity,
) -> usize
pub fn launch_concurrency_for_provider( &self, identity: &ProviderIdentity, ) -> usize
Return the provider-specific direct launch throttle. Children above this limit queue for a launch slot instead of starting immediately.
Sourcepub fn max_admitted_subagents(&self) -> usize
pub fn max_admitted_subagents(&self) -> usize
Maximum queued + running sub-agents admitted for the session.
Defaults to MAX_SUBAGENT_ADMISSION so distinct agent calls can
queue and drain through launch_concurrency instead of being rejected
at the instantaneous concurrency cap. Explicit values are clamped to
[max_subagents, MAX_SUBAGENT_ADMISSION].
Sourcepub fn max_admitted_subagents_for_provider(
&self,
identity: &ProviderIdentity,
) -> usize
pub fn max_admitted_subagents_for_provider( &self, identity: &ProviderIdentity, ) -> usize
Return the provider-specific queued + running admission cap.
Sourcepub fn subagent_default_max_steps(&self) -> Option<u32>
pub fn subagent_default_max_steps(&self) -> Option<u32>
Default per-child model-turn budget from [subagents] default_max_steps. None or 0 mean unbounded; positive values
remain an owner limit that descendants cannot widen.
Sourcepub fn subagent_default_wall_time_secs(&self) -> Option<u64>
pub fn subagent_default_wall_time_secs(&self) -> Option<u64>
Default per-child wall-clock budget in seconds from [subagents] default_wall_time_secs. None or 0 mean unbounded; positive
values remain an owner limit that descendants cannot widen.
Sourcepub fn subagent_api_timeout_secs(&self) -> u64
pub fn subagent_api_timeout_secs(&self) -> u64
Resolved per-step DeepSeek API timeout for sub-agents, in seconds.
Reads [subagents] api_timeout_secs and clamps to
[MIN_SUBAGENT_API_TIMEOUT_SECS, MAX_SUBAGENT_API_TIMEOUT_SECS]
(1..=3600). None or 0 resolve to
DEFAULT_SUBAGENT_API_TIMEOUT_SECS (600); explicit 1 is honored,
useful only in fast fail-fast tests, not production (#1806, #1808).
Sourcepub fn subagent_api_timeout_secs_for_provider(
&self,
identity: &ProviderIdentity,
) -> u64
pub fn subagent_api_timeout_secs_for_provider( &self, identity: &ProviderIdentity, ) -> u64
Return the provider-specific per-step API timeout for sub-agents.
Sourcepub fn subagent_heartbeat_timeout_secs(&self) -> u64
pub fn subagent_heartbeat_timeout_secs(&self) -> u64
Resolved no-progress heartbeat timeout for running sub-agents.
Reads [subagents] heartbeat_timeout_secs and clamps to
[MIN_SUBAGENT_HEARTBEAT_TIMEOUT_SECS, MAX_SUBAGENT_HEARTBEAT_TIMEOUT_SECS].
None or 0 resolve to the default 300 seconds. The final value is
also kept at least 30 seconds above subagent_api_timeout_secs() so a
configured long model request is not pre-empted by heartbeat cleanup,
and at least 30 seconds above the sub-agent tool timeout so a single
long tool execution is not cancelled as “no progress” (2026-08-04
sub-agent hunt, finding 4).
Sourcepub fn subagent_heartbeat_timeout_secs_for_provider(
&self,
identity: &ProviderIdentity,
) -> u64
pub fn subagent_heartbeat_timeout_secs_for_provider( &self, identity: &ProviderIdentity, ) -> u64
Return the provider-specific no-progress heartbeat timeout.
Sourcepub fn stream_chunk_timeout_secs(&self) -> u64
pub fn stream_chunk_timeout_secs(&self) -> u64
Resolved per-SSE-chunk idle timeout in seconds.
Reads [stream].chunk_timeout_secs, then legacy [tui], then the
CODEWHALE_STREAM_IDLE_TIMEOUT_SECS env var (legacy alias:
DEEPSEEK_STREAM_IDLE_TIMEOUT_SECS) when the config key is
omitted. None or 0 resolve to the default 900 seconds; explicit
values are clamped to 1..=3600.
Sourcepub fn max_model_steps(&self) -> u32
pub fn max_model_steps(&self) -> u32
Resolved optional ceiling on model steps in a single turn.
Reads [tui].max_model_steps, falling back to the
CODEWHALE_MAX_MODEL_STEPS env var, then to the uncapped default.
0 from either source also selects the uncapped default.
Sourcepub fn turn_wall_clock(&self) -> Duration
pub fn turn_wall_clock(&self) -> Duration
R1: resolved cumulative per-turn wall-clock budget.
Reads [tui].turn_wall_clock_secs, falling back to the
CODEWHALE_TURN_WALL_CLOCK_SECS env var, then to no limit. 0
also means no limit.
Sourcepub fn stream_max_content_bytes(&self) -> usize
pub fn stream_max_content_bytes(&self) -> usize
R1: resolved per-step cap on accumulated streamed content, in bytes.
Sourcepub fn stream_max_duration(&self) -> Duration
pub fn stream_max_duration(&self) -> Duration
R1: resolved per-step cap on a single stream’s wall-clock duration.
Sourcepub fn stream_retry_limits(&self) -> StreamRetryLimits
pub fn stream_retry_limits(&self) -> StreamRetryLimits
Resolved [stream] retry budgets, falling back to legacy [tui] keys.
Sourcepub fn stream_open_timeout(&self) -> Duration
pub fn stream_open_timeout(&self) -> Duration
#6700: resolved wait for SSE response headers.
Sourcepub fn force_http1(&self) -> bool
pub fn force_http1(&self) -> bool
#6700: whether the model HTTP client is pinned to HTTP/1.1 —
[stream].force_http1 (legacy [tui] fallback), OR the environment pin.
Sourcepub fn connect_timeout(&self) -> Duration
pub fn connect_timeout(&self) -> Duration
#6700: resolved TCP/TLS connect timeout for the model HTTP client.
Sourcepub fn tcp_keepalive(&self) -> Option<Duration>
pub fn tcp_keepalive(&self) -> Option<Duration>
TCP keepalive idle time. Zero disables; positive values clamp to 1..=3600.
Sourcepub fn http2_keep_alive_interval(&self) -> Option<Duration>
pub fn http2_keep_alive_interval(&self) -> Option<Duration>
HTTP/2 PING interval for active connections (not idle pooled connections).
pub fn http2_keep_alive_timeout(&self) -> Duration
Sourcepub fn resolved_stream_settings(&self) -> StreamConfig
pub fn resolved_stream_settings(&self) -> StreamConfig
Non-secret effective settings for config dump/get. This projection
calls the runtime accessors, so aliases, environment and clamps cannot
acquire a second policy in the dispatcher. It does not save defaults.
Sourcepub fn subagent_model_overrides(&self) -> HashMap<String, SubagentModelOverride>
pub fn subagent_model_overrides(&self) -> HashMap<String, SubagentModelOverride>
Raw sub-agent model override map. Values are validated at spawn time so an invalid role/type model fails before any partial agent spawn.
Sourcepub fn subagent_route_replacements(
&self,
key: &str,
) -> Vec<SubagentModelOverride>
pub fn subagent_route_replacements( &self, key: &str, ) -> Vec<SubagentModelOverride>
The operator-approved replacement routes declared beside the role pin
that Self::subagent_model_overrides resolved under key. A
canonical role key wins over a legacy alias, matching pin precedence.
Sourcepub fn fleet_config(&self) -> FleetConfigToml
pub fn fleet_config(&self) -> FleetConfigToml
Parsed [fleet] table, or defaults when the table is absent
(#fleet-roster cutover (v0.8.67)).
pub fn mcp_backend(&self) -> McpBackend
Sourcepub fn workflow_config(&self) -> WorkflowConfigToml
pub fn workflow_config(&self) -> WorkflowConfigToml
Parsed [workflow] table, or product defaults when the table is absent
(#4128 / Section 2.11). Automatic launch, approval, isolation, and
activity-persistence consumers should read through this accessor so
omitted keys share one model.
Sourcepub fn model_bound_redaction(&self) -> ModelBoundMasking
pub fn model_bound_redaction(&self) -> ModelBoundMasking
The requested model-bound masking mode ([redaction] model_bound),
defaulting to enabled. This is the user’s request; the effective mode
also depends on the startup-gate confirmation receipt, see
codewhale_config::redaction::effective_masking.
Sourcepub fn redaction_confirmation_required(&self) -> bool
pub fn redaction_confirmation_required(&self) -> bool
Whether the startup gate must ask before the current config’s
[redaction] model_bound request can take effect.
Sourcepub fn record_redaction_confirmation(&self) -> Result<PathBuf>
pub fn record_redaction_confirmation(&self) -> Result<PathBuf>
Persist the confirmation and return the written receipt path. Called after the user picks the explicit “confirm” action.
Sourcepub fn reasoning_effort(&self) -> Option<&str>
pub fn reasoning_effort(&self) -> Option<&str>
Return the configured DeepSeek reasoning-effort tier, if any.
pub fn reasoning_effort_is_explicit(&self) -> bool
Sourcepub fn hooks_config(&self) -> HooksConfig
pub fn hooks_config(&self) -> HooksConfig
Get hooks configuration, returning default if not configured.
Sourcepub fn notifications_config(&self) -> NotificationsConfig
pub fn notifications_config(&self) -> NotificationsConfig
Resolve the notifications configuration with defaults applied.
Sourcepub fn approval_default_selection(&self) -> ApprovalDefaultSelection
pub fn approval_default_selection(&self) -> ApprovalDefaultSelection
Resolve which approval option a fresh card highlights (#5293).
Sourcepub fn approval_timeout(&self) -> Option<Duration>
pub fn approval_timeout(&self) -> Option<Duration>
Effective expiry for the Engine-held approval request (#6101).
None (absent or an explicit 0) waits indefinitely; a positive
value bounds the wait, including a hidden card, and expiry blocks the call.
Values above 24h clamp with a warning.
Sourcepub fn snapshots_config(&self) -> SnapshotsConfig
pub fn snapshots_config(&self) -> SnapshotsConfig
Resolve workspace side-git snapshot settings with defaults applied.
Sourcepub fn skills_config(&self) -> SkillsConfig
pub fn skills_config(&self) -> SkillsConfig
Resolve community skill settings with defaults applied.
Sourcepub fn update_config(&self) -> UpdateConfig
pub fn update_config(&self) -> UpdateConfig
Resolve startup update-check settings with defaults applied.
Sourcepub fn cloud_facts_config(&self) -> CloudFactsConfig
pub fn cloud_facts_config(&self) -> CloudFactsConfig
Resolve cloud facts settings with defaults applied (off by default).
Sourcepub fn resolve_hotbar_bindings(
&self,
known_action_ids: &[&str],
) -> HotbarConfigResolution
pub fn resolve_hotbar_bindings( &self, known_action_ids: &[&str], ) -> HotbarConfigResolution
Resolve durable hotbar bindings for render/dispatch layers.
Sourcepub fn set_feature(&mut self, key: &str, enabled: bool) -> Result<()>
pub fn set_feature(&mut self, key: &str, enabled: bool) -> Result<()>
Override a feature flag in memory (used by CLI overrides).
Sourcepub fn retry_policy(&self) -> RetryPolicy
pub fn retry_policy(&self) -> RetryPolicy
Resolve the effective retry policy with defaults applied.
Source§impl Config
impl Config
Sourcepub fn codex_credentials(&self) -> Result<OwnedOAuthCredentials>
pub fn codex_credentials(&self) -> Result<OwnedOAuthCredentials>
Resolve Codewhale’s verified ChatGPT grant. Credential refresh remains serialized by the owned-store lifecycle transaction.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl !RefUnwindSafe for Config
impl !UnwindSafe for Config
impl Forget for Config
impl Freeze for Config
impl Move for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.