Commit d80fc77
committed
fix(tools): reject non-numeric home_control value at execution boundary
parse_home_control_args read the optional value argument with
`args.get("value").and_then(|v| v.as_f64())`, which silently dropped a
*provided* non-numeric value to None. A model emitting `"value": "72"`
(string) or `"value": true` for set_temperature / set_brightness would
actuate the device with no value instead of the user's intent, with no
error surfaced or audited.
Keep value optional — absent or explicit null is still a no-op None — but
reject a provided value that is not a number, the same way set_timer
rejects a non-integer 'seconds'. The malformed call now fails at the
boundary and is tool-audited as a failure instead of silently
mis-actuating.
Cover the contract with a parse_home_control_args unit test (numeric ->
Some, absent/null -> None, string/bool/array -> rejected) and extend the
home_control tool-gate integration test with a non-numeric value case.1 parent e5755b6 commit d80fc77
2 files changed
Lines changed: 54 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
56 | 69 | | |
57 | 70 | | |
58 | 71 | | |
| |||
2508 | 2521 | | |
2509 | 2522 | | |
2510 | 2523 | | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
2511 | 2560 | | |
2512 | 2561 | | |
2513 | 2562 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
495 | 499 | | |
496 | 500 | | |
497 | 501 | | |
| |||
0 commit comments