Skip to main content

Module config

Module config 

Source

Structs§

AuthConfig
Auth configuration parsed from auth.* keys. Controls whether this client resolves provider tokens from the local auth.json (default) or from a remote credential broker. See task #157 / auth::credential_source.
BridgeConfig
Bridge daemon configuration parsed from bridge.* keys.
ContextManagementConfig
Task-aware soft context bands, parsed from context_management.* keys.
DaemonConfig
Daemon lifetime knobs (daemon.* keys). Config-file fallbacks; the matching SYNAPS_DAEMON_* env vars still WIN over these when set.
EventsConfig
Runtime event routing configuration parsed from events.* keys.
MemoryBackendConfig
MemoryConfig
Continuous-memory settings surface (Task A2, spec §12). Every field is fail-closed: unknown or invalid values warn and keep the compiled default.
ServerConfig
Server security configuration parsed from server.* keys.
StartupConfig
Startup / first-turn behaviour (startup.* keys). Boot-time only — these take effect at the next launch, never mid-session.
SubagentLimits
Subagent fan-out limits (subagent.* keys). They apply to the whole delegation tree of one session: workers started by workers count against the same limits as workers started by the foreground. A prompt manifest with an explicit delegation policy sets its own concurrency and total limits; max_depth applies either way.
SynapsConfig
Parsed configuration from the config file.
TurnBudgetOverrides
Typed per-role turn-budget overrides (Task 23, spec §8.1). Every field is optional: unset fields keep the role’s compiled default. Values are parsed from turn_budget.<role>.<field> config keys.
TurnBudgetsConfig
Per-role turn budgets (foreground, autonomous/watcher, worker).

Enums§

ActivationConfirm
tools.activation_confirm — host policy for model-initiated activate_tools (progressive tool disclosure).
CacheKeepWarm
Prompt-cache keep-warm policy (cache_keepwarm, task #444). See docs/specs/cache-ttl-spec.md §7.
CacheTtl
Prompt-cache TTL strategy for Anthropic requests.
ContextManagementMode
Automatic context management is opt-in; independent of compaction disclosure.
MemoryBackendKind
Host-owned note storage selection, independent of continuous-memory consent.
ThemeTransitionMode
Animated theme-transition mode, parsed from theme_transition:

Constants§

DEFAULT_AUTO_TURN_CAP
Default for events.auto_turn_cap — mirrors engine::reactor::AUTO_TURN_CAP.
DEFAULT_CACHE_KEEPWARM_AUTO_MAX_HOURS
Default for cache_keepwarm_auto_max_hours: the longest an auto idle period may run. Without it the ski-rental bound alone lets a 0.05× cache-read model (Opus 5.5, Sonnet 5.5) ping ~39 times over ~36h and a 0.025× model (Fable 5.1, Mythos 5.1) ~79 times over ~72h under a 1h TTL, keeping an abandoned session unparked for days. 24h: a user who steps away for a working day or overnight still comes back to a warm cache; a session left over a weekend parks. (Owner decision, task #444.)
DEFAULT_IDENTITY
FAMILY_CONFIG_KEYS
Every key accepted by the namespaced family parsers that is NOT in KNOWN_CONFIG_KEYS (shell.*, events.*, turn_budget.*, memory.*, server.*, bridge.*, auth.*). Open-ended families whose suffix is user-chosen are listed as prefix.*. Keep this in sync when a parser learns a key: the /settings coverage test requires each entry to have a settings row or an explicit exclusion.
KNOWN_CONFIG_KEYS
Known top-level config keys — used for unknown-key warnings + did-you-mean. Public so the /settings coverage test can require a settings row (or an explicit exclusion) for every key here.
MAX_CACHE_KEEPWARM_HOURS
Upper bound for the <N>h form of cache_keepwarm. The ski-rental bound already caps an abandoned session’s spend at about one prefix rewrite; the hour cap is an extra, user-chosen wall on top of it.

Functions§

add_favorite_model
Add a favorite model id (provider/model) to config, preserving sort/dedup.
base_dir
config_content_problems
Every problem the parser reports for content: the warnings surfaced at startup plus the stderr-only diagnostics of the shell.*, events.*, turn_budget.* and memory.* families. Pure — prints nothing and touches no process state.
get_active_config_dir
Gets the absolute directory for the current profile (or root if default).
get_identity
Returns the configured identity string for the system prompt preamble. Falls back to DEFAULT_IDENTITY (the SynapsCLI identity above) if not set in config. Initialized by load_config() — safe to call anytime after boot.
get_profile
Returns the active profile name, if any. Reads from SYNAPS_PROFILE environment variable if not already set programmatically.
get_provider_keys
Provider API keys parsed from provider.<name> = ... lines in config. Empty if load_config() hasn’t been called. The registry falls back to env vars, so e.g. GROQ_API_KEY works even with an empty map.
is_favorite_model
Return whether a model id is marked as favorite.
is_secret_env
Whether an env pair must never reach the daemon or disk: a secret key name OR a value carrying credentials (see is_secret_env_value).
is_secret_env_value
Whether an env VALUE carries a credential regardless of its key name: any URL with userinfo (scheme://user:pass@host, scheme://key@host), anywhere in the value — DATABASE_URL, HTTPS_PROXY, a Sentry DSN or a JDBC option string all qualify. The key-name denylist alone missed these, so their credentials reached the daemon and the session files on disk. A username-only URL (ssh://git@host/…) is treated as a secret too: rare in an environment, and failing safe beats a guess.
is_secret_key
Whether a key matches the secret denylist (case-insensitive). Used by the journal save path to ensure secret values never reach disk, and by the client env capture to strip secrets before Hello.
load_config
Parse the config file at ~/.synaps-cli/config (or profile variant). Returns default config if file doesn’t exist or can’t be read.
load_config_from_str
Parse config from a raw string — useful for tests and embedded harnesses. Does NOT write to PROVIDER_KEYS or IDENTITY OnceLocks.
parse_auto_turn_cap
Parse a events.auto_turn_cap value. Returns None on garbage.
read_config_value
Read a single config value by exact key from the active config file.
remove_favorite_model
Remove a favorite model id (provider/model) from config.
resolve_read_path
Resolves a path for reading. Checks the profile folder first, then falls back to the default folder.
resolve_read_path_extended
Resolves a path for reading with an extended arbitrary path tree.
resolve_system_prompt
Resolve the system prompt from CLI flag, config file, or default. Priority: explicit value > ~/.synaps-cli/system.md > built-in default.
resolve_write_path
Resolves a path for writing. Unconditionally writes to the profile folder if a profile is active.
set_profile
Sets the active profile name. Must be called before any get_profile() call (i.e., before config resolution begins). Uses OnceLock — first write wins, subsequent calls are no-ops. No env var mutation (unsafe under tokio).
validate_config_edit
Check a key = value edit before it is written (the /settings modal).
write_config_value
Write a single key = value pair to ~/.synaps-cli/config (or profile config). Replaces the first existing line that matches the key, or appends if absent. Preserves comments and unknown keys. Writes atomically via temp file + rename.