fix(agent): 适配 OpenCode 模型请求头 - #418
Merged
Merged
Conversation
为所有模型请求统一添加应用 User-Agent,并为 OpenCode 请求补充稳定会话标识,覆盖主 Agent、子 Agent 和上下文压缩调用。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 标题
fix(agent): 适配 OpenCode 模型请求头
变更说明
x-opencode-session,自定义兼容提供商的调用因此返回MissingSessionID。User-Agent;识别 OpenCode provider 或opencode.aiendpoint,并补充稳定会话头;会话 ID覆盖主 Agent、子 Agent、上下文压缩和独立模型调用。关联 Issue / PR
Closes #381
变更类型
问题原因
项目将自定义 OpenCode Go endpoint 按
openai-compatibleprovider 保存,原有请求工厂无法仅凭 provider 类型识别 OpenCode;同时 Agent 会话 ID没有传入模型客户端,导致请求缺少x-opencode-session。自查清单
补充信息
无