Expand description
Config file path resolution and TOML persistence helpers.
These helpers are used by command handlers and non-command UI code, so persistence lives outside the command tree.
Every config.toml mutation funnels through mutate_config_document:
the file is edited in place with toml_edit so unrelated comments,
ordering, and formatting survive, and the result is replaced atomically
(same-directory temp file + rename) with owner-only permissions.
Functions§
- config_
toml_ path - migrate_
legacy_ route_ preferences - Commit the legacy effective startup selection with its receipt in the same atomic config write. Settings remains untouched, so an interrupted cleanup or an older binary cannot erase the user’s historical choices. After this marker, Config never consults those legacy route fields again.
- mutate_
config_ document - Parse the TOML document at
path(an absent or empty file yields an empty document), applymutate, and atomically persist the result. - persist_
custom_ provider - persist_
hotbar_ bindings - persist_
mini_ window_ bool_ key - persist_
provider_ model_ key - Persist the model for one exact provider route without rewriting the legacy root DeepSeek fallback used by unrelated providers.
- persist_
root_ bool_ key - persist_
root_ string_ key - persist_
route_ base_ url - Persist the endpoint that
GET /v1/configreports asbase_url. - persist_
status_ items - persist_
subagents_ bool_ key - persist_
subagents_ integer_ key - persist_
table_ bool_ key - persist_
table_ string_ key - persist_
table_ value_ key - persist_
unset_ root_ key - persist_
unset_ table_ key - set_
document_ value - Set the value at
segments(parent tables plus the final key), creating missing intermediate tables. Replacing an existing value keeps its decor, so comments above the key and trailing same-line comments survive. - set_
verified_ provider_ model_ document - unset_
document_ value - Remove the value at
segments. ReturnsOk(true)when an entry was removed; missing keys and missing (or non-table) parents are a no-op.