Repository: UKGovernmentBEIS/inspect_ai
Issue: [bug] Subtask which returns `None` crashes viewer
Root cause: Validation Gap

## Steps to reproduce
* Code:
```python
from inspect_ai import Task, task
from inspect_ai.dataset import MemoryDataset, Sample
from inspect_ai.solver import Generate, Solver, TaskState, fork, solver
from inspect_ai.util import subtask

@subtask
async def mysubtask(id: str) -> None:
    return None

@solver
def subtask_solver() -> Solver:
    async def solve(state: TaskState, generate: Generate):
        await mysubtask(id="my_subtask")
        return state

    return solve

@task
def mytask():
    return Task(
        dataset=MemoryDataset([Sample(input="")]),
        plan=[
            subtask_solver(),
        ],
    )
```
* Run the task
* Start or refresh the inspect viewer

## Actual output
![image](https://github.com/user-attachments/assets/fdef172b-1782-4270-96f9-535690f772de)

<details> <summary> `inspect view` console output </summary>

```bash
[09/24/24 11:57:41] ERROR    33 validation errors for EvalLog                                                                                                                                                                                                                                                                                                                       view.py:198
                             samples.0.transcript.events.2.SampleInitEvent.event
                               Input should be 'sample_init' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.SampleInitEvent.sample
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.SampleInitEvent.state
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.StateEvent.event
                               Input should be 'state' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.StateEvent.changes
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.StoreEvent.event
                               Input should be 'store' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.StoreEvent.changes
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.event
                               Input should be 'model' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.ModelEvent.model
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.input
                               Input should be a valid list [type=list_type, input_value={'id': 'my_subtask'}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/list_type
                             samples.0.transcript.events.2.ModelEvent.tools
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.tool_choice
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.config
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.output
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ToolEvent.event
                               Input should be 'tool' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.ToolEvent.id
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ToolEvent.function
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ToolEvent.arguments
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ToolEvent.result
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.InputEvent.event
                               Input should be 'input' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.InputEvent.input
                               Input should be a valid string [type=string_type, input_value={'id': 'my_subtask'}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/string_type
                             samples.0.transcript.events.2.InputEvent.input_ansi
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ScoreEvent.event
                               Input should be 'score' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.ScoreEvent.score
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ErrorEvent.event
                               Input should be 'error' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.ErrorEvent.error
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.LoggerEvent.event
                               Input should be 'logger' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.LoggerEvent.message
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.InfoEvent.event
                               Input should be 'info' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.InfoEvent.data
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.StepEvent.event
                               Input should be 'step' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.StepEvent.action
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.SubtaskEvent.result
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             Traceback (most recent call last):
                               File "/Users/rusheb/miniconda3/envs/inspect-evals/lib/python3.12/site-packages/inspect_ai/_view/view.py", line 187, in handle_log
                                 log = read_eval_log(path, header_only=False)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                               File "/Users/rusheb/miniconda3/envs/inspect-evals/lib/python3.12/site-packages/inspect_ai/log/_file.py", line 257, in read_eval_log
                                 log = EvalLog(**raw_data)
                                       ^^^^^^^^^^^^^^^^^^^
                               File "/Users/rusheb/miniconda3/envs/inspect-evals/lib/python3.12/site-packages/pydantic/main.py", line 193, in __init__
                                 self.__pydantic_validator__.validate_python(data, self_instance=self)
                             pydantic_core._pydantic_core.ValidationError: 33 validation errors for EvalLog
                             samples.0.transcript.events.2.SampleInitEvent.event
                               Input should be 'sample_init' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.SampleInitEvent.sample
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.SampleInitEvent.state
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.StateEvent.event
                               Input should be 'state' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.StateEvent.changes
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.StoreEvent.event
                               Input should be 'store' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.StoreEvent.changes
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.event
                               Input should be 'model' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.ModelEvent.model
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.input
                               Input should be a valid list [type=list_type, input_value={'id': 'my_subtask'}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/list_type
                             samples.0.transcript.events.2.ModelEvent.tools
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.tool_choice
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.config
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ModelEvent.output
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ToolEvent.event
                               Input should be 'tool' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.ToolEvent.id
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ToolEvent.function
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ToolEvent.arguments
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ToolEvent.result
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.InputEvent.event
                               Input should be 'input' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.InputEvent.input
                               Input should be a valid string [type=string_type, input_value={'id': 'my_subtask'}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/string_type
                             samples.0.transcript.events.2.InputEvent.input_ansi
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ScoreEvent.event
                               Input should be 'score' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.ScoreEvent.score
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.ErrorEvent.event
                               Input should be 'error' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.ErrorEvent.error
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.LoggerEvent.event
                               Input should be 'logger' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.LoggerEvent.message
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.InfoEvent.event
                               Input should be 'info' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.InfoEvent.data
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.StepEvent.event
                               Input should be 'step' [type=literal_error, input_value='subtask', input_type=str]
                                 For further information visit https://errors.pydantic.dev/2.8/v/literal_error
                             samples.0.transcript.events.2.StepEvent.action
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
                             samples.0.transcript.events.2.SubtaskEvent.result
                               Field required [type=missing, input_value={'timestamp': '2024-09-24...subtask'}, 'events': []}, input_type=dict]
                                 For further information visit https://errors.pydantic.dev/2.8/v/missing
```

</details>


## Expected behaviour

Not sure? Either it doesn't crash, or it prevents me from running a task where the subtask returns None, or both?