{"record":{"id":"20d97bcb55149eab","repo":"abhigyanpatwari/GitNexus","slug":"mode-config-not-found-mode-file","errorCode":null,"errorMessage":"Mode config not found: {mode_file}","messagePattern":"Mode config not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"eval/run_eval.py","lineNumber":104,"sourceCode":"    result = {}\n    for config in configs:\n        for key, value in config.items():\n            if key in result and isinstance(result[key], dict) and isinstance(value, dict):\n                result[key] = merge_configs(result[key], value)\n            else:\n                result[key] = value\n    return result\n\n\ndef build_config(model_name: str, mode_name: str) -> dict:\n    \"\"\"Build a complete config from model + mode YAML files.\"\"\"\n    model_file = MODELS_DIR / f\"{model_name}.yaml\"\n    mode_file = MODES_DIR / f\"{mode_name}.yaml\"\n\n    if not model_file.exists():\n        raise FileNotFoundError(f\"Model config not found: {model_file}\")\n    if not mode_file.exists():\n        raise FileNotFoundError(f\"Mode config not found: {mode_file}\")\n\n    model_config = load_yaml_config(model_file)\n    mode_config = load_yaml_config(mode_file)\n\n    return merge_configs(mode_config, model_config)\n\n\ndef load_instances(subset: str, split: str, slice_spec: str = \"\", filter_spec: str = \"\") -> list[dict]:\n    \"\"\"Load SWE-bench instances.\"\"\"\n    from datasets import load_dataset\n    import re\n\n    dataset_path = DATASET_MAPPING.get(subset, subset)\n    logger.info(f\"Loading dataset: {dataset_path}, split: {split}\")\n    instances = list(load_dataset(dataset_path, split=split))\n\n    if filter_spec:\n        instances = [i for i in instances if re.match(filter_spec, i[\"instance_id\"])]","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/run_eval.py#L86-L122","documentation":"Thrown by build_config() in eval/run_eval.py: it looks for eval/configs/modes/<mode_name>.yaml (MODES_DIR) and raises FileNotFoundError if it does not exist. AVAILABLE_MODES is computed by globbing that directory at import; the error message gives the resolved missing path.","triggerScenarios":"Calling run_eval with --mode <name> where <name>.yaml is absent from eval/configs/modes/. Examples: typo 'workfow' vs 'workflow'; a mode yaml never authored; running from a different cwd so MODES_DIR resolves elsewhere.","commonSituations":"Mode-name typo; new mode not yet added as a yaml; relative path resolution off because of cwd; case mismatch in the mode name.","solutions":["List available modes: `ls eval/configs/modes/` (or print AVAILABLE_MODES).","Create eval/configs/modes/<mode_name>.yaml with the mode's settings (agent, environment, max iterations, etc.).","Fix the typo / case on the --mode argument to match a filename stem exactly.","Run from the eval/ directory or ensure CONFIGS_DIR points to the right place."],"exampleFix":"# before\npython run_eval.py --model claude-sonnet --mode workfow\n# FileNotFoundError: Mode config not found: eval/configs/modes/workfow.yaml\n\n# after\npython run_eval.py --model claude-sonnet --mode workflow","handlingStrategy":"validation","validationCode":"from pathlib import Path\nMODES_DIR = Path(__file__).parent / 'configs' / 'modes'\ndef resolve_mode(name: str) -> Path:\n    p = (MODES_DIR / f'{name}.yaml')\n    if not p.exists():\n        avail = sorted(x.stem for x in MODES_DIR.glob('*.yaml'))\n        raise SystemExit(f'Unknown mode {name!r}. Available: {avail}')\n    return p","typeGuard":"def mode_config_exists(name: str) -> bool:\n    return (MODES_DIR / f'{name}.yaml').exists()","tryCatchPattern":"try:\n    cfg = build_config(model_name, mode_name)\nexcept FileNotFoundError as e:\n    if 'Mode config' in str(e):\n        print('available:', AVAILABLE_MODES); raise\n    raise","preventionTips":["Print AVAILABLE_MODES in --help.","Validate --mode against the directory listing at CLI parse time.","Run from the eval/ directory so CONFIGS_DIR resolves correctly."],"tags":["eval","configuration","yaml","cli"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}