feat(ai): carry responseModel on pi-messages terminal events (#11265)

This commit makes it so we store the responseModel (i.e. the "phyiscal"
model used) on each PiMessage. This allows e.g. Radius to know which
physical model was used by virtual models (like `cheap`). It's
especially important after we merged
https://github.com/earendil-works/pi/pull/11000
(9113094291), where Pi will drop thinking
traces when the model name doesn't match - with this change we can check
the physical model instead.
This commit is contained in:
Vegard Stikbakke 2026-10-23 10:54:18 +02:00 • committed by GitHub
parent 906e1302f9
commit 14c8118412
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 3 deletions

View file

@ -140,7 +140,7 @@ interface AssistantMessage {
}
```
`responseModel` records a concrete provider response model when it differs from the requested model. `responseId`, `providerThinkingLevel`, `thinkingLevel`, `diagnostics`, and `rawStopReason` preserve provider or runtime details.
`responseModel` records the concrete model reported by the provider, when the provider reports one. It may equal the requested model. `responseId`, `providerThinkingLevel`, `thinkingLevel`, `diagnostics`, and `rawStopReason` preserve provider or runtime details.
`"pending"` is used for a partial assistant message while it streams. The completed message in `message_end` has a terminal stop reason, and Pi does not persist `"pending"` assistant messages in session JSONL.