Files
OmniRoute/tests
Xiangzhe 0e85e7833d fix(memory): avoid rejected mid-conversation system injection on Claude when preceding turn isn't a tool result (#11290)
Claude Opus 5 rejects the #3890 cache-safe mid-array system splice with
HTTP 400 when the assistant turn immediately before the splice point is
plain text rather than a server-side tool result. Adding claude/anthropic
outright to systemMessageMustBeFirst() would revert the #3890 cache-hit
optimization for every Claude request, so instead injectMemory() now only
falls back to leading-system-message placement for the specific Claude-
family requests where that condition holds, preserving the mid-array
splice everywhere it remains safe (non-Claude providers unconditionally,
and Claude providers whose preceding turn does end in a server tool
result).
2026-08-23 21:16:27 -03:00
..