Skip to content

[Bug] 图片输入支持未完成: 上传成功但 StreamGenerate 返回 1003 (file not bound to conversation) #84

Description

@kingofotaku

问题描述

README 声明 #75 已支持图片输入(Chat Completions / Responses 的多模态消息),但实测图片上传成功、StreamGenerate 阶段返回 502 BardErrorInfo [1003],与 #12 记录的根因完全一致:文件引用未绑定 conversation

环境

  • Windows 11 25H2,本机部署 gemini-web2api,main 分支最新(含 feat: add OpenAI multimodal input support #75
  • 已配置有效 cookie、proxy,log_requests: true
  • 请求:gemini-3.6-flash / gemini-3.7-flashimage_url(HTTP URL 与本地 base64 均测过)

复现步骤

  1. 本地启动服务,配置 cookie.txt(有效 cookie,上传接口鉴权通过)
  2. 发送 OpenAI 格式多模态消息(含 image_url
  3. 日志显示 Image uploaded: xxx -> /contrib_service/ttl_1d/...(上传成功)
  4. StreamGenerate 返回 error 1003 (file not bound to conversation),HTTP 502

日志

[time] Image uploaded: image.png -> /contrib_service/ttl_1d/xxx...
[time] Stream error: 502 BardErrorInfo [1003] ...

分析

对照 #12 的结论:"Scotty resumable upload 上传成功, 但 StreamGenerate 拒绝引用 (error 1003) / 根因: 文件引用必须与当前 conversation session 绑定" —— 当前代码未实现该绑定:

  • multimodal.py: upload_image() 返回的 file_ref 不携带 conversation
  • gemini_web2api.py: inner[59] = str(uuid.uuid4()) 每次请求生成全新 conversation id

即:上传的 file_ref 从未绑定到请求使用的 conversation,引用时后端必然 1003。cookie/IP/BL 均与本次 1003 无关(cookie 有效、上传可通过鉴权)。

期望

  • 实现/修复 file_ref 与 conversation 的绑定(或确认有无 hidden 绑定机制)
  • 若暂无法支持,请更新 README 限制说明,避免误导用户(当前"图片上传可能需要 Cookie"的表述未指向真正根因)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions