{"record":{"id":"0358f7b98d74cf17","repo":"FoundationAgents/MetaGPT","slug":"expecting-delimiter-0358f7","errorCode":null,"errorMessage":"Expecting ',' delimiter","messagePattern":"Expecting ',' delimiter","errorType":"exception","errorClass":"JSONDecodeError","httpStatus":null,"severity":"error","filePath":"metagpt/utils/custom_decoder.py","lineNumber":180,"sourceCode":"\n        try:\n            value, end = scan_once(s, end)\n        except StopIteration as err:\n            raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n        pairs_append((key, value))\n        try:\n            nextchar = s[end]\n            if nextchar in _ws:\n                end = _w(s, end + 1).end()\n                nextchar = s[end]\n        except IndexError:\n            nextchar = \"\"\n        end += 1\n\n        if nextchar == \"}\":\n            break\n        elif nextchar != \",\":\n            raise JSONDecodeError(\"Expecting ',' delimiter\", s, end - 1)\n        end = _w(s, end).end()\n        nextchar = s[end : end + 1]\n        end += 1\n        if nextchar != '\"':\n            raise JSONDecodeError(\"Expecting property name enclosed in double quotes\", s, end - 1)\n    if object_pairs_hook is not None:\n        result = object_pairs_hook(pairs)\n        return result, end\n    pairs = dict(pairs)\n    if object_hook is not None:\n        pairs = object_hook(pairs)\n    return pairs, end\n\n\ndef py_scanstring(s, end, strict=True, _b=BACKSLASH, _m=STRINGCHUNK.match, delimiter='\"'):\n    \"\"\"Scan the string s for a JSON string.\n\n    Args:","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/FoundationAgents/MetaGPT/blob/11cdf466d042aece04fc6cfd13b28e1a70341b1f/metagpt/utils/custom_decoder.py#L162-L198","documentation":"Raised by the custom decoder's object scanner: after successfully reading a key/value pair, the next non-whitespace character was neither '}' (end of object) nor ',' (pair separator). It is the standard 'missing comma between object members' JSON syntax error, surfaced from MetaGPT's tolerant decoder.","triggerScenarios":"Decoding an object like {\"a\":1 \"b\":2} (missing comma), {\"a\":1;\"b\":2} (semicolon separator), or text where a quoted string value swallowed the comma because of an unescaped inner quote.","commonSituations":"LLM-generated JSON with omitted commas, hand-edited config strings, or nested quotes inside string values that terminate the string early and leave a stray token before the comma.","solutions":["Go to the column given in the error (end - 1) and add the missing ',' between the two members.","Escape inner double quotes inside string values (\\\") so the comma is not consumed as part of the value.","Validate strings with a linter/json.parse before passing them to the decoder.","For LLM output, re-request or run through a JSON repair step before decoding."],"exampleFix":"// before\n'{\"name\": \"a\" \"value\": 1}' -> JSONDecodeError: Expecting ',' delimiter\n\n// after\n'{\"name\": \"a\", \"value\": 1}'","handlingStrategy":"try-catch","validationCode":"import json\ndef object_members_comma_separated(text: str) -> bool:\n    try:\n        json.loads(text)\n        return True\n    except json.JSONDecodeError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    obj = decoder.decode(s)\nexcept json.JSONDecodeError as e:\n    if e.msg == \"Expecting ',' delimiter\":\n        s2 = s[:e.pos] + ',' + s[e.pos:]  # targeted repair candidate\n        obj = decoder.decode(s2)","preventionTips":["Use a JSON linter/IDE validation on hand-edited strings.","Escape inner double quotes inside string values.","Generate JSON with json.dumps rather than templates."],"tags":["json","parsing","syntax"],"backgroundTag":null,"analyzedSha":"11cdf466d042aece04fc6cfd13b28e1a70341b1f","analyzedAt":"2026-08-14T23:20:02.994Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}