-
-
Notifications
You must be signed in to change notification settings - Fork 4k
fix: ensure usage records are published for 0-token responses #2272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -117,6 +117,7 @@ func (e *AIStudioExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, | |||||||||
| baseModel := thinking.ParseSuffix(req.Model).ModelName | ||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
119
to
+120
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| translatedReq, body, err := e.translateRequest(req, opts, false) | ||||||||||
| if err != nil { | ||||||||||
|
|
@@ -176,6 +177,7 @@ func (e *AIStudioExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth | |||||||||
| baseModel := thinking.ParseSuffix(req.Model).ModelName | ||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
179
to
+180
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| translatedReq, body, err := e.translateRequest(req, opts, true) | ||||||||||
| if err != nil { | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -205,6 +205,7 @@ func (e *AntigravityExecutor) Execute(ctx context.Context, auth *cliproxyauth.Au | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
207
to
+208
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("antigravity") | ||||||||||
|
|
@@ -347,6 +348,7 @@ func (e *AntigravityExecutor) executeClaudeNonStream(ctx context.Context, auth * | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
350
to
+351
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("antigravity") | ||||||||||
|
|
@@ -750,6 +752,7 @@ func (e *AntigravityExecutor) ExecuteStream(ctx context.Context, auth *cliproxya | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
754
to
+755
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("antigravity") | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -104,6 +104,7 @@ func (e *ClaudeExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, r | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
106
to
+107
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("claude") | ||||||||||
| // Use streaming translation to preserve function calling, except for claude. | ||||||||||
|
|
@@ -272,6 +273,7 @@ func (e *ClaudeExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.A | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
275
to
+276
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("claude") | ||||||||||
| originalPayloadSource := req.Payload | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -90,6 +90,7 @@ func (e *CodexExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, re | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
92
to
+93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("codex") | ||||||||||
|
|
@@ -200,6 +201,7 @@ func (e *CodexExecutor) executeCompact(ctx context.Context, auth *cliproxyauth.A | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
203
to
+204
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("openai-response") | ||||||||||
|
|
@@ -290,6 +292,7 @@ func (e *CodexExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.Au | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
294
to
+295
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("codex") | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -157,6 +157,7 @@ func (e *CodexWebsocketsExecutor) Execute(ctx context.Context, auth *cliproxyaut | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
159
to
+160
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("codex") | ||||||||||
|
|
@@ -366,6 +367,7 @@ func (e *CodexWebsocketsExecutor) ExecuteStream(ctx context.Context, auth *clipr | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
369
to
+370
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("codex") | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -114,6 +114,7 @@ func (e *GeminiCLIExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
116
to
+117
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("gemini-cli") | ||||||||||
|
|
@@ -268,6 +269,7 @@ func (e *GeminiCLIExecutor) ExecuteStream(ctx context.Context, auth *cliproxyaut | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
271
to
+272
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("gemini-cli") | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -112,6 +112,7 @@ func (e *GeminiExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, r | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
114
to
+115
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| // Official Gemini API via API key or OAuth bearer | ||||||||||
| from := opts.SourceFormat | ||||||||||
|
|
@@ -220,6 +221,7 @@ func (e *GeminiExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.A | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
223
to
+224
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("gemini") | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -303,6 +303,7 @@ func (e *GeminiVertexExecutor) executeWithServiceAccount(ctx context.Context, au | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
305
to
+306
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| var body []byte | ||||||||||
|
|
||||||||||
|
|
@@ -429,6 +430,7 @@ func (e *GeminiVertexExecutor) executeWithAPIKey(ctx context.Context, auth *clip | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
432
to
+433
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("gemini") | ||||||||||
|
|
@@ -534,6 +536,7 @@ func (e *GeminiVertexExecutor) executeStreamWithServiceAccount(ctx context.Conte | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
538
to
+539
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("gemini") | ||||||||||
|
|
@@ -658,6 +661,7 @@ func (e *GeminiVertexExecutor) executeStreamWithAPIKey(ctx context.Context, auth | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
663
to
+664
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("gemini") | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -88,6 +88,7 @@ func (e *IFlowExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, re | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
90
to
+91
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("openai") | ||||||||||
|
|
@@ -191,6 +192,7 @@ func (e *IFlowExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.Au | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
194
to
+195
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("openai") | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -78,6 +78,7 @@ func (e *KimiExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, req | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
80
to
+81
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| to := sdktranslator.FromString("openai") | ||||||||||
| originalPayloadSource := req.Payload | ||||||||||
|
|
@@ -178,6 +179,7 @@ func (e *KimiExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.Aut | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
181
to
+182
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| to := sdktranslator.FromString("openai") | ||||||||||
| originalPayloadSource := req.Payload | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -74,6 +74,7 @@ func (e *OpenAICompatExecutor) Execute(ctx context.Context, auth *cliproxyauth.A | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
76
to
+77
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| baseURL, apiKey := e.resolveCredentials(auth) | ||||||||||
| if baseURL == "" { | ||||||||||
|
|
@@ -181,6 +182,7 @@ func (e *OpenAICompatExecutor) ExecuteStream(ctx context.Context, auth *cliproxy | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
184
to
+185
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| baseURL, apiKey := e.resolveCredentials(auth) | ||||||||||
| if baseURL == "" { | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -230,6 +230,7 @@ func (e *QwenExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, req | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
232
to
+233
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("openai") | ||||||||||
|
|
@@ -333,6 +334,7 @@ func (e *QwenExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.Aut | |||||||||
|
|
||||||||||
| reporter := newUsageReporter(ctx, e.Identifier(), baseModel, auth) | ||||||||||
| defer reporter.trackFailure(ctx, &err) | ||||||||||
| defer reporter.ensurePublished(ctx) | ||||||||||
|
Comment on lines
336
to
+337
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of these Both To fix this, the
Suggested change
|
||||||||||
|
|
||||||||||
| from := opts.SourceFormat | ||||||||||
| to := sdktranslator.FromString("openai") | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
Execute, this defer order is backwards for Go's LIFO semantics:ensurePublishedruns first, callsonce.Do, and thentrackFailurecannot publish a failed record anymore. That means any error path that returns before an explicit usage publish (for exampletranslateRequestfailures in this function) is now recorded as a successful zero-usage request, which corrupts failure accounting. The same pattern appears in the other executors changed in this commit.Useful? React with 👍 / 👎.