Repository: UKGovernmentBEIS/inspect_ai
Issue: Gemini is Potentially Incompatible with ChatMessageSystem
Root cause: Interface Contract Mismatch

When using `google/gemini-2.0-flash`, an eval that worked fine with another model failed. Luckily, the (shortened) stack trace was helpful:

```python
│ │ /opt/homebrew/Caskroom/miniconda/base/lib/python3.12/site-packages/inspect_ai/_eval/task/run.py:328 in task_run      │                                                          
│ │ /opt/homebrew/Caskroom/miniconda/base/lib/python3.12/site-packages/inspect_ai/model/_model.py:264 in generate        │                                                          │
│ │                                                                                                                      │                                                          │
│ │ /opt/homebrew/Caskroom/miniconda/base/lib/python3.12/site-packages/inspect_ai/model/_model.py:449 in _generate       │                                                          ----              
│ │ prepend_system_messages                                                                                              │                                                          │
│ │                                                                                                                      │                                                          │
│ │ /opt/homebrew/Caskroom/miniconda/base/lib/python3.12/site-packages/proto/message.py:734 in __init__                  │                                                          │
│ │                                                                                                                      │                                                          │
│ │   731 │   │   │   │   params[key] = pb_value                                                                         │                                                          │
│ │   732 │   │                                                                                                          │                                                          │
│ │   733 │   │   # Create the internal protocol buffer.                                                                 │                                                          │
│ │ ❱ 734 │   │   super().__setattr__("_pb", self._meta.pb(**params))                                                    │                                                          │
│ │   735 │                                                                                                              │                                                          │
│ │   736 │   def _get_pb_type_from_key(self, key):                                                                      │                                                          │
│ │   737 │   │   """Given a key, return the corresponding pb_type. 
```

Changing a `ChatMessageSystem` to `ChatMessageUser` fixed the issue. Maybe a minimal replication would be just passing any system message to this model?

```bash
> pip freeze
google-generativeai==0.8.4
inspect_ai==0.3.63
```

So for flash perhaps we need to convert system to user messages (we do that for several other providers)

We do already convert system messages to user messages within the Google provider so I'm not sure how this is happening! Here is my attempt at a minimal repro:

```python
@task
def hello_world():
    return Task(
        dataset=[
            Sample(
                input="Just reply with Hello World",
                target="Hello World",
            )
        ],
        solver=[
            system_message("Please be helpful"),
            generate(),
        ],
        scorer=exact(),
    )

```

What is your minimal repro for this?


In the dataset, I used

```python
Sample(
        input=[
            ChatMessageSystem(content=[ContentText(text=...)]),
        ],
        target=...,
        id=...
)
```

Thanks! Very helpful. Fixed here: https://github.com/UKGovernmentBEIS/inspect_ai/pull/1342