{"record":{"id":"fe028e417664461b","repo":"Hmbown/CodeWhale","slug":"config-ui-schema","errorCode":null,"errorMessage":"config ui schema","messagePattern":"config ui schema","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config_ui.rs","lineNumber":495,"sourceCode":"            workspace_follow_symlinks: settings.workspace_follow_symlinks,\n            provider_models: settings\n                .provider_models\n                .clone()\n                .unwrap_or_default()\n                .into_iter()\n                .collect(),\n            default_model,\n        },\n        config: ConfigSection {\n            mcp_config_path: app.mcp_config_path.display().to_string(),\n            reasoning_effort,\n            status_items,\n        },\n    })\n}\n\npub fn build_schema() -> Value {\n    let mut schema = serde_json::to_value(schema_for!(ConfigUiDocument)).expect(\"config ui schema\");\n    schema[\"title\"] = Value::String(\"Codewhale Config\".to_string());\n    schema[\"description\"] = Value::String(\n        \"Tune live runtime choices and durable TUI defaults. Provider switching stays in /provider.\"\n            .to_string(),\n    );\n    // Provider switching is asynchronous and owns client preflight, so this\n    // editor shows the route identity only as validation context. `/provider`\n    // remains the sole provider-switch surface.\n    schema[\"$defs\"][\"RuntimeSection\"][\"properties\"][\"provider\"][\"readOnly\"] = Value::Bool(true);\n    schema\n}\n\n#[cfg(feature = \"tui\")]\npub fn run_tui_editor(app: &App, config: &Config) -> Result<ConfigUiDocument> {\n    let document = build_document(app, config)?;\n    let value = SchemaUI::new(serde_json::to_value(document.clone())?)\n        .with_schema(build_schema())\n        .with_title(\"Codewhale Config\")","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/config_ui.rs#L477-L513","documentation":"build_schema() converts the schema_for!(ConfigUiDocument) output to a serde_json::Value and unwraps. A schemars-generated schema of a plain struct is expected to serialize cleanly; failure indicates an incompatible schemars/serde_json combination or an exotic type in the document — a build/configuration bug.","triggerScenarios":"Thrown at crates/tui/src/config_ui.rs:495 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check schemars/serde_json version compatibility in Cargo.lock","Remove non-representable types from ConfigUiDocument or adjust its schema attributes"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}