Skip to main content

Module settings

Module settings 

Source
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) and theme.

pi’s Settings carries ~40 fields; rpi reads the 4 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_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).
save_settings
Persist the honored settings back to ~/.rpi/agent/settings.json. Unknown pi fields (which Settings doesn’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 pi settings.json survives edits without losing pi-only keys. Missing file ⇒ a fresh object. Best-effort errors are returned as strings for the caller to surface.