Drake Thomsen
c5fa757ef6
fix(agents): prevent Anthropic 400 'Incorrect role information' error
...
Add validateAnthropicTurns() to merge consecutive user messages that can
occur when steering messages are injected during streaming. This prevents
the API from rejecting requests due to improper role alternation.
Changes:
- Add validateAnthropicTurns() function in pi-embedded-helpers.ts
- Integrate validation into sanitization pipeline in pi-embedded-runner.ts
- Add user-friendly error message for role ordering errors
- Add comprehensive tests for the new validation function
2026-01-12 23:42:13 +00:00
..
2026-01-12 23:42:13 +00:00
2026-01-12 23:41:40 +00:00
2026-01-12 22:27:19 +00:00
2026-01-09 11:06:39 +01:00
2026-01-12 21:56:27 +00:00
2026-01-12 19:38:52 +00:00
2026-01-12 22:06:35 +00:00
2026-01-12 23:13:40 +00:00
2026-01-12 08:33:32 +00:00
2026-01-12 23:41:40 +00:00
2026-01-09 17:18:01 +01:00
2026-01-12 20:38:34 +00:00
2026-01-10 19:19:43 +01:00
2026-01-12 08:55:02 +00:00
2026-01-12 21:24:36 +00:00
2026-01-09 03:04:16 +01:00
2026-01-10 15:28:37 +01:00
2026-01-09 21:52:47 +00:00
2026-01-10 04:01:06 +01:00
2026-01-12 18:49:24 +00:00
2026-01-12 08:32:08 +00:00
2026-01-11 11:45:25 +00:00
2026-01-12 22:59:36 +00:00
2026-01-11 10:48:46 +00:00
2026-01-12 16:52:15 +00:00
2026-01-09 22:30:15 +01:00
2026-01-10 00:52:24 +01:00
2026-01-12 08:22:01 +00:00
2026-01-12 23:41:40 +00:00
2026-01-12 22:59:36 +00:00
2026-01-11 05:01:50 +01:00
2026-01-12 19:31:04 +00:00
2026-01-12 17:55:45 +00:00
2026-01-12 08:45:23 +00:00
2026-01-12 08:55:02 +00:00
2026-01-10 02:39:52 +01:00
2026-01-12 19:38:52 +00:00
2026-01-12 00:46:55 +00:00
2026-01-12 10:52:34 +00:00
2025-11-26 00:53:53 +01:00
2026-01-08 05:20:39 +01:00
2025-12-23 03:05:59 +01:00
2026-01-07 20:59:49 +00:00
2026-01-04 14:57:57 +00:00
2026-01-03 12:32:14 +00:00
2026-01-12 18:46:40 +00:00
2026-01-06 04:51:05 +00:00
2026-01-06 04:51:05 +00:00
2026-01-12 00:28:34 +00:00
2025-12-07 19:01:14 +01:00
2025-12-26 02:35:40 +01:00
2025-11-26 00:53:53 +01:00
2026-01-10 02:39:52 +01:00
2026-01-10 02:39:52 +01:00
2026-01-04 14:38:51 +00:00