{"record":{"id":"b5b32f46312d92f2","repo":"infiniflow/ragflow","slug":"codeexec-reserved-output-name-is-not-allowed-nam","errorCode":null,"errorMessage":"CodeExec reserved output name is not allowed: {name}","messagePattern":"CodeExec reserved output name is not allowed: (.+?)","errorType":"validation","errorClass":"ContractError","httpStatus":null,"severity":"error","filePath":"agent/tools/code_exec.py","lineNumber":59,"sourceCode":"        \"_ERROR\",\n        \"_ARTIFACTS\",\n        \"_ATTACHMENT_CONTENT\",\n        \"raw_result\",\n        \"_created_time\",\n        \"_elapsed_time\",\n    }\n)\n\n\nclass ContractError(ValueError):\n    pass\n\n\ndef _validate_business_output_name(name: str) -> None:\n    if not name or not name.strip():\n        raise ContractError(\"CodeExec business output name must not be empty\")\n    if name in SYSTEM_OUTPUT_KEYS:\n        raise ContractError(f\"CodeExec reserved output name is not allowed: {name}\")\n    if \".\" in name:\n        raise ContractError(f\"CodeExec business output name must not contain '.': {name}\")\n\n\ndef select_business_output(outputs: Mapping[str, object]) -> tuple[str, object]:\n    if len(outputs) == 1:\n        only_name, only_meta = next(iter(outputs.items()))\n        _validate_business_output_name(only_name)\n        return only_name, only_meta\n\n    business_outputs = [(name, meta) for name, meta in outputs.items() if name not in SYSTEM_OUTPUT_KEYS]\n    if len(business_outputs) != 1:\n        raise ContractError(f\"CodeExec contract must contain exactly one business output, got {len(business_outputs)}\")\n    _validate_business_output_name(business_outputs[0][0])\n    return business_outputs[0]\n\n\ndef normalize_output_value(value):","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/tools/code_exec.py#L41-L77","documentation":"Error \"CodeExec reserved output name is not allowed: {name}\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at agent/tools/code_exec.py:59 when the library encounters an invalid state.","commonSituations":"The CodeExec contract reuses a reserved output name such as an internal stream or status field; renaming the business output prevents this error.","solutions":["Rename the output; reserved names are not allowed for business outputs.","Pick a descriptive name that does not collide with CodeExec reserved fields."],"exampleFix":"# rename reserved output 'stdout' to 'result'\noutputs = [{'name': 'result', 'type': 'String'}]","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}