sub2api icon indicating copy to clipboard operation
sub2api copied to clipboard

使用gpt5.5的情况下,Invalid Value: 'tools'. Function 'image_gen.imagegen' conflicts with a hosted tool in the same request. 使用的混合中转,登陆了openai账号 但是模型请求走的自建sub2api。

Open hl9565 opened this issue 4 months ago • 1 comments

{ "error": { "code": null, "message": "Invalid Value: 'tools'. Function 'image_gen.imagegen' conflicts with a hosted tool in the same request.", "param": "tools", "type": "invalid_request_error" } } 使用的混合中转,登陆了openai账号 但是模型请求走的自建sub2api。 版本号 v0.1.151

hl9565 avatar Jul 11 '26 02:07 hl9565

我这边也能稳定复现同样的问题。

环境/现象:

  • SUB2API 使用账号级「Codex 图片工具 -> 强制注入」;
  • Codex 客户端请求中已经自带新版 namespace/image_gen(函数名 image_gen.imagegen);
  • SUB2API 又注入 hosted {"type":"image_generation"} 后,上游返回:
{
  "error": {
    "message": "Invalid Value: 'tools'. Function 'image_gen.imagegen' conflicts with a hosted tool in the same request.",
    "param": "tools",
    "type": "invalid_request_error"
  }
}

对照测试:

  • 改为「关闭注入」后,客户端自带的图片工具可以正常放行;
  • 直接向同一自定义端点 /v1/responses 显式提交 image_generation,可以正常生成图片;
  • 因此更像是“强制注入”没有对 Codex 已携带的 namespace/image_gen 与 hosted image_generation 做冲突检测/去重,并非端点或账号本身不支持生图。

建议在 bridge 注入前同时检测顶层 tools 和 input[].additional_tools:若已经存在 type=namespace && name=image_gen,则跳过 hosted image_generation 注入,或做统一转换,避免两类图片工具同时出现在同一请求中。当前临时规避方式是使用「关闭注入」。

thinktip avatar Jul 12 '26 08:07 thinktip