You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI Studio CreateInteraction returned HTTP 400, protocol error code 3:
'gemini-4-hydrogen' refers to a model, but was provided in the 'agent' field. Please use the 'model' field instead.
argon 同样报错('gemini-4-argon' refers to a model, ...)。同池另一账户目录中相同模型 field79=null,走 GenerateContent 完全正常——Google 在按账户灰度把 gemini-4 迁移到 Interactions 后端,该账户恰好被迁入。
Activity
likeravine233 commentedon Nov 24, 2026
已在被迁移账户上定位并修复,见 #323。实测 gemini-4-hydrogen / argon 经 CreateInteractionStream(模型目标)单轮与多轮均返回 200。
likeravine233 commentedon Nov 24, 2026
补充决定性证据(同一被迁移账户的官网前端抓包):
前端对
gemini-4-hydrogen实际调用 CreateInteraction + GetInteractionStream(而非 CreateInteractionStream)。真实请求体:对照目录 flag 分布:
[.,.,null,2]的 gemini-omni 走 CreateInteractionStream;[.,.,1,2]的 gemini-4 与[.,.,1,1]的 agent 都走 CreateInteraction+GetInteractionStream,区别仅在 index 17 写模型目标、index 18 写 agent 目标。修正根因表述:路由本身没错——background=1 本来就该走任务路径;错的是编码器对 kind=2 模型也按 index 18 的 agent 目标格式(
[名称,nil,config])写入。正确修法:编码器按 field79 kind 区分——kind=2 在 index 17 写["models/X", genConfig](与 CreateInteractionStream 的模型目标同构),kind=1 维持 index 18 agent 目标不变。另确认官网 GetInteractionStream 请求体
[id,1,null,null,proof,1,"models/X"]与现有实现一致,无需改动。likeravine233 commentedon Nov 24, 2026
补充一组实测结果(来源:一个 Google AI Pro 账号的 Chrome DevTools 抓包 + AIS 运行日志;样本为单账号、单日,结论边界在最后说明)。
1. 官网前端对 kind=2 模型的真实请求格式(抓包实锤)
在被标记的账号上,gemini-4-hydrogen 走
CreateInteraction+GetInteractionStream(任务路径),不是CreateInteractionStream:CreateInteraction内interaction[17] = ["models/gemini-4-hydrogen", [null×5, 4, 1, 65536]]——模型目标:field 1 模型名、field 2 生成配置;interaction[26]为 steps;信封[null,1,1,interaction,"<proof>",1]GetInteractionStream请求体["<id>",1,null,null,"<proof>",1,"models/X"]结论:现有代码"background→任务路径"的路由方向没错,bug 只在编码——AIS 把模型名按 agent 格式写到 field 18,kind=2 需要 field 17 的模型目标格式。PR #323 第一个 commit 按此修复。
2. 终态 status 2 = requires_action(函数调用)
实测:模型输出 function call 后上游以 status 2 结束 interaction,
decodeInteractionEvent抛"未识别的最终状态 %d"导致 502。仓库 docs/protocol.md 亦记载"函数调用为 requires_action";js-genai 官方 SDK 的InteractionStatus枚举顺序(in_progress/requires_action/completed/failed/cancelled/incomplete)与已实测的 3/4/5/6 映射完全吻合。PR 第二个 commit 补此终态:从终态 interaction 的 steps(索引 26)递归提取 content[10] 的函数调用(
[name, args, id?],与 GenerateContent part 同构),发 EventToolCall + finish_reason="tool_calls"。该解码路径尚未在真实 requires_action 事件上验证过(账号配额见底无法再触发,见第 4 条),但 502 崩溃本身是实测的。3. kind=2 目标编码曾丢失 tools
encodeModelInteractionTarget不写interaction[7],请求声明的 tools 到不了上游(模型回复"工具不在工具集内")。PR 第三个 commit 补上编码(仅在请求显式声明 tools 时写 field 7,不注入目录默认工具,与官网抓包一致)。任务路径端到端未验证(429 挡住)。4. 任务路径配额远小于 GenerateContent(实测现象,口径未知)
同一 Pro 账号上观察到:
RESOURCE_EXHAUSTED(google.rpc code 8)可确认:任务路径的配额池与 GenerateContent 不同且小得多。不可确认:窗口口径(滚动/日/月)、是否与 deep-research 等代理任务共池——我没有任何关于池语义的数据,只是观察到现象。
5. flagged 账号上 GenerateContent 仍被服务端接受(单账号单日样本)
实验:在目录解析层抹掉 kind=2 的 interaction 能力标记,让该账号的 gemini-4 走 GenerateContent——服务端正常 200,含 tool_calls 响应。说明目前对 kind=2 的迁移是目录层引导而非后端强制。
结论边界