feat: sync deployed v1.0.0-rc.38-custom.67

This commit is contained in:
cneicy committed 2026-10-06 00:07:10 +08:00
1 parent d09216bbde
commit 8e6ed0317b
154 files changed
+39540 -20509

No files matched your search

+7 -3
View File
@@ -21,7 +21,7 @@ type ResponsesUsageAccumulator struct {
imageCounter relaycommon.ImageGenerationCallCounter
imageCommitted bool
started bool
hasUsage bool
hasUsage bool
finished bool
}
@@ -42,7 +42,9 @@ func (a *ResponsesUsageAccumulator) Observe(event *dto.ResponsesStreamResponse)
case "response.completed", "response.done", "response.failed", "response.incomplete", "response.cancelled", "response.canceled":
if event.Response != nil {
ApplyResponsesUsage(a.usage, event.Response.Usage)
if event.Response.Usage!=nil {a.hasUsage=true}
if event.Response.Usage != nil {
a.hasUsage = true
}
if a.outputText.Len() == 0 {
// Some upstreams carry the output only on the terminal event.
a.outputText.WriteString(relayconvert.ExtractOutputTextFromResponses(event.Response))
@@ -86,7 +88,9 @@ func (a *ResponsesUsageAccumulator) Finish() *dto.Usage {
return a.usage
}
a.finished = true
if a.info.DurableAttemptBilling && !a.hasUsage {a.usage.UsageSource="estimated"}
if a.info.DurableAttemptBilling && !a.hasUsage {
a.usage.UsageSource = "estimated"
}
// A final image item can already have reached the client before the stream
// disconnects. Explicit failed/incomplete terminals reset and commit zero in
// Observe; otherwise retain completed tool usage even without a terminal.