Files
coder/aibridge/intercept
Danny Kopping 4e87fdb20c fix(aibridge/intercept/messages): record user prompt before trailing system message (#26195)
_Disclosure: produced using Opus 4.8_

I've noticed recently that some prompts are not displaying correctly.

<img width="1388" height="509" alt="image"
src="https://github.com/user-attachments/assets/fad3812f-e42d-4398-a16c-a0e7f924455d"
/>

The cause is the `mid-conversation-system-2026-04-07` beta. When
enabled, the client appends a trailing `role: "system"` message after
the user's text (e.g. an injected skills list):

```json
"messages": [
  { "role": "user",   "content": [ "hey how are ya" ] },
  { "role": "system", "content": "The following skills are available..." }
]
```

Our prompt detection algo was being subverted since we only check the
last message if role=user.
2026-06-10 10:47:13 +02:00
..