姜姜姜 (@zzzzls) 在 opencode中转站胡言乱语问题的解决方案 中发帖
使用opencode接入中转站 (claude, codex) 普通聊天正常, 涉及工具调用就开始胡言乱语:
示例:
opus-4.5
[image]
codex-5.2
[PixPin_2026-01-19_11-11-44]
解决方案
对于 claude 模型, 指定 npm 字段为: @ai-sdk/anthropic
对于 openai 模型, 指定 npm 字段为: @ai-sdk/openai
若报错: Unsupported parameter: max_output_tokens
在模型中额外添加如下配置:"models": {
"gpt-5.2-codex": {
"name": "gpt-5.2-codex",
"id": "gpt-5.2-codex",
"options":{
"include": ["reaso...