Commit 8bead08
committed
Fix Browser action deserialization by using OpenHandsModel
The root cause of 'Unexpected kind BrowserGetContentAction' errors during
aggregation was that EvalOutput extended BaseModel instead of OpenHandsModel.
When EvalOutput.model_validate() is called in iterative.py line 126 to
deserialize output.jsonl results, the pydantic schema is already cached
from the initial import. Since Browser classes are imported later in the
import chain, they're not registered in the discriminated union schema.
OpenHandsModel solves this by calling _rebuild_if_required() before
validation, which regenerates all pydantic schemas to include any newly
registered discriminated union types (like Browser actions/observations).
This ensures that output.jsonl files containing Browser actions can be
successfully deserialized during the aggregation step.
Co-authored-by: openhands <openhands@all-hands.dev>1 parent 384b924 commit 8bead08
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
0 commit comments