fix(ai): forwarded advisor silence flag over pi-native

Added acceptEmptyResponse to the pi-native gateway option allow-list so a Google advisor on the auth-gateway transport still accepts a silent STOP server-side instead of exhausting the empty-response retries.

Added a pi-native parseRequest regression asserting the option survives the wire.
This commit is contained in:
roboomp
2026-08-11 08:46:35 +00:00
parent 0a64b6d965
commit 433ba7df1f
2 changed files with 10 additions and 0 deletions
@@ -78,6 +78,7 @@ const ALLOWED_OPTION_KEYS: ReadonlySet<keyof SimpleStreamOptions> = new Set([
"preferWebsockets",
"openrouterVariant",
"loopGuard",
"acceptEmptyResponse",
] as const satisfies readonly (keyof SimpleStreamOptions)[]);
// ---------------------------------------------------------------------------
@@ -145,6 +145,15 @@ describe("pi-native parseRequest", () => {
expect(parsed.options.loopGuard).toEqual({ enabled: false });
});
it("forwards acceptEmptyResponse so a passive Google advisor can accept silence server-side", () => {
const parsed = parseRequest({
modelId: "google/gemini-3.6-flash",
context: baseContext,
options: { acceptEmptyResponse: true },
});
expect(parsed.options.acceptEmptyResponse).toBe(true);
});
it("forwards an explicit statefulResponses disablement to the native stream", () => {
const parsed = parseRequest({
modelId: "openai/gpt-5",