Expand description
~/.rpi/agent/settings.json — saved user defaults. Mirrors the slice of
pi’s Settings interface (packages/coding-agent/src/core/settings-manager.ts)
that rpi honors: defaultProvider / defaultModel / defaultThinkingLevel
(consumed by provider::resolve as pi’s findInitialModel step 3 — the
saved default, when authed, wins over the built-in fallback), theme,
packages, and configurable resource directories.
pi’s Settings carries ~40 fields; rpi reads the fields it uses and drops the
rest (serde default ignores unknown fields), so a copied pi settings.json
parses clean.
Structs§
- Settings
- The honored subset of pi’s
Settings. Unknown fields are ignored.
Functions§
- load_
project_ settings - Load project-local settings in precedence order:
.rpi/settings.json, then legacy.pi/settings.json. Both files may contribute additional resource paths; the preferred.rpifile is returned first so its paths register before legacy Pi paths. Malformed or unreadable optional project settings are ignored, matching the best-effort behavior of resource-dir discovery; global settings remain available throughload_settings. - load_
project_ settings_ with_ paths - Load project settings together with their source paths. The path is kept
so callers can preserve
.rpibefore.piordering even when only one of the two files exists. - load_
settings - Load
~/.rpi/agent/settings.json. Missing file ⇒Settings::default()(not an error). Malformed JSON ⇒ConfigError::Json. Tolerates//line comments (a copied pi settings.json may contain them). - resolve_
configured_ paths - Resolve a configured path relative to its settings owner. Absolute paths are preserved; empty entries are ignored.
- save_
settings - Persist the honored settings back to
~/.rpi/agent/settings.json. Unknown pi fields (whichSettingsdoesn’t model) are preserved: the current file is read as raw JSON, the known fields are overlaid, and the merged object is written — so a copied pisettings.jsonsurvives edits without losing pi-only keys. Missing file ⇒ a fresh object. Best-effort errors are returned as strings for the caller to surface.