pub struct TuiConfig {Show 26 fields
pub chat_style: ChatStyle,
pub prompt: Option<String>,
pub no_splash: bool,
pub edit_mode: EditMode,
pub gutter: Option<u16>,
pub footer: FooterMode,
pub color: ColorMode,
pub thinking: ThinkingMode,
pub tool_output_lines: usize,
pub max_tool_rounds: usize,
pub workflow_grace_rounds: usize,
pub permissions: ToolPermissions,
pub debug: Option<bool>,
pub trace: Option<bool>,
pub build_check_cmd: Option<String>,
pub num_ctx: Option<u32>,
pub real_context_discovery: Option<bool>,
pub connect_timeout_secs: u64,
pub inference_timeout_secs: u64,
pub keep_alive: String,
pub markdown: MarkdownMode,
pub mid_loop_trim_threshold: usize,
pub mid_loop_trim_tokens: Option<usize>,
pub sanitize_mcp_server_names: bool,
pub mcp_allow_insecure_hosts: Vec<String>,
pub allow_bang_escape: bool,
}Expand description
TUI appearance preferences stored under [tui] in newt.toml.
Fields§
§chat_style: ChatStyleWhether to show “newt” / “you” labels before the carets.
prompt: Option<String>PS1-style prompt template.
Tokens: \w workspace basename, \W full path, \h hostname,
\v newt version. Default: "\\w $ " (compact) / "you $ " (verbose).
no_splash: boolSkip the full-screen ANSI art splash and show a compact header instead.
Equivalent to the --no-splash CLI flag.
edit_mode: EditModeKey binding mode for the chat input line.
"emacs" (default), "vi", or "nano". Also overridable via
NEWT_EDIT_MODE. (nano is emacs-style/modeless — it differs from
emacs only in label today; the rich-tui surface honors it.)
gutter: Option<u16>Rich-tui (issue #416) input gutter width, in columns. Unset = auto
(the responsive default: a prompt gutter when it fits under ~1/3 of the
width, else a stacked prompt row). 0 turns the gutter off (prompt on
its own row, input flush-left); a positive value indents the input that
many columns (a value wide enough to hold the prompt renders it inline).
No effect on the lean surface.
Input-footer mode: the transient multi-line ❯ input block with a
status header. "auto" (default) shows it on a TTY and degrades to a
plain scroller otherwise; "on" always shows it; "off" never does
(the --plain CLI flag, or NEWT_FOOTER=off).
color: ColorModeColor / theme mode (issue #527): "auto" (default), "always",
"never", "minimal", "inverted", "dark", "light", "mono".
The --color CLI flag and --mono override this; NO_COLOR /
TERM=dumb force it off unless an explicit --color is given. This is
the on/off + theme mode; [tui.colors] below is the palette.
thinking: ThinkingModeHow a thinking model’s streamed reasoning is shown: "stream" (default
— dim reasoning + a cargo-style spinner, TTY only) or "off".
tool_output_lines: usizeMaximum lines of tool output shown inline before offering “show all?”. Default: 20. Set to 0 to always show everything.
max_tool_rounds: usizeMaximum number of tool-call rounds the model may take within a single
turn before the agent forces a final, tools-disabled completion. Each
round is one model response that may emit tool calls; once this many
rounds have run without a tool-free answer, newt asks the model once
more with tools disabled so the user still gets a real (partial)
answer instead of a placeholder. Default: 40 (raised from 25 — a
modest safety margin alongside workflow_grace_rounds and the
workflow-classifier delegate hint; genuinely open-ended diagnostic work
should reach for crew/team delegation rather than depend on an
unbounded cap here).
workflow_grace_rounds: usizeAdditional progress-aware rounds available after max_tool_rounds when
an active workflow still has incomplete steps and the recent rounds show
repair progress or actionable evidence. Default: 5. Set to 0 to make the
normal round cap hard again.
permissions: ToolPermissionsTool-call permission policy for the interactive TUI: which tools the
model may invoke and over which targets. This is a preset that selects
an attenuation — the host (newt-identity) lowers it into a signed,
attenuation-only capability that enforcement consults. Default:
WorkspaceDev.
debug: Option<bool>Enable per-round agent-loop diagnostics printed to the TUI. Shows each
round’s content excerpt, tool-call count, token usage, and flags empty
model responses before they become silent failures. Also set via the
NEWT_DEBUG=1 environment variable.
trace: Option<bool>Enable deep backend/inference diagnostics. Intended for issue reports
and compatibility debugging; also set via NEWT_TRACE=1.
build_check_cmd: Option<String>Shell command to run after every successful file write or edit, to give the agent immediate ground-truth feedback on whether its change compiled / passed basic checks. Output is appended to the tool result so the model sees it without needing to ask.
Set this per-workspace in .newt/config.toml — not globally — because
the right command depends on the project’s build system:
[tui]
build_check_cmd = "cargo check -q --workspace" # Rust
# build_check_cmd = "npm run build --silent" # Node
# build_check_cmd = "python -m py_compile" # PythonNone (default) disables auto-checking — no extra command is run.
num_ctx: Option<u32>Ollama context-window cap sent as options.num_ctx on every request.
Limits the KV-cache allocation so a large model can’t exhaust VRAM
mid-session. None → newt trusts the model’s declared context window
from Ollama /api/show and sends ~80 % of it as num_ctx (see
real_context_discovery). Set an explicit cap here (e.g. 8192 / 16384)
on VRAM-constrained hosts; this always takes precedence over the
declared window.
real_context_discovery: Option<bool>Opt into empirical context-window discovery (the conserve-for-tiny-
hardware mode). When false/unset (the default), newt trusts the
declared /api/show window: safe_context tracks ~80 % of it and is
raised back to it each session, so a model is never permanently capped
by a past overflow. When true, newt instead keeps the conservative
behaviour — bootstrap safe_context once, never auto-raise it, and let
runtime context-window 400s ratchet it down and persist (for hardware
that genuinely can’t serve the full declared window). Overridable
per-model via [[model_tuning]] real_context_discovery.
connect_timeout_secs: u64TCP connect timeout in seconds for inference requests (default: 5).
A fast failure here means the endpoint is down (connection refused),
distinguishing it from a slow-but-alive endpoint that needs the full
inference_timeout_secs to respond. Keep this short.
inference_timeout_secs: u64Total inference request timeout in seconds (default: 120). This is the wall-clock budget for the model to generate a complete response — large models on a busy DGX may need the full window.
keep_alive: StringHow long Ollama keeps a model resident in VRAM after the last request,
as an Ollama duration string (e.g. "5m", "0", "-1").
Default: "5m". Use "0" to unload immediately after each turn
(maximum headroom for multi-model or multi-agent workloads at the cost
of a reload on each turn). Use "-1" to keep forever.
markdown: MarkdownModeMarkdown rendering of assistant output (Step 25.4, #568). auto
(default) renders whenever color is active; on/off force it. The
/markdown [on|off] command overrides this for the session.
mid_loop_trim_threshold: usizeMaximum number of messages in the in-progress tool-call message list
before the agent trims the middle to prevent context overflow.
Default: 40 (≈ 20 tool-call rounds). Set lower on memory-constrained
endpoints or when num_ctx is small.
mid_loop_trim_tokens: Option<usize>Estimated-token threshold that triggers a mid-loop context trim,
independent of mid_loop_trim_threshold (which counts messages).
A single tool round can return a multi-KB file listing or JSON payload
that adds hundreds of thousands of tokens in one message — far below the
message-count threshold but well past the model’s context window. When
set, trimming fires as soon as the estimated token count (chars / 4)
exceeds this value. None disables token-based trimming.
Default: None (message-count trimming only). See issue #223.
sanitize_mcp_server_names: boolNormalise hyphens to underscores in MCP server names when advertising
tool definitions and routing tool calls. Some API proxies (e.g. those
that wrap the Anthropic backend) replace hyphens with underscores in
tool names; advertising the sanitised form ensures the model’s tool
calls round-trip back unchanged and routes correctly. Default: true.
Set to false only when every connected MCP server is behind a proxy
that preserves hyphens verbatim.
mcp_allow_insecure_hosts: Vec<String>Hosts (IP or hostname) for which newt may send an MCP OAuth Bearer token
over an UNENCRYPTED (non-https) connection. Empty by default: a stored
Bearer is sent only over https or to loopback (localhost/127.0.0.1/
::1). newt WARNs on every non-loopback unencrypted MCP connection
regardless; an allow-listed host still warns but the token is sent.
This is the explicit opt-out of the secure-by-default transport policy —
see docs/decisions/mcp_transport_security.md.
allow_bang_escape: boolWhether the interactive ! bang-escape is available — typing ! <cmd>
at the prompt runs a host command with the user’s own authority (not the
agent’s OCAP leash). Default: true. Set false for locked-down or
shared deployments where the human at the keyboard should not have an
unconfined host shell-out. The model can never invoke ! either way;
this only governs the human. See docs/decisions/plain_scroller_tui.md.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TuiConfig
impl<'de> Deserialize<'de> for TuiConfig
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>,
impl Eq for TuiConfig
impl StructuralPartialEq for TuiConfig
Auto Trait Implementations§
impl Freeze for TuiConfig
impl RefUnwindSafe for TuiConfig
impl Send for TuiConfig
impl Sync for TuiConfig
impl Unpin for TuiConfig
impl UnsafeUnpin for TuiConfig
impl UnwindSafe for TuiConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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