pub struct EngineConfig {Show 23 fields
pub provider: Option<String>,
pub model: String,
pub max_tokens: u32,
pub permission_prompt_timeout_secs: u64,
pub tool_cancel_grace: Duration,
pub max_parallelism: usize,
pub max_api_calls_per_turn: u32,
pub strong_model: Option<String>,
pub permission_mode: PermissionMode,
pub sandbox: Arc<SandboxSettings>,
pub disable_skill_shell_execution: bool,
pub project_trust: ProjectTrust,
pub prompt_files: PromptFiles,
pub layout: Layout,
pub subprocess_env: SubprocessEnv,
pub file_limits: FileLimits,
pub system_prompt: SystemPromptSettings,
pub max_agent_depth: u32,
pub verbose_tool_results: bool,
pub path_style: PathStyle,
pub deferred_tools: Arc<HashSet<String>>,
pub tool_results: ToolResultLimits,
pub model_autonomy: ModelAutonomy,
}Expand description
引擎只读配置。从 settings.json + CLI flags 合并出来后,整个会话不再变。
Fields§
§provider: Option<String>Provider id (e.g. “anthropic”, “deepseek”, “xai”).
model: String§max_tokens: u32§permission_prompt_timeout_secs: u64How long a tool call waits for a permission answer before denying.
0 = wait indefinitely. See
the permissions.prompt_timeout_secs setting.
tool_cancel_grace: DurationHow long a tool call still running when its turn is cancelled is given to stop on its own before it is dropped and answered as cancelled.
max_parallelism: usizeMaximum number of concurrency-safe tools to run in parallel within a single batch. 0 = unlimited. Default 10.
max_api_calls_per_turn: u32+** — per-turn API call budget. Default 200.
When exceeded, engine returns gracefully with
StopReason::MaxTurns instead of an error — partial work
is preserved and surfaced to the caller. Lower this for sub-
agents you want to cap (e.g. compactors at 1, memory-extractors
at 5).
strong_model: Option<String>Auto-routing: optional “strong” tier model. When set,
the engine starts each turn at model (cheap/fast tier, e.g.
ds-v4-flash) and escalates to strong_model mid-turn on any
of these signals:
tool_calls_so_far >= 3(multi-step exploration)- previous tool_result was an error (need smarter retry)
- turn message count >= 8 (deep conversation)
Once escalated, stays at strong for rest of the turn.
None = no routing (use model for everything; current default).
User-facing API: surface as --strong-model CLI flag, or in
~/.agix/scenes/<scope>/settings.json.
permission_mode: PermissionMode§sandbox: Arc<SandboxSettings>The session’s sandbox settings; every policy a command runs under is derived from these.
disable_skill_shell_execution: boolSettings.skills.allow_shell, the other way round — read by the skill
expansion’s !`cmd` step via ToolContext.config.
project_trust: ProjectTrustWhether the project tier is in effect (LoadedSettings::trust); an
untrusted project’s skill !`cmd` is not run.
prompt_files: PromptFilesHow the engine reads the files it puts in front of the model.
layout: LayoutWhat the instance names its directories, for the tools that make one or name one to the model.
subprocess_env: SubprocessEnvMirrors Settings.sandbox.env.
file_limits: FileLimitsFile read/write byte/line limits. Sub-config keeps related field values together so cross-tool tuning (Read/Write/Edit) is one import path.
system_prompt: SystemPromptSettingssystem prompt overrides + extras (AGENTS.md walk, output styles, append/override). All affect what gets baked into block [1-5] of the system prompt.
max_agent_depth: u32最大 agent 嵌套深度。主 agent 深度 0,每经 AgentTool spawn 加 1。 超限时 AgentTool 返回 tool error(防模型在子 agent prompt 中写“用 AgentTool“ 导致无限递归)。默认 3。设 0 禁用 AgentTool。
verbose_tool_results: bool是否保留完整工具结果文本。默认 false —— 工具结果会被截断到 2KB 再送回给模型。设 true 时原样透传(长输出场景可能显著消耗 context)。
path_style: PathStyleSee PathStyle; mirrors Settings.path_style.
deferred_tools: Arc<HashSet<String>>Tools advertised to the model by name and description only, their
schema fetched through ToolSearch — the scene’s
ToolSurface::deferred, fixed when the session is built. A property
of the session rather than of the tool, so an MCP tool that arrives
mid-session is deferred like one that was there from the start.
tool_results: ToolResultLimitsWhere a tool result too long for the conversation is kept.
model_autonomy: ModelAutonomyWhat the model may set going for itself beyond the turn it is asked in.
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn defaults_for(model: impl Into<String>) -> Self
pub fn defaults_for(model: impl Into<String>) -> Self
合理默认值;具体使用方根据 CLI 与 settings 覆盖。