Files
Mohil-Ahuja 7dcb968fcb fix(llm): only merge system text into the first serialized user message
Dropping the `not formatted_messages` guard fixed the assistant-first case but
went too far: for a `user -> system -> user` ordering the system text was
merged into the second user message, where the documented behaviour is to
prepend to the *first* user message and otherwise fall back to the separate
system instruction.

Track whether a user message has already been serialized and merge only while
none has. An earlier assistant turn still does not disqualify the first user
message, but a user turn does, and the leftover text now reaches the caller as
the system instruction instead of being silently relocated.
2026-09-04 01:05:05 +05:30
..