FoundationAgents/MetaGPT · error · ValueError

Dataset {task_name} not found in config file. Available data

Error message

Dataset {task_name} not found in config file. Available datasets: {data_config['datasets'].keys()}

What it means

Raised by get_exp_pool_path when task_name is not a key in data_config['datasets']. The helper resolves the path to <datasets_dir>/<dataset>/<pool_name>.json (default analysis_pool.json) and cannot do so for an unregistered task.

Source

Thrown at metagpt/ext/sela/utils.py:50

    # _logger.remove()
    _logger.level("MCTS", color="<green>", no=25)
    # _logger.add(sys.stderr, level=print_level)
    _logger.add(Path(DATA_CONFIG["work_dir"]) / DATA_CONFIG["role_dir"] / f"{log_name}.txt", level=logfile_level)
    _logger.propagate = False
    return _logger


mcts_logger = get_mcts_logger()


def get_exp_pool_path(task_name, data_config, pool_name="analysis_pool"):
    datasets_dir = data_config["datasets_dir"]
    if task_name in data_config["datasets"]:
        dataset = data_config["datasets"][task_name]
        data_path = os.path.join(datasets_dir, dataset["dataset"])
    else:
        raise ValueError(
            f"Dataset {task_name} not found in config file. Available datasets: {data_config['datasets'].keys()}"
        )
    exp_pool_path = os.path.join(data_path, f"{pool_name}.json")
    if not os.path.exists(exp_pool_path):
        return None
    return exp_pool_path


def change_plan(role, plan):
    print(f"Change next plan to: {plan}")
    tasks = role.planner.plan.tasks
    finished = True
    for i, task in enumerate(tasks):
        if not task.code:
            finished = False
            break
    if not finished:
        tasks[i].plan = plan

View on GitHub (pinned to 11cdf466d0)

Solutions

  1. Use a task name present in the 'Available datasets' list printed in the error
  2. Register the dataset in the datasets config before running the search
  3. Confirm datasets_dir points at the directory containing your dataset folders
Defensive patterns

Strategy: validation

Validate before calling

if task_name not in data_config["datasets"]:
    raise KeyError(f"{task_name} not in datasets config")

Type guard

def is_registered_dataset(task_name: str, data_config: dict) -> bool:
    return task_name in data_config.get("datasets", {})

Prevention

When it happens

Trigger: Calling get_exp_pool_path with a task that has no entry in the datasets yaml — same class of mismatch as the dataset.py lookups, but hit earlier during MCTS setup when locating the experience pool.

Common situations: --task typo; custom dataset not registered in datasets.yaml; config loaded from the wrong working directory.

Related errors


AI-assisted analysis of FoundationAgents/MetaGPT@11cdf466d0 (2026-08-14). Data as JSON: /api/errors/3fcd0448beeb2fd6. Report an issue: GitHub.