Skip to main content

AI fix: language mismatch

typehttps://docs.frem.sh/reference/api/errors/autofix-language-mismatch
HTTP status422 Unprocessable Content

What it means

Returned by POST /orgs/{org}/code-security/sast/findings/{id}/autofix (AI fixes for SAST findings). No fix was requested and no AI model was called.

Since 2026-10-14 the same refusal is answered with the type ai-fix-language-mismatch from POST /orgs/{org}/code-security/sast/findings/{id}/ai-fix. The paths above are deprecated and keep answering autofix-language-mismatch until 2027-10-15. Branch on either type.

Example detail message returned with this error:

  • The finding is in a file whose language does not match the rule, so AI fix does not propose a fix.

The response also carries "reason": "language_mismatch".

What to do

Fix the finding by hand.

Response shape

All fremforge API errors are RFC 9457 problem+json:

{
  "type": "https://docs.frem.sh/reference/api/errors/autofix-language-mismatch",
  "title": "Unprocessable Content",
  "status": 422,
  "detail": "...",
  "reason": "language_mismatch"
}

Branch on type, not on title or detail - those are human-readable and may be reworded.