Repository navigation
fix(app): 恢复 Pure API 旧线程时保留模型与推理档位 - #2742
Open
Yuimi-chaya wants to merge 6 commits into
Open
Yuimi-chaya wants to merge 6 commits into
Yuimi-chaya wants to merge 6 commits into
Conversation
Owner
|
感谢细致排查!有两点想先确认:
另外请 rebase 到最新 main(cdp_bridge 测试已移到 tests/all/)。谢谢! |
Yuimi-chaya
force-pushed
the
codex/preserve-thread-model-20261028
branch
from
October 29, 2026 09:45
380176c to
170906f
Compare
Owner
|
感谢按意见收窄并撤回默认模型的改动,测试也很完整!合入前还有一个顾虑:按你表格里的结果,只带线程 ID 的恢复会还原保存的 建议的思路:Pure API 下遇到无字段的恢复,先读出线程保存的模型和推理档位,再带上当前供应商 + 这些设置一起恢复,这样既不被全局默认覆盖,也不会留在 |
Yuimi-chaya
force-pushed
the
codex/preserve-thread-model-20261028
branch
from
October 29, 2026 14:19
170906f to
c526879
Compare
Owner
|
感谢按思路实现,恢复路径清楚!还有两点:
|
This branch has not been deployed
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.
问题
Pure API 恢复旧线程时,补入当前
modelProvider会使原生跳过模型、推理档位和供应商的成组恢复。例如,线程保存的是gpt-6.1-terra / xhigh,全局默认是gpt-6.1-sol / medium,恢复后可能把后者写回线程。只放行完全没有模型和供应商字段的请求仍不够:原生请求可能携带
model: null、空的可选配置,或者仅携带供应商字段。这些字段存在不代表用户明确选择了模型。另外,模型目录过滤会把宿主已有的默认模型描述符替换为当前目录的首选模型,并带入默认的medium,也可能影响线程恢复时的选择。修复
defaultModel、default_model或线程模型;对仍匹配旧注入值的快照执行撤销。新增描述符保持isDefault: false,后端供应商默认配置不删除。新建线程未显式指定模型时仍交由原生配置回退,旧线程则使用自己的保存设置。此修复阻止后续恢复覆盖模型,不自动修复此前已经写入历史库的错误选择。
验证
2bf4dfdf;发布分支已更新至 mainb70bcf26,原有 12 个变更文件与验收源码逐字节一致。使用实际
codex-cli 0.165.0-alpha.1.2、独立 home/workspace 和合成旧线程完成 9 组原生复现及回归。保存设置为Terra / xhigh / openai,全局默认为Sol / medium / custom;上游仅连接本机模拟接口,不复制用户会话或凭据,不发送真实模型请求。Sol / mediumTerra / xhigh,恢复为custom,续发走当前供应商模拟地址Terra / xhigh,续发走当前供应商模拟地址Windows 测试包已由用户在其一直使用的纯 API 接入环境中实测通过,反馈模型覆盖问题已解决。用户未单独报告“openai 历史线程 + 关闭供应商同步”这一特定组合;该组合的恢复、续发和供应商定向由上述原生隔离测试验证,不将模拟上游测试描述为真人供应商连通验收。