Config Manager Tool

The agent can read, update, validate, and restore its own configuration file.

Tool Name

manage_config

Actions

read

Returns the full config.toml content with sensitive fields redacted:

toml
api_key = "***REDACTED***"
bot_token = "***REDACTED***"
password = "***REDACTED***"

get

Read a specific TOML key path:

text
action: "get"
key: "provider.models.primary"
# Returns: "gpt-4o"

set

Update a specific key with a new value (TOML literal format):

text
action: "set"
key: "state.working_memory_cap"
value: "100"

Before writing:

  1. Creates backup (3-deep ring rotation: .bak.bak.1.bak.2)
  2. Validates the new config (TOML syntax + full deserialization)
  3. Sets file permissions to 0600 (owner-only) on Unix

restore

Rollback to the most recent backup file.

Last Known Good
After every successful LLM call, the current config is stamped as .toml.lastgood. This is the first file tried during recovery.

Backup Priority

  1. config.toml.lastgood — proven working config
  2. config.toml.bak — most recent backup
  3. config.toml.bak.1
  4. config.toml.bak.2