fix(antigravity): respect pinned auth in credits fallback, release deferred body on success

- findAllAntigravityCreditsCandidateAuths now filters by PinnedAuthMetadataKey
  to prevent credential isolation violations during credits fallback
- Release deferredBody reference on success path to avoid holding large
  payloads in memory for the lifetime of the gin context
This commit is contained in:
sususu98
2026-04-23 17:38:02 +08:00
parent 4de5c29f86
commit e75daa299b
2 changed files with 11 additions and 3 deletions
@@ -134,6 +134,10 @@ func RecordAPIResponseMetadata(ctx context.Context, cfg *config.Config, status i
// Success responses (2xx) skip this — their deferred body is dropped with gin context.
if status >= http.StatusBadRequest {
materializeDeferredBodies(ginCtx, attempts)
} else {
for _, a := range attempts {
a.deferredBody = nil
}
}
ensureResponseIntro(attempt)