{"record":{"id":"2c511751da7cca4e","repo":"Hmbown/CodeWhale","slug":"parsing-agent-profile-identity-err","errorCode":null,"errorMessage":"parsing agent profile identity {}: {err}","messagePattern":"parsing agent profile identity (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/profile.rs","lineNumber":289,"sourceCode":"    }\n\n    let mut paths = std::fs::read_dir(dir)\n        .with_context(|| format!(\"reading agent profile dir {}\", dir.display()))?\n        .collect::<std::io::Result<Vec<_>>>()\n        .with_context(|| format!(\"reading agent profile entries in {}\", dir.display()))?\n        .into_iter()\n        .map(|entry| entry.path())\n        .filter(|path| path.extension().and_then(|value| value.to_str()) == Some(\"toml\"))\n        .collect::<Vec<_>>();\n    paths.sort();\n    Ok(paths)\n}\n\nfn load_agent_profile_identity_file(path: &Path) -> Result<AgentProfileIdentity> {\n    let raw = std::fs::read_to_string(path)\n        .with_context(|| format!(\"reading agent profile identity {}\", path.display()))?;\n    let parsed: AgentProfileIdentityToml = toml::from_str(&raw)\n        .map_err(|err| anyhow!(\"parsing agent profile identity {}: {err}\", path.display()))?;\n    let fallback_id = path\n        .file_stem()\n        .and_then(|value| value.to_str())\n        .unwrap_or(\"profile\");\n    let id = first_present([parsed.id.as_deref(), parsed.name.as_deref()])\n        .unwrap_or(fallback_id)\n        .to_string();\n    validate_agent_profile_token(path, \"id/name\", &id)?;\n    Ok(AgentProfileIdentity {\n        id,\n        source: path.to_path_buf(),\n    })\n}\n\nfn load_agent_profile_file(path: &Path) -> Result<AgentProfile> {\n    let raw = std::fs::read_to_string(path)\n        .with_context(|| format!(\"reading agent profile {}\", path.display()))?;\n    let parsed: AgentProfileToml = toml::from_str(&raw)","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/fleet/profile.rs#L271-L307","documentation":"Error \"parsing agent profile identity {}: {err}\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/fleet/profile.rs:289 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}