Commit a81d171
authored
Improve handler shape validation guidance (#101)
* Improve handler shape validation guidance
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
* Address PR review: improve handler validation guards and guidance consistency
- Gate return-check on has_handler_function && no signature issue to
avoid misleading 'MUST return' errors on invalid handler shapes
- Expand check_handler_has_return skip logic to also skip arrow function
bodies (=> { ... }) and generator declarations (function*)
- Fix conflicting guidance in register_handler tool description: use
function handler(...) instead of function handler(event) in REQUIRED line
- Add zero-parameter form function handler() to system-message signature list
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
---------
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>1 parent 062d140 commit a81d171
5 files changed
Lines changed: 443 additions & 78 deletions
File tree
- src
- agent
- code-validator/guest/runtime/src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
1295 | | - | |
| 1295 | + | |
| 1296 | + | |
1296 | 1297 | | |
| 1298 | + | |
| 1299 | + | |
1297 | 1300 | | |
1298 | 1301 | | |
1299 | 1302 | | |
| |||
1332 | 1335 | | |
1333 | 1336 | | |
1334 | 1337 | | |
1335 | | - | |
1336 | | - | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1337 | 1341 | | |
1338 | 1342 | | |
1339 | 1343 | | |
| |||
2893 | 2897 | | |
2894 | 2898 | | |
2895 | 2899 | | |
2896 | | - | |
2897 | | - | |
2898 | | - | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
2899 | 2904 | | |
2900 | 2905 | | |
2901 | 2906 | | |
| |||
2949 | 2954 | | |
2950 | 2955 | | |
2951 | 2956 | | |
2952 | | - | |
| 2957 | + | |
2953 | 2958 | | |
2954 | 2959 | | |
2955 | 2960 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
57 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
0 commit comments