{"record":{"id":"d59a916f2aec6f56","repo":"Hmbown/CodeWhale","slug":"agent-profile-provider-must-be-a-simple-provide","errorCode":null,"errorMessage":"agent profile {} provider must be a simple provider id","messagePattern":"agent profile (.+?) provider must be a simple provider id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/profile.rs","lineNumber":503,"sourceCode":"        );\n    }\n    Ok(())\n}\n\n/// Validate an explicit `provider` field as a safe provider id (#4093).\n///\n/// Built-in providers are accepted by the runtime vocabulary, and user-named\n/// OpenAI-compatible custom providers are accepted as simple tokens so the\n/// launch path can resolve `[providers.<id>]` from the session config (#3965).\n/// This field remains the ONLY place a profile's provider is established:\n/// callers never infer it from `model` (EPIC #2608).\nfn validate_agent_profile_provider(path: &Path, value: &str) -> Result<()> {\n    let trimmed = value.trim();\n    if trimmed.is_empty() {\n        bail!(\"agent profile {} provider cannot be empty\", path.display());\n    }\n    if trimmed != value || !trimmed.chars().all(is_agent_profile_token_char) {\n        bail!(\n            \"agent profile {} provider must be a simple provider id\",\n            path.display()\n        );\n    }\n    Ok(())\n}\n\nfn normalize_agent_profile_reasoning_effort(\n    path: &Path,\n    value: Option<&str>,\n) -> Result<Option<String>> {\n    let Some(value) = non_empty_trimmed(value) else {\n        return Ok(None);\n    };\n    if matches!(\n        value.to_ascii_lowercase().as_str(),\n        \"inherit\" | \"parent\" | \"same\" | \"current\" | \"default\" | \"unset\"\n    ) {","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/fleet/profile.rs#L485-L521","documentation":"validate_agent_profile_provider requires the provider to be a simple token (ASCII alphanumerics plus '-', '_', '.'). It must match a built-in provider id or a user-named OpenAI-compatible custom provider defined as [providers.<id>] in the session config (#3965, #4093). The loader trims the value before validating, so this fires on invalid characters inside the id.","triggerScenarios":"provider = \"openai compatible\" (inner space), provider = \"openai/gpt-4o\" (a provider/model id put in the provider field), provider = \"My Provider\", or any value containing ':', '/', spaces, or quotes.","commonSituations":"Pasting a full model string or a URL into the provider field; using a human label instead of the config key; typos introducing punctuation into a custom provider id.","solutions":["Use the bare provider id: provider = \"openai\" or the exact key of your [providers.<id>] table","If you meant a model, move it to the model field - provider is never inferred from or written with model ids","Check [providers.<id>] in the session config and use that same id verbatim"],"exampleFix":"# before\nprovider = \"openai/gpt-4o\"\n\n# after\nprovider = \"openai\"\nmodel = \"gpt-4o\"","handlingStrategy":"validation","validationCode":"fn is_valid_provider_id(value: &str) -> bool {\n    let t = value.trim();\n    !t.is_empty()\n        && t == value\n        && t.chars().all(|c| c.is_ascii_alphanumeric() || matches!(c, '-' | '_' | '.'))\n}\n// also check the id exists in session config: [providers.<id>] or a built-in name","typeGuard":"fn is_valid_provider(value: &str) -> bool {\n    let t = value.trim();\n    !t.is_empty()\n        && t.chars().all(|c| c.is_ascii_alphanumeric() || matches!(c, '-' | '_' | '.'))\n}","tryCatchPattern":"match load_agent_profile_file(&path) {\n    Ok(p) => Ok(p),\n    Err(err) if err.to_string().contains(\"simple provider id\") => {\n        Err(anyhow!(\"profile {path:?}: provider must be a bare id like 'openai' or a [providers.<id>] key\"))\n    }\n    Err(err) => Err(err),\n}","preventionTips":["Use the exact [providers.<id>] key from session config as the provider value","Never put model ids, URLs or display labels in the provider field","Validate provider ids against the configured provider table before launching profiles"],"tags":["agent-profile","provider","toml","validation","identifier"],"backgroundTag":"invalid-identifier-format","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}