Commit 02640e6
committed
Fix non-JSON logging in sockets.py and state.py
- Fix literal string '{event}' in error logs (sockets.py lines 145, 163)
The string was not an f-string, so {event} was logged literally instead
of the actual event data. Changed to use proper logging format args.
- Fix model_dump() returning non-JSON-serializable objects (state.py)
The model_dump() method returns Python objects like UUID and enums
that appear as repr strings in logs (e.g., UUID('...'), <Enum.VALUE>).
Changed to use model_dump(mode='json') wrapped in json.dumps() for
proper JSON-serializable output.
Co-authored-by: openhands <openhands@all-hands.dev>1 parent d3e5512 commit 02640e6
File tree
2 files changed
+12
-6
lines changed- openhands-agent-server/openhands/agent_server
- openhands-sdk/openhands/sdk/conversation
2 files changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
163 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
| 254 | + | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
| 281 | + | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
0 commit comments