| 1928 | |
| 1929 | #[test] |
| 1930 | fn test_agent_identity_roundtrip() { |
| 1931 | let config = GlobalConfig { |
| 1932 | agent_identity: Some("fred+opencode".to_string()), |
| 1933 | ..GlobalConfig::default() |
| 1934 | }; |
| 1935 | |
| 1936 | let toml_str = toml::to_string_pretty(&config).unwrap(); |
| 1937 | assert!(toml_str.contains("agent_identity = \"fred+opencode\"")); |
| 1938 | |
| 1939 | let parsed: GlobalConfig = toml::from_str(&toml_str).unwrap(); |
| 1940 | assert_eq!(parsed.agent_identity.as_deref(), Some("fred+opencode")); |
| 1941 | } |
| 1942 | |
| 1943 | #[test] |
| 1944 | fn test_agent_identity_absent_in_legacy_configs() { |