refactor: remove AIEOS identity support
- Remove src/identity/ directory (aieos.rs, mod.rs) - Remove IdentityConfig struct and identity field from Config - Remove build_system_prompt_with_identity and load_aieos_from_config functions - Remove AIEOS-related imports from channels/mod.rs - Remove identity module declarations from main.rs and lib.rs - Remove AIEOS tests from config/schema.rs - Keep OpenClaw markdown-based identity as the only supported format This simplifies the codebase by removing unused AIEOS complexity. All 832 tests pass.
This commit is contained in:
parent
03dd9712ca
commit
5476195a7f
8 changed files with 262 additions and 2674 deletions
|
|
@ -56,20 +56,17 @@ pub struct Config {
|
|||
pub identity: IdentityConfig,
|
||||
}
|
||||
|
||||
// ── Identity (AIEOS support) ─────────────────────────────────────
|
||||
// ── Identity (AIEOS / OpenClaw format) ──────────────────────────
|
||||
|
||||
/// Identity configuration — supports multiple identity formats
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct IdentityConfig {
|
||||
/// Identity format: "openclaw" (default, markdown files) or "aieos" (JSON)
|
||||
/// Identity format: "openclaw" (default) or "aieos"
|
||||
#[serde(default = "default_identity_format")]
|
||||
pub format: String,
|
||||
/// Path to AIEOS JSON file (relative to workspace or absolute)
|
||||
/// Only used when format = "aieos"
|
||||
/// Path to AIEOS JSON file (relative to workspace)
|
||||
#[serde(default)]
|
||||
pub aieos_path: Option<String>,
|
||||
/// Inline AIEOS JSON (alternative to `aieos_path`)
|
||||
/// Only used when format = "aieos"
|
||||
/// Inline AIEOS JSON (alternative to file path)
|
||||
#[serde(default)]
|
||||
pub aieos_inline: Option<String>,
|
||||
}
|
||||
|
|
@ -1367,64 +1364,4 @@ default_temperature = 0.7
|
|||
assert!(!parsed.browser.enabled);
|
||||
assert!(parsed.browser.allowed_domains.is_empty());
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════════════════════════
|
||||
// IDENTITY CONFIG TESTS (AIEOS support)
|
||||
// ══════════════════════════════════════════════════════════
|
||||
|
||||
#[test]
|
||||
fn identity_config_default_is_openclaw() {
|
||||
let i = IdentityConfig::default();
|
||||
assert_eq!(i.format, "openclaw");
|
||||
assert!(i.aieos_path.is_none());
|
||||
assert!(i.aieos_inline.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn identity_config_serde_roundtrip() {
|
||||
let i = IdentityConfig {
|
||||
format: "aieos".into(),
|
||||
aieos_path: Some("identity.json".into()),
|
||||
aieos_inline: None,
|
||||
};
|
||||
let toml_str = toml::to_string(&i).unwrap();
|
||||
let parsed: IdentityConfig = toml::from_str(&toml_str).unwrap();
|
||||
assert_eq!(parsed.format, "aieos");
|
||||
assert_eq!(parsed.aieos_path.as_deref(), Some("identity.json"));
|
||||
assert!(parsed.aieos_inline.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn identity_config_with_inline_json() {
|
||||
let i = IdentityConfig {
|
||||
format: "aieos".into(),
|
||||
aieos_path: None,
|
||||
aieos_inline: Some(r#"{"identity":{"names":{"first":"Test"}}}"#.into()),
|
||||
};
|
||||
let toml_str = toml::to_string(&i).unwrap();
|
||||
let parsed: IdentityConfig = toml::from_str(&toml_str).unwrap();
|
||||
assert_eq!(parsed.format, "aieos");
|
||||
assert!(parsed.aieos_inline.is_some());
|
||||
assert!(parsed.aieos_inline.unwrap().contains("Test"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn identity_config_backward_compat_missing_section() {
|
||||
let minimal = r#"
|
||||
workspace_dir = "/tmp/ws"
|
||||
config_path = "/tmp/config.toml"
|
||||
default_temperature = 0.7
|
||||
"#;
|
||||
let parsed: Config = toml::from_str(minimal).unwrap();
|
||||
assert_eq!(parsed.identity.format, "openclaw");
|
||||
assert!(parsed.identity.aieos_path.is_none());
|
||||
assert!(parsed.identity.aieos_inline.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn config_default_has_identity() {
|
||||
let c = Config::default();
|
||||
assert_eq!(c.identity.format, "openclaw");
|
||||
assert!(c.identity.aieos_path.is_none());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue