fix(gateway): record actual served model for image requests

handleImage recorded the raw request model id, so AUTO image
generations showed up as model=AUTO in the request records and
by-model aggregates instead of the image model actually served
(e.g. Kwai-Kolors/Kolors).

UnifiedResponse gains an optional Model field; Provider.Image fills
it with the resolved id (AUTO resolves to the source's best image
model), and handleImage prefers it when writing the audit record.
This commit is contained in:
JianFeeeee
2026-08-26 20:28:20 +08:00
parent 5d045f97a8
commit 747dff5b76
3 changed files with 6 additions and 0 deletions

View File

@ -932,6 +932,9 @@ func (g *Gateway) handleImage(w http.ResponseWriter, r *http.Request) {
if usedSrc != "" {
rec.Source = usedSrc
}
if resp.Model != "" {
rec.Model = resp.Model // record the actual model served, not the raw request id
}
rec.OK = true
rec.Status = http.StatusOK
rec.Compl = int64(len(resp.ImageData))