
aistudio 通道上 gemini-3.6-flash 的流式请求,末帧被中继切成四块,逐块翻译把 finish_reason 丢在碎块里,客户端最后收到一条 502;本期给出复现判据、代价落在谁身上、今天能动的三条处置,以及修复 PR 的现状。
gemini-3.6-flash 的流式请求,上游会正常跑完,用量会照记,客户端最后收到一条错误帧。data: {... "delta":{"content":"Hi there! How are you?"}, "finish_reason":null ...}
data: {... "delta":{"content":""}, "finish_reason":null ...}
data: {"error":{"message":"upstream stream closed before any chunk carried finish_reason","type":"server_error","code":"internal_server_error"}}finishReason 是 STOP,用量已入库。gemini-3.5-flash-lite 一切正常。request-log: true 抓回上游原始响应,数出末帧被切成四块送进来。| 块 | 长度 | 内容 |
|---|---|---|
| #2 | 1181 字节 | 以 data: {"candidates":[... 开头,切在 thoughtSignature 中间 |
| #3 | 1186 字节 | 没有 data: 前缀,纯签名中段 |
| #4 | 1186 字节 | 签名继续,末尾才出现 serviceTier 与 modelVersion |
| #5 | 69 字节 | responseId 收尾 |
finishReason 就在里面。gemini-3.6-flash 的末帧带一个约 3.7 KB 的 thoughtSignature,一帧就超过了这个块大小。gemini-3.5-flash-lite 的签名小,一帧装得进一块,所以它没事。
internal/runtime/executor/aistudio_executor.go 第 384–399 行(2)。data: 开头的行。data: 前缀,整块会被原样当成一帧交出去。
#2 被当成完整帧解析,宽松的解析回一个空增量。#3 到 #5 没有 data: 前缀,翻译层从中读不出内容,finishReason 就落在这些被丢掉的部分里。/v1/chat/completions 的 handler 一路在数有没有见过 finish_reason。一帧都没见过,它就在收尾时自己合成一个 502。
sdk/api/handlers/openai/openai_handlers.go 第 822–862 行:第 823 行开始记录 sawFinishReason,第 853–861 行在流关闭时按它决定是否回 502(5)。/v1/chat/completions 是本期实测恒出 502 的那条。/v1/messages 在报障人那里正常。Claude handler 里同样写着 upstream stream closed before message_stop 的守卫(7),换入口省不掉这道检查。data: 帧没收完就先攒着,收满再交给下面那条链。data: 前缀本身被切开、大签名、CRLF 分隔、末帧没有空行时在流结束时冲刷。config.example.yaml 里没有示例,只出现在代码与测试里;旧版顶层写法 oauth-excluded-models 会被自动迁到新位置。gemini-3.5-flash-lite 在报障里是正常的,代价是能力档位下降。config.example.yaml 即可。request-scoped-errors 换号规则与去清冷却这两条路,都接不上这条错误:前者匹配的是执行器带出来的上游错误体,后者里压根没有它的记录。[DONE] 才冲刷;type: integer 的 schema 拒掉合法整数。input_tokens: 0 时,本地继续沿用 message_start 的估算(12、13)。mergeable_state 为 unstable,尚未合并。merged_at 为空,3 文件 +61/−2 留在分支上(14)。github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
status.openai.com
status.anthropic.com
status.cloud.google.com
codex-reset.com
opentherank.com
reddit.com
discuss.ai.google.dev
discuss.ai.google.dev
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.