有没有佬友遇到过Opencode接入CLIProxyAPI以后一轮对话就中断的?

CLIProxyAPI是按大佬的教程搭建的
https://linux.do/t/topic/1362485
反代了反重力,Cherry studio验证是可行的

Opencode的接入是按这位大佬的教程接入的

调用都没啥太大的问题,但是试了好多次都是一两次就中断了,Build或者Plan都是如此。

是有什么设置不对吗,搜了半天没找到相关的内容。

19 个赞

多个反重力的2API项目对于内容转换均有问题

4 个赞

是不是写项目的时候kill了进程?我刚才也是,一轮对话就断。才发现会自动kill进程 :rofl:

我之前用的那种免费云容器安装cliproxy遇到过你这种问题,问一个问题,接下来就断了,后来不断测试才发现是容器给切断了,我换到独立的VPS上就没这个问题了

还有网络丢包频繁的话也会这样

看一下这个呢

1 个赞

我在win上直接运行的cliproxy,终端一直在,我输入opencode项目输入继续以后也不需要重启进程,应该不是这个原因

感谢佬友,我试了一下,还是会中断,还是一到两次 :joy:

opencode 通过openai兼容 使用cla 的Gemini模型 在调用工具后就会停止。
大概原因是tool call的finishreason有问题

我也发现了,目前除了这个还有其他选择吗佬

我试了试反代出来的GPT-OSS也是中断,还是说实际上这个GPT-OSS已经在antigravity里面转换为gemini的规则了?

cla里的 Gemini cli 和反重力在调用工具后的都会断,

2 个赞

用插件 "npm": "@ai-sdk/anthropic", 或许可以避免这个问题。目前用 CLIProxyAPIPlus 畅用 Antigravity 和 Kiro 的反代 claude,没啥问题,除了没法 WebSearch。

 "CLIProxyAPIPlus": {
      "npm": "@ai-sdk/anthropic",
      "name": "CLIProxyAPIPlus",
      "options": {
        "baseURL": "http://localhost:8318/v1",
        "apiKey": "sk-123456"
      },
      "models": {
        "gemini-3-pro-preview": {
          "name": "gemini-3-pro-preview",
          "reasoning": true,
          "tool_call": true
        },
        "gemini-claude-sonnet-4-5": {
          "name": "gemini-claude-sonnet-4-5",
          "reasoning": true,
          "tool_call": true
        },
        "kiro-claude-opus-4-5-agentic": {
          "name": "kiro-claude-opus-4-5-agentic",
          "reasoning": true,
          "tool_call": true
        }
      }
    },
19 个赞

!
解决问题了,现在可以正常使用了。感谢感谢! :folded_hands:

只有 opencode 支持这么用插件吗?

我用你的方法后,WebSearch也可以用啊

1 个赞

对于反代Gemini来说,使用@ai-sdk/google即可正常使用。例:

{
    "$schema": "https://opencode.ai/config.json",
    "provider": {
      "claude-proxy": {
        "npm": "@ai-sdk/anthropic",
        "name": "Claude逆向",
        "options": {
          "baseURL": "*****"
        },
        "models": {
          "gemini-claude-opus-4-5-thinking": {
            "name": "Claude-4.5-Opus-thinking"
          },
          "gemini-claude-opus-4-5-thinking(xhigh)": {
            "name": "Claude-4.5-Opus-thinking-xhigh"
          }
        }
      },
      "gemini-proxy": {
        "npm": "@ai-sdk/google",
        "name": "Gemini逆向",
        "options": {
          "baseURL": "********"
        },
        "models": {
          "gemini-3-pro-preview": {
            "name": "Gemini-3-Pro"
          },
          "gemini-3-pro-preview(high)": {
            "name": "Gemini-3-Pro-High"
          },
          "gemini-3-flash-preview": {
            "name": "Gemini-3-Flash"
          }
        }
      }
    }
  }

4 个赞

折腾三天了,还是没搞定,现象就是抽一鞭子动一下,不自动跑起来。

"cliproxyapi-claude": {
  "npm": "@ai-sdk/anthropic",
  "name": "cliproxyapi-claude",

噢不错,我也再试试

这个配置要怎么用啊,放在哪里