rho-coding-agent 0.27.1

A lightweight agent harness inspired by Pi
Documentation
use super::Config;

#[test]
fn saves_config_atomically_and_round_trips() {
    let dir = tempfile::tempdir().unwrap();
    let path = dir.path().join("config.toml");
    let config = Config {
        model: "round-trip-model".into(),
        ..Config::default()
    };

    config.save(Some(path.clone())).unwrap();
    let loaded = Config::load(Some(path.clone())).unwrap();

    assert_eq!(loaded.model, "round-trip-model");
    let temporary_files = std::fs::read_dir(dir.path())
        .unwrap()
        .filter_map(Result::ok)
        .filter(|entry| entry.file_name().to_string_lossy().ends_with(".tmp"))
        .count();
    assert_eq!(temporary_files, 0);
}