nanobot configuration and environment-variable index

Corresponding source

Control surfaceSource
Configuration paths and loadingnanobot/config/paths.py, nanobot/config/loader.py::load_config
Environment-variable expansionnanobot/config/loader.py::resolve_config_env_vars
Fields, defaults, and validationnanobot/config/schema.py
Agent/Runner behaviornanobot/agent/loop.py, nanobot/agent/runner.py
Provider, Tool, and Channel readersnanobot/providers/, nanobot/agent/tools/, nanobot/channels/

This page includes only the control points most useful while learning the source and debugging. For complete configuration fields, Providers, and Channels, consult the official configuration documentation and nanobot/config/schema.py.

1. Where configuration comes from

flowchart LR
    F["Configuration file"] --> L["load_config()"]
    L --> P["Pydantic Config"]
    P --> E["resolve_config_env_vars()"]
    E --> R["Provider / AgentLoop / Gateway / Tools"]

Key source:

  • nanobot/config/paths.py: configuration and workspace paths;
  • nanobot/config/loader.py::load_config: reading and parsing;
  • nanobot/config/loader.py::resolve_config_env_vars: recursive replacement of ${VAR} within strings;
  • nanobot/config/schema.py: fields, defaults, aliases, and validation.

Never print a key in logs or notes

Configuration can use "apiKey": "${DEEPSEEK_API_KEY}". Parsing fails if the variable does not exist. During diagnosis, check only whether the variable exists—never output its value.

2. Default Agent behavior

Configuration paths below use their serialized camelCase names.

Configuration pathDefaultControl boundaryPrimary reader
agents.defaults.workspace~/.nanobot/workspaceWork root for Sessions, Memory, Skills, and file ToolsAgentDefaults, runtime assembly
agents.defaults.modelPresetnullWhen set, use the named preset firstnanobot/agent/model_presets.py
agents.defaults.modelanthropic/claude-opus-4-5Default model when no preset is activeProvider snapshot construction
agents.defaults.providerautoExplicit Provider or automatic detectionnanobot/providers/factory.py
agents.defaults.maxTokens8192Maximum output for one generationgeneration settings
agents.defaults.contextWindowTokens200000Context budget and compaction decisionsContext and compaction
agents.defaults.maxToolIterations200Runner model–Tool iteration limitAgentRunner
agents.defaults.maxConcurrentSubagents1Concurrent Subagents in one runtimeSubagent manager
agents.defaults.maxToolResultChars16000Character limit for a Tool result fed back to the modelRunner Tool-result handling
agents.defaults.providerRetryModestandardStandard or persistent retry policyProvider call boundary
agents.defaults.reasoningEffortnullPassed to Providers that support itgeneration settings
agents.defaults.timezoneUTCTimezone semantics for Cron, time prompts, and related behaviorLoop and Cron
agents.defaults.unifiedSessionfalseWhether Channels share a Sessionnanobot/session/keys.py
agents.defaults.disabledSkills[]Skills that must not loadSkillsLoader
agents.defaults.idleCompactAfterMinutes15Idle delay before compaction is allowed; 0 disables itAgentLoop
agents.defaults.maxMessages120Replay-history record limit; 0 still uses the default 120Session and Context
agents.defaults.consolidationRatio0.5Target retained-budget ratio after compactionConsolidator
agents.defaults.dream.enabledtrueWhether to register the periodic Dream taskDream and Gateway
agents.defaults.dream.intervalH2Default Dream intervalDreamConfig.build_schedule()

3. Models and Providers

Configuration areaPurpose
modelPresets.<name>Named combination of model, provider, maxTokens, contextWindowTokens, temperature, and reasoningEffort
providers.<name>.apiKeyProvider credential; may reference ${VAR}
providers.<name>.apiBaseCustom service URL
providers.<name>.extraHeadersAdditional HTTP headers
providers.<name>.extraBodyAdditional request body
providers.<name>.extraQueryAdditional query parameters
providers.openai.apiTypeauto, chat_completions, or responses; currently accepted only for the built-in OpenAI configuration

DeepSeek’s registration facts are in nanobot/providers/registry.py:

Provider name: deepseek
Default credential environment variable: DEEPSEEK_API_KEY

Read the registry for other Providers’ keys and default endpoints; do not infer them from names:

rg -n "ProviderSpec|env_key=|api_base=" nanobot/providers/registry.py

4. Tools, security, and MCP

Configuration pathPurposeNote
tools.restrictToWorkspaceExpresses an application-level workspace restrictionDoes not automatically provide an OS sandbox
tools.exec.*Shell execution, timeout, path, and sandbox settingsTreat nanobot/agent/tools/shell.py::ExecToolConfig as authoritative
tools.file.*File Tool settingsTreat nanobot/agent/tools/filesystem.py::FileToolsConfig as authoritative
tools.web.*Search and fetch settingsTreat nanobot/agent/tools/web.py::WebToolsConfig as authoritative
tools.mcpServers.<name>stdio, SSE, or Streamable HTTP MCP connectionSee below
tools.ssrfWhitelistCIDRs allowed to bypass SSRF blockingAdd only an explicitly trusted range
tools.webuiAllowLocalServiceAccessWhether WebUI Full Access may inspect localhost servicesDo not interpret this as disabling SSRF globally

Core fields for one MCP server:

FieldMeaning
typestdio, sse, or streamableHttp; inferred when omitted
command, args, env, cwdstdio process
url, headersnetwork transport
toolTimeoutTimeout for one MCP Tool; 30 seconds by default
enabledToolsTools that may register; ["*"] means all and [] means none

5. Channels, API, and Gateway

Configuration pathDefaultMeaning
channels.sendProgresstrueWhether to send text progress to Channels
channels.sendToolHintsfalseWhether to send Tool hints
channels.showReasoningtrueWhether to show reasoning when a Channel supports it
channels.extractDocumentTexttrueWhether to pre-extract text from document attachments
channels.sendMaxRetries3Total delivery attempts, including the first
channels.<name>.*Defined by each ChannelChannelsConfig accepts extra fields
api.host / api.port127.0.0.1 / 8900OpenAI-compatible API
api.timeout120.0Timeout in seconds for each API request
gateway.host / gateway.port127.0.0.1 / 18790Gateway and WebUI service
gateway.heartbeat.*See HeartbeatConfigHeartbeat enablement, interval, and retained-message count

6. Most important environment variables for debugging

Environment variableDefault or semanticsReader
DEEPSEEK_API_KEYDeepSeek credentialProvider registry and configuration resolution
NANOBOT_MAX_CONCURRENT_REQUESTSDefaults to 3; <=0 removes the global concurrency limitnanobot/agent/loop.py
NANOBOT_LLM_TIMEOUT_SDefaults to 300 seconds; 0 disables the Runner’s outer LLM wall timeoutnanobot/agent/runner.py
NANOBOT_STREAM_IDLE_TIMEOUT_SDefaults to 90 seconds, maximum 3600; invalid or non-positive values fall back to the defaultnanobot/providers/base.py
NANOBOT_OPENAI_COMPAT_TIMEOUT_SDefaults to 120 seconds; invalid or non-positive values fall back to the defaultnanobot/providers/openai_compat_provider.py
NANOBOT_WORKSPACE_SANDBOX_PROVIDERRecords or selects workspace-sandbox Provider semanticsnanobot/security/workspace_access.py
NANOBOT_WORKSPACE_SANDBOX_ENFORCEDMarks whether the sandbox is enforcedSame as above
NANOBOT_SANDBOX_ENFORCEDCompatibility environment markerSame as above

Three “timeouts” belong to different layers

api.timeout governs an HTTP request, NANOBOT_LLM_TIMEOUT_S governs the Runner’s model-wait boundary, and NANOBOT_STREAM_IDLE_TIMEOUT_S governs an idle pause after streaming has begun. Identify the layer that raised the error before diagnosing it.

7. When configuration appears ineffective

Check in this order:

  1. Which configuration path did the running process actually load?
  2. Does the schema accept the field name, and is its alias correct?
  3. Does ${VAR} exist in the launching process’s environment?
  4. Does modelPreset override the individual model or Provider fields?
  5. Does Gateway require a restart or runtime refresh?
  6. Did you change a global Channel field or one Channel’s override?
  7. Do the active Provider and model in logs match your expectation?

Return to Quick reference.