{"record":{"id":"e85c0a63a01ce8ce","repo":"BoundaryML/baml","slug":"unknown-feedback-field-s-only-title-and-description-are-sent","errorCode":null,"errorMessage":"unknown feedback field(s) {}; only \"title\" and \"description\" are sent (attach files with --files)","messagePattern":"unknown feedback field\\(s\\) (.+?); only \"title\" and \"description\" are sent \\(attach files with --files\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/feedback_command.rs","lineNumber":389,"sourceCode":"            if let Some(value) = flag {\n                obj.insert(key.to_string(), Value::String(value.clone()));\n            }\n        }\n\n        // Whitelist: only the documented fields ship. Anything else in a\n        // piped payload (stray script fields, PostHog-special keys like\n        // `$set`) is rejected rather than silently transmitted. `files` is\n        // deliberately NOT accepted from JSON: a piped payload naming local\n        // paths would let untrusted payload content exfiltrate arbitrary\n        // files. Attachments come only from the `--files` flag (trusted CLI\n        // input).\n        let unknown: Vec<&str> = obj\n            .keys()\n            .map(String::as_str)\n            .filter(|k| !matches!(*k, \"title\" | \"description\"))\n            .collect();\n        if !unknown.is_empty() {\n            return Err(anyhow::anyhow!(\n                \"unknown feedback field(s) {}; only \\\"title\\\" and \\\n                 \\\"description\\\" are sent (attach files with --files)\",\n                unknown.join(\", \")\n            ));\n        }\n\n        // Validate types, not just names: a non-string field would ship to\n        // PostHog while the preview and the local record (which read via\n        // `as_str`) silently dropped it.\n        for key in [\"title\", \"description\"] {\n            if let Some(value) = obj.get(key)\n                && !value.is_string()\n            {\n                return Err(anyhow::anyhow!(\"feedback field \\\"{key}\\\" must be a string\"));\n            }\n        }\n\n        let title = obj.get(\"title\").and_then(Value::as_str).unwrap_or(\"\");","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/feedback_command.rs#L371-L407","documentation":"The `baml feedback` command only transmits \"title\" and \"description\" fields to PostHog; any other keys in a --json payload are rejected so nothing is silently dropped. The error lists the offending key names and suggests attaching files with --files instead.","triggerScenarios":"Running `baml feedback --json '{...}'` where the JSON object contains keys other than title/description (e.g. \"email\", \"logs\", \"body\").","commonSituations":"Reusing a generic feedback JSON template with extra fields; trying to attach log contents inline as a JSON field instead of using --files; typos like \"titel\" or \"Title\" (case mismatch).","solutions":["Remove non-title/description keys from the --json payload, or rename them into the description text.","Use --files to attach logs/screenshots instead of embedding them as JSON fields.","Check key spelling and case: only lowercase \"title\" and \"description\" are accepted."],"exampleFix":"// before\nbaml feedback --json '{\"title\":\"bug\",\"email\":\"me@x.com\"}'\n// after\nbaml feedback --json '{\"title\":\"bug\",\"description\":\"see attached\"}' --files log.txt","handlingStrategy":"validation","validationCode":"# allow only known keys before invoking\njq -e 'keys - [\"title\",\"description\"] | length == 0' payload.json \\\n  && baml feedback --json \"$(cat payload.json)\" \\\n  || echo \"payload has unsupported keys\"","typeGuard":null,"tryCatchPattern":"try {\n  run(`baml feedback --json '${payload}'`);\n} catch (e) {\n  if (String(e).includes('unknown feedback field')) {\n    const clean = (({ title, description }) => ({ title, description }))(JSON.parse(payload));\n    run(`baml feedback --json '${JSON.stringify(clean)}'`);\n  }\n}","preventionTips":["Restrict feedback JSON payloads to title and description keys","Use --files for attachments instead of extra JSON fields","Use exact lowercase key names"],"tags":["cli","validation","json","feedback"],"backgroundTag":"invalid-cli-argument","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}