feat(ai/utils): increased the Gemini header runaway threshold

- Raised `GEMINI_HEADER_RUNAWAY_THRESHOLD` from 10 to 24 to avoid false-positive interrupts on legitimate, complex reasoning blocks.
- Added a regression test verifying that 10 distinct, progressing headers do not trip the detector while 24 headers still trigger it.
This commit is contained in:
can1357
2026-06-30 20:26:51 +02:00
parent f1453d72ae
commit 490662ab2e
4 changed files with 21 additions and 7 deletions
+1 -2
View File
@@ -15,7 +15,6 @@ import type { OAuthAccess } from "@oh-my-pi/pi-ai/auth-storage";
import type { OAuthProvider } from "@oh-my-pi/pi-ai/oauth/types";
import { getGitLabDuoModels } from "@oh-my-pi/pi-ai/providers/gitlab-duo";
import { $env } from "@oh-my-pi/pi-utils";
import { buildCompat } from "../src/build";
import { ANTIGRAVITY_PRIMARY_ENDPOINT, fetchAntigravityDiscoveryModels } from "../src/discovery/antigravity";
import { fetchCodexModels } from "../src/discovery/codex";
import { buildGitLabDuoWorkflowFallbackModel } from "../src/discovery/gitlab-duo-workflow";
@@ -645,7 +644,7 @@ Model Statistics:`);
function canonicalizeModelCompat(model: ModelSpec<Api>): void {
if (!model.compat) return;
if (model.compat.disableStrictTools === false) {
if ("disableStrictTools" in model.compat && model.compat.disableStrictTools === false) {
delete model.compat.disableStrictTools;
}