Commit 66dc75b
committed
fix(yutori): treat wait/hold_key duration as seconds, not ms
Yutori's reference impl (frontend-visualqa actions.py:469, 506)
interprets the model-supplied `duration` argument on `wait` and
`hold_key` as seconds — passed straight to asyncio.sleep on the wait
path, and clamped to 100s on the hold_key path. Our handlers were
treating duration as milliseconds, so any model-supplied value was
silently interpreted 1000× too short (`wait { duration: 2 }` slept 2ms
instead of 2s; `hold_key { duration: 0.5 }` held 0.5ms instead of
500ms). Defaults were unaffected because they were pre-computed in ms.
Convert seconds → ms before passing to Kernel's pressKey, and use
seconds directly for asyncio.sleep / setTimeout. Adds a `> 0` guard on
hold_key duration, which also resolves the bugbot nit about negative
values reaching the SDK.1 parent d2affba commit 66dc75b
2 files changed
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
259 | | - | |
| 261 | + | |
260 | 262 | | |
261 | 263 | | |
262 | 264 | | |
| |||
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
| 281 | + | |
279 | 282 | | |
280 | | - | |
| 283 | + | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
| 289 | + | |
289 | 290 | | |
290 | 291 | | |
291 | 292 | | |
| |||
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
313 | | - | |
| 314 | + | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| |||
0 commit comments