Skip to main content

CodingAgentConfig

Struct CodingAgentConfig 

Source
pub struct CodingAgentConfig {
Show 22 fields pub model: String, pub system: Option<String>, pub base_system: Option<String>, pub workspace: PathBuf, pub skills: Option<Vec<Skill>>, pub disabled_skills: BTreeSet<String>, pub max_turn_steps: u32, pub thinking: ThinkingEffort, pub tools: Option<Arc<ShellTools>>, pub extra_resolver: Option<Arc<dyn ToolResolver>>, pub transcript: Option<TranscriptSettings>, pub summary_worker: Option<Arc<dyn Summarizer>>, pub shell_env: BTreeMap<String, String>, pub steering: Option<Arc<dyn Steering>>, pub mcp_servers: Vec<McpServerLine>, pub disabled_mcp_servers: BTreeSet<String>, pub disabled_subagents: BTreeSet<String>, pub subagent_providers: Option<SubagentProviders>, pub environment: Option<String>, pub user_preferences: Option<String>, pub vision: Option<String>, pub home: Option<Home>,
}
Expand description

Everything a CodingAgent needs besides the provider.

Fields§

§model: String

Model identifier, passed through to ChatParams.

§system: Option<String>

System prompt stamped into every request. None uses the base prompt — base_system when set, the built-in default otherwise; setting it replaces everything, it does not append.

§base_system: Option<String>

The base prompt from the user’s SYSTEM.md, a Jinja template rendered by render_system — a template error fails the agent’s construction. None uses the built-in default_system.

§workspace: PathBuf

Root all tools are scoped to; paths that escape it are rejected in-band to the model.

§skills: Option<Vec<Skill>>

Skills already collected elsewhere, for the prompt’s skills list. None discovers from the filesystem — the global config directory and the workspace’s .rhema/skills. A frontend with no filesystem to discover from (the cloud sandbox) seeds the skill files itself and passes the list; the model reads bodies through the shell, so each path must resolve inside the workspace.

§disabled_skills: BTreeSet<String>

Skill folder names to drop from whichever list the prompt carries — the persisted off switch a frontend reads out of its config. The filter runs after collection and after discovery alike, so both supply paths honor it; an empty set (the default) changes nothing.

§max_turn_steps: u32

Cap on steps per turn; a turn still requesting tools past it fails with AgentError::MaxIterations.

§thinking: ThinkingEffort

How much reasoning the model should do; providers without a knob ignore it, and ThinkingEffort::Default sends nothing.

§tools: Option<Arc<ShellTools>>

The shell resolver the agent’s tools run on. None builds one over workspace — the default. A frontend that shares its shell with an extension (the subagents extension reads the turn’s approval hook off it) brings its own.

§extra_resolver: Option<Arc<dyn ToolResolver>>

An extension resolver merged over the shell’s tools through Overlay: its specs join the prompt’s tool list and its tools resolve by name, shadowing a built-in of the same name. None runs the built-ins alone.

§transcript: Option<TranscriptSettings>

The transcript: a bounded request view over the unbounded session, plus the zoom tool to read back through it. On by default and below the budget a pass-through, so small sessions are byte-identical to a transcript-less run. None is the off switch: requests carry the whole history. See specs/rhema-transcript.md.

§summary_worker: Option<Arc<dyn Summarizer>>

The compaction’s model fill: a cheap worker the transcript’s stepped compaction runs at flushes, rewriting each new block section’s extractive stand-in into a dense markdown block. The worker never blocks or fails a request — a failed call leaves the stand-in in place. None keeps the compaction extractive: still stepped, still cache-stable, only less dense. See specs/rhema-transcript.md.

§shell_env: BTreeMap<String, String>

Extra environment the shell tool’s commands run with, layered over the inherited one — how a frontend provisions its agent’s client tools (a daemon URL, a scoped token, a PATH addition) without touching the process environment.

§steering: Option<Arc<dyn Steering>>

A steering source the turn loop drains: one User-role message per drain lands in the history at a step boundary, so work that finished outside the turn (a background subagent) is announced to the model. None — the default — runs the turn exactly as before: the loop is the provided run_turn with no injection.

§mcp_servers: Vec<McpServerLine>

The wired MCP servers, as the prompt’s mcp section carries them — the lines a frontend’s wire step produced (spec: specs/rhema-mcp.md §10). Empty renders no section: a frontend that wires nothing advertises nothing.

§disabled_mcp_servers: BTreeSet<String>

MCP server names to drop from the prompt’s section — the persisted off switch a frontend reads out of its stored settings, the disabled_skills mechanism. Applied at stamp time over mcp_servers by config name; the wire step filters the same set before anything spawns.

§disabled_subagents: BTreeSet<String>

Subagent definition folder names the subagent wire drops from discovery — the persisted off switch a frontend reads out of its stored settings, the disabled_skills mechanism. The filter runs before the catalog builds, so a disabled name is in neither the prompt’s tool list nor the tools array; the built-in general-purpose answers to its name like any other, and a set holding every discovered name leaves no catalog, which drops the tool whole.

§subagent_providers: Option<SubagentProviders>

Resolves a provider kind to a turn provider, for the subagent tool’s model argument (<provider>/<model>) and the same spelling in a definition’s model frontmatter: a subagent can run on another logged-in provider while the session stays put. The wire hands it to the tool; None means the session’s own provider is the only one, and cross-provider requests fail with that named. Credential resolution stays with the frontend — this carries the answers, not the policy.

§environment: Option<String>

The environment section rendered into the system prompt: machine facts probed where commands run (see the environment module). None renders the section empty. A verbatim system prompt ignores it, like every template section.

§user_preferences: Option<String>

The user-preferences section rendered into the system prompt — the contents of the user’s global USER.md, verbatim, a frontend that has one reads it and passes it here. None renders nothing.

§vision: Option<String>

The prompt section documenting the wired vision macro — the see bash function’s documentation, produced by the frontend’s provisioning and passed verbatim. None renders no section: a frontend that wired nothing advertises nothing, the same rule the mcp_servers section follows.

§home: Option<Home>

The directory conventions skill discovery reads when skills is None: the user-wide skills directory and the cross-agent .agents/skills convention. None — the default — discovers the reference layout (Home::discover); a frontend that owns its own directory hands a relocated Home instead.

Implementations§

Source§

impl CodingAgentConfig

Source

pub const DEFAULT_MAX_TURN_STEPS: u32 = 2048

Default for max_turn_steps. Long autonomous sessions — builds, rebases, multi-package sweeps — routinely run hundreds of steps on cheap models under a watching eye; the cap exists to end a runaway loop, not to ration the model. --max-steps is the tighter leash for unattended turns on expensive models.

Source

pub fn new(model: impl Into<String>, workspace: impl Into<PathBuf>) -> Self

Config naming model, rooted at workspace, defaults elsewhere.

Trait Implementations§

Source§

impl Clone for CodingAgentConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CodingAgentConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more