google-gemini/gemini-cli · error · ValueError

Missing '{section_name}' key: {field_name}

Error message

Missing '{section_name}' key: {field_name}

What it means

Error "Missing '{section_name}' key: {field_name}" thrown in google-gemini/gemini-cli.

Source

Thrown at tools/caretaker-agent/cloudrun/triage-worker/utils/validator.py:18

import re

def _assert_section_schema(
    spec: dict, section_name: str, expected_schema: dict
) -> None:
    """
    Asserts that spec[section_name] is a dict containing all expected
    field names with their required data types.
    """
    section = spec.get(section_name)
    if not isinstance(section, dict):
        raise ValueError(
            f"Missing or invalid object '{section_name}' in workable_spec"
        )

    for field_name, expected_type in expected_schema.items():
        if field_name not in section:
            raise ValueError(f"Missing '{section_name}' key: {field_name}")

        field_value = section[field_name]
        if isinstance(expected_type, list):
            element_type = expected_type[0]
            valid_list = isinstance(field_value, list) and all(
                isinstance(item, element_type) for item in field_value
            )
            if not valid_list:
                raise ValueError(
                    f"Key '{field_name}' in '{section_name}' must be a list of "
                    f"{element_type.__name__}"
                )
        elif not isinstance(field_value, expected_type):
            raise ValueError(
                f"Key '{field_name}' in '{section_name}' must be of type "
                f"{expected_type.__name__}"
            )

View on GitHub (pinned to 5024443c72)

When it happens

Trigger: Thrown at tools/caretaker-agent/cloudrun/triage-worker/utils/validator.py:18 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12). Data as JSON: /api/errors/600ae0194a5e14aa. Report an issue: GitHub.