{"record":{"id":"4cc3abb852e80187","repo":"infiniflow/ragflow","slug":"querit-extras-meta-must-be-a-boolean","errorCode":null,"errorMessage":"Querit extras_meta must be a boolean.","messagePattern":"Querit extras_meta must be a boolean\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/tools/querit.py","lineNumber":384,"sourceCode":"def _normalize_contents_urls(urls: Any) -> Any:\n    if isinstance(urls, str):\n        return [url.strip() for url in urls.split(\",\") if url.strip()]\n    return urls\n\n\ndef _validate_contents_inputs(urls: Any, format: Any, crawl_timeout: Any, extras_meta: Any) -> None:\n    if not isinstance(urls, list) or not 1 <= len(urls) <= 10 or any(not isinstance(url, str) or not url.strip() for url in urls):\n        raise ValueError(\"Querit urls must contain between 1 and 10 non-empty strings.\")\n    for url in urls:\n        parsed = urlparse(url)\n        if parsed.scheme not in {\"http\", \"https\"} or not parsed.netloc:\n            raise ValueError(\"Querit urls must be absolute HTTP or HTTPS URLs.\")\n    if format not in QUERIT_CONTENT_FORMATS:\n        raise ValueError(\"Querit format must be text, markdown, or html.\")\n    if type(crawl_timeout) is not int or not 1 <= crawl_timeout <= 60:\n        raise ValueError(\"Querit crawl_timeout must be an integer from 1 to 60.\")\n    if type(extras_meta) is not bool:\n        raise ValueError(\"Querit extras_meta must be a boolean.\")\n\n\ndef _validate_contents_response(response_data: Any) -> None:\n    if not isinstance(response_data, dict):\n        raise TypeError(\"Querit API response must be a JSON object.\")\n    if \"results\" in response_data and not isinstance(response_data[\"results\"], list):\n        raise TypeError(\"Querit API response field results must be an array.\")\n    if \"statuses\" in response_data and not isinstance(response_data[\"statuses\"], list):\n        raise TypeError(\"Querit API response field statuses must be an array.\")\n\n\ndef _validate_search_inputs(\n    count: Any,\n    chunks_per_doc: Any,\n    time_range: Any,\n    site_include: Any,\n    site_exclude: Any,\n    country_include: Any,","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/tools/querit.py#L366-L402","documentation":"ValueError from _validate_contents_inputs(): the extras_meta flag of the Querit contents tool must be a strict boolean. The check uses type(extras_meta) is not bool, so 1/0, 'true'/'false' strings, and None all fail even though they are truthy/falsy or JSON-ish.","triggerScenarios":"extras_meta=1, extras_meta='true' (form/env string), extras_meta=None (unset optional field), or extras_meta=[True] coming from loosely-typed workflow parameter binding.","commonSituations":"YAML/ENV-configured workflows where booleans arrive as strings; LLM tool-call JSON with \"true\" quoted; Python callers passing flags as 0/1 out of C-style habit.","solutions":["Pass a real boolean: extras_meta=True or extras_meta=False.","Coerce strings in your caller: value in {\"true\", \"1\", \"yes\"} (case-insensitive) maps to True.","Never rely on truthiness — 1 and 0 are explicitly rejected by the strict type check.","Give the field an explicit default of False when building component params programmatically."],"exampleFix":"# before\nextras_meta = \"true\"  # str -> ValueError\n\n# after\nextras_meta = str(value).strip().lower() in {\"true\", \"1\", \"yes\"}","handlingStrategy":"type-guard","validationCode":"def to_bool_strict(v) -> bool:\n    if isinstance(v, bool):\n        return v\n    if isinstance(v, str):\n        return v.strip().lower() in {\"true\", \"1\", \"yes\"}\n    raise ValueError(f\"cannot coerce {v!r} to bool\")","typeGuard":"def is_strict_bool(v) -> bool:\n    return type(v) is bool","tryCatchPattern":"try:\n    querit_contents._invoke(urls=urls, extras_meta=flag)\nexcept ValueError as e:\n    if \"extras_meta\" in str(e):\n        flag = to_bool_strict(flag); querit_contents._invoke(urls=urls, extras_meta=flag)\n    raise","preventionTips":["Parse env/YAML booleans with a strict coercer before passing them on.","Never substitute 1/0 for True/False with Querit parameters.","Default extras_meta to False in generated component configs."],"tags":["validation","input","querit","boolean"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}