preserve_reasoning treats OPENAI_BASE_URL as a first-party OpenAI destination
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in pkg/model/provider/openai: compare Client.firstPartyOpenAIDestination, which reads the ModelConfig.BaseURL field, with Client.effectiveBaseURL, which the issue says reasoning replay already uses. Check how preservesResponseState and shouldMergeConsecutiveMessages consume the result. Done means that OPENAI_BASE_URL pointing at a non-OpenAI host disables reasoning replay, and a test covers that case. Confirm the intended behavior with maintainers before changing shouldMergeConsecutiveMessages.
由索引模型根据 Issue 内容生成。
描述
Description
pkg/model/provider/openai decides whether a destination is first-party OpenAI in Client.firstPartyOpenAIDestination, which reads ModelConfig.BaseURL. openai.NewClient resolves the effective endpoint differently — base_url, then OPENAI_BASE_URL, then https://api.openai.com/v1 — and stores that result on the embedded config (base.Config.BaseURL). The OpenAI Go SDK also honours OPENAI_BASE_URL on its own.
A model config that names no base_url but points the environment at a local server is therefore classified as first-party OpenAI.
Expected Behavior
provider_opts.preserve_reasoning should not replay encrypted OpenAI reasoning items to an endpoint that is not OpenAI. The first-party determination should consider the endpoint requests actually go to, the way reasoning replay now does in #4485 (Client.effectiveBaseURL).
Actual Behavior
With provider: openai, no base_url, and OPENAI_BASE_URL=http://localhost:8080/v1:
firstPartyOpenAIDestination()returns true, sopreservesResponseState()is on and reasoning items captured from OpenAI are replayed to the local server.shouldMergeConsecutiveMessageshas the same blind spot — it also reads the config field — though that one only affects consecutive-message merging.
Reaching it takes an explicit preserve_reasoning: true, so the blast radius is narrow, but the effect is the opposite of what firstPartyResponses' own comment intends ("Opaque state must not leak to a different vendor's compatible endpoint").
Steps to Reproduce
- Configure
provider: openaiwithprovider_opts: {preserve_reasoning: true}and nobase_url. - Export
OPENAI_BASE_URL=http://localhost:8080/v1against llama.cpp or vLLM. - Run a turn that captures reasoning items, then inspect the next request body.
Additional context
Found while fixing #4363 in #4485. That PR deliberately leaves this path alone: it predates the PR, belongs to the Responses mechanism rather than Chat Completions, and changing it there would widen a review that is already about a different default. Happy to follow up with a PR.
- 主要语言
- Go
- 星标
- 4.4k
- 派生
- 508
- 平均合并
- 7 小时 2 分钟
- 30 天内合并 PR
- 233
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docker/docker-agent 的其他 Issue
-
DMR provider ignores integer `provider_opts.context_size` (YAML integers decode as uint64), so the model starts at its maximum context可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area/config area/providers/docker-model-runner
难度 2/5 1-3 小时 新手友好度 82/100
docker/docker-agent#4522 · 3 条评论 ·
维护者通常 1 天内回复
-
pkg/hooks tests fail with a misleading assertion when jq is not installed可能已有人在做 @dwin-gharibi 于 52 天前认领。 未关闭area/testing
难度 2/5 1-3 小时 新手友好度 86/100
docker/docker-agent#4052 ·
维护者通常 1 天内回复
-
`remove_directory` and `create_directory` hide work they already did when a later path fails可能已有人在做 @dwin-gharibi 于 70 天前认领。 未关闭area/tools
难度 2/5 1-3 小时 新手友好度 85/100
docker/docker-agent#3933 ·
维护者通常 1 天内回复
-
`edit_file` silently edits the first match when `oldText` occurs more than once可能已有人在做 @dwin-gharibi 于 70 天前认领。 未关闭area/tools
难度 2/5 1-3 小时 新手友好度 78/100
docker/docker-agent#3929 · 2 条评论 ·
维护者通常 1 天内回复
-
area/providers/openai
难度 3/5 半天 新手友好度 70/100
docker/docker-agent#4593 ·
维护者通常 1 天内回复
查看 docker/docker-agent 的全部 Issue
相似的 Issue
-
perf(translator): Claude→Responses stream re-validates the whole request body on every SSE chunk未关闭
难度 2/5 1-3 小时 新手友好度 72/100
router-for-me/CLIProxyAPI#6665 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 74/100
superplanehq/superplane#8557 · 1 条评论 ·
维护者通常 1 天内回复
-
copilot-api domain:platform go
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
docs: clarify gh api -f vs -F and @-file expansion in the gh skill可能已有人在做 @MatiasOlivera 今天认领。 未关闭enhancement
难度 2/5 半天 新手友好度 62/100
维护者通常 1 天内回复