Commit 8d62d48
🛡️ fix: Guard against null content parts in formatAgentMessages payload
Sanitize each message's content array with the existing filterMalformedContentParts
helper before passing the payload to formatAgentMessages, which reads part.type
without a null guard and crashes on corrupted history (e.g. content parts persisted
from aborted/partial streams via an OpenAI-compatible proxy).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 566e20b commit 8d62d48
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
889 | 897 | | |
890 | 898 | | |
891 | 899 | | |
892 | 900 | | |
893 | 901 | | |
894 | 902 | | |
895 | | - | |
| 903 | + | |
896 | 904 | | |
897 | 905 | | |
898 | 906 | | |
| |||
0 commit comments