{"record":{"id":"4bcb10c918f0a244","repo":"opendataloader-project/opendataloader-pdf","slug":"option-hybrid-mode-requires-a-value-supported-v","errorCode":null,"errorMessage":"Option --hybrid-mode requires a value. Supported values: %s","messagePattern":"Option --hybrid-mode requires a value\\. Supported values: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java","lineNumber":669,"sourceCode":"        if (commandLine.hasOption(HYBRID_LONG_OPTION)) {\n            String hybridValue = commandLine.getOptionValue(HYBRID_LONG_OPTION);\n            if (hybridValue == null || hybridValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        String.format(\"Option --hybrid requires a value. Supported values: %s\",\n                                Config.getHybridOptions(\", \")));\n            }\n            String hybrid = hybridValue.trim().toLowerCase(Locale.ROOT);\n            if (!Config.isValidHybrid(hybrid)) {\n                throw new IllegalArgumentException(\n                        String.format(\"Unsupported hybrid backend '%s'. Supported values: %s\",\n                                hybrid, Config.getHybridOptions(\", \")));\n            }\n            config.setHybrid(hybrid);\n        }\n        if (commandLine.hasOption(HYBRID_MODE_LONG_OPTION)) {\n            String modeValue = commandLine.getOptionValue(HYBRID_MODE_LONG_OPTION);\n            if (modeValue == null || modeValue.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        String.format(\"Option --hybrid-mode requires a value. Supported values: %s\",\n                                Config.getHybridModeOptions(\", \")));\n            }\n            String mode = modeValue.trim().toLowerCase(Locale.ROOT);\n            if (!Config.isValidHybridMode(mode)) {\n                throw new IllegalArgumentException(\n                        String.format(\"Unsupported hybrid mode '%s'. Supported values: %s\",\n                                mode, Config.getHybridModeOptions(\", \")));\n            }\n            config.getHybridConfig().setMode(mode);\n        }\n        if (commandLine.hasOption(HYBRID_OCR_LONG_OPTION)) {\n            // Deprecated: OCR settings are now configured on the hybrid server\n            System.err.println(\"Warning: --hybrid-ocr is deprecated. \"\n                    + \"Configure OCR settings on the hybrid server instead (--ocr-lang, --force-ocr).\");\n        }\n        if (commandLine.hasOption(HYBRID_URL_LONG_OPTION)) {\n            String url = commandLine.getOptionValue(HYBRID_URL_LONG_OPTION);","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java#L651-L687","documentation":"Thrown while applying --hybrid-mode when the flag is present but its value is missing, null, or blank. The handler validates null/empty, then lowercases and checks Config.isValidHybridMode against {auto, full}. The mode controls triage: auto does dynamic per-page triage, full sends all pages to the backend. Note: full mode is required to receive enrichments (--enrich-formula, --enrich-picture-description) which run only on the backend.","triggerScenarios":"Run `--hybrid-mode` with no token, `--hybrid-mode \"\"`, or adjacent to another flag that swallows the value.","commonSituations":"Forgetting the value when enabling enrichments (which require `--hybrid-mode full`); truncated script flag.","solutions":["Provide `auto` or `full`.","If using --enrich-formula / --enrich-picture-description, use `--hybrid-mode full`.","Omit the flag for the default (auto)."],"exampleFix":"// before\nopendataloader-pdf doc.pdf --hybrid hancom-ai --hybrid-mode\n// after\nopendataloader-pdf doc.pdf --hybrid hancom-ai --hybrid-mode full","handlingStrategy":"type-guard","validationCode":"String v = commandLine.getOptionValue(\"hybrid-mode\");\nif (v != null && !v.trim().isEmpty() && !Config.isValidHybridMode(v.trim().toLowerCase(Locale.ROOT))) {\n    throw new IllegalArgumentException(\"Bad --hybrid-mode: \" + v);\n}","typeGuard":"boolean isAcceptableHybridMode(String v) {\n    return v != null && !v.trim().isEmpty()\n        && Config.isValidHybridMode(v.trim().toLowerCase(Locale.ROOT));\n}","tryCatchPattern":"try {\n    CLIOptions.applyAllTo(config, cmd);\n} catch (IllegalArgumentException e) {\n    System.err.println(\"Bad CLI args: \" + e.getMessage());\n    System.exit(2);\n}","preventionTips":["Use `full` when you need backend enrichments (--enrich-formula / --enrich-picture-description).","Omit the flag for the default auto triage.","Use --hybrid-mode=value to make a missing value obvious."],"tags":["cli","hybrid-mode","validation","argument-parsing"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}