@expiren/opencode-antigravity-auth 1.6.38 → 1.6.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8151,12 +8151,12 @@ async function transformAntigravityResponse(response, streaming, debugContext, r
8151
8151
  onInjectDebug: injectDebugThinking,
8152
8152
  onUsageMetadata: (usage) => {
8153
8153
  if (effectiveModel) {
8154
- logCacheStats(
8155
- effectiveModel,
8156
- usage.cachedContentTokenCount,
8157
- 0,
8158
- usage.promptTokenCount ?? usage.totalTokenCount
8159
- );
8154
+ const cacheRead = usage.cachedContentTokenCount;
8155
+ const totalInput = usage.promptTokenCount ?? usage.totalTokenCount;
8156
+ const hitRate = totalInput > 0 ? Math.round(cacheRead / totalInput * 100) : 0;
8157
+ const status = cacheRead > 0 ? "HIT" : "MISS";
8158
+ logCacheStats(effectiveModel, cacheRead, 0, totalInput);
8159
+ log6.debug(`[Cache] ${status} model=${effectiveModel} read=${cacheRead} total=${totalInput} hitRate=${hitRate}%`);
8160
8160
  }
8161
8161
  },
8162
8162
  transformThinkingParts
@@ -8254,13 +8254,12 @@ ${debugText}` : "";
8254
8254
  const effectiveBody = patched ?? parsed ?? void 0;
8255
8255
  const usage = usageFromSse ?? (effectiveBody ? extractUsageMetadata(effectiveBody) : null);
8256
8256
  if (usage && effectiveModel) {
8257
- logCacheStats(
8258
- effectiveModel,
8259
- usage.cachedContentTokenCount ?? 0,
8260
- 0,
8261
- // API doesn't provide cache write tokens separately
8262
- usage.promptTokenCount ?? usage.totalTokenCount ?? 0
8263
- );
8257
+ const cacheRead = usage.cachedContentTokenCount ?? 0;
8258
+ const totalInput = usage.promptTokenCount ?? usage.totalTokenCount ?? 0;
8259
+ const hitRate = totalInput > 0 ? Math.round(cacheRead / totalInput * 100) : 0;
8260
+ const status = cacheRead > 0 ? "HIT" : "MISS";
8261
+ logCacheStats(effectiveModel, cacheRead, 0, totalInput);
8262
+ log6.debug(`[Cache] ${status} model=${effectiveModel} read=${cacheRead} total=${totalInput} hitRate=${hitRate}%`);
8264
8263
  }
8265
8264
  if (usage?.cachedContentTokenCount !== void 0) {
8266
8265
  headers.set("x-antigravity-cached-content-token-count", String(usage.cachedContentTokenCount));