Commit 1d13b56
fix: validate message roles — return 400 instead of 500 for invalid roles
Round 5 testing (Python agent developer) found that sending an invalid
role like "bot" caused a 500 Internal Server Error from the tokenizer.
Now validates roles against {system, user, assistant, tool, developer}
and returns a clear 400 error with the invalid role name.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 4c972c9 commit 1d13b56
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1701 | 1701 | | |
1702 | 1702 | | |
1703 | 1703 | | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
1704 | 1713 | | |
1705 | 1714 | | |
1706 | 1715 | | |
| |||
0 commit comments