Skip to content

fix(chat): apply model settings within the current conversation - #7346

Merged
huangruiteng merged 6 commits into
mainfrom
codex/current-session-model-settings
Oct 26, 2026
Merged

huangruiteng merged 6 commits into
mainfrom
codex/current-session-model-settings

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Selecting a model previously required a new conversation. Ordinary Codex conversations now save model and reasoning choices on the current Session and confirm them on its original native thread before subsequent work. Active work keeps its observed configuration. Saving starts no Turn, thread or history replay. Refusal retains the draft and allows correction in the same conversation.

Malformed request identities are validated by the existing Session codec before native preparation: the production HTTP/native regression first reproduced a configuration 424 instead of identity 400, then passed with no new native packets. Completed-request recovery still returns the original receipt, even after a later unsupported model choice; a changed payload with the same request identity remains a conflict. Host-owned, steward, registered-Agent, bound-audience, native Goal and legacy migration conversations retain their existing settings owner. This does not change account routing, machine defaults or execution grants. The conversation RFC is updated in both languages.

Validation and holds

  • 78 focused backend tests passed, including current-Session identity, busy updates, grant/closed/write failures, Session isolation and completed-request recovery. The packaged production Chat HTTP/store plus deterministic native app-server journey passed: idle/busy selection, queued adoption, reload, original thread/history, native refusal, retained draft and recovery.
  • The completed-request counterexample failed before the repair with HTTP 424 instead of its original 202 receipt; after the fix it returns that same Turn, creates no new native packets and preserves conflict rejection.
  • The 114 queue/steering tests also passed (192 focused backend cases in total). TypeScript/build, bilingual UI assertions, model selection/retry journey and the maintainability ratchet passed. The model-specific logic was consolidated under the existing native Chat configuration owner rather than increasing the runtime/server budgets.
  • Merge hold: required examples/control_plane/peer-agent-runtime-v1-smoke.py fails at both immutable base 2b72d30fca7f452a71dffb723ebf6d1e2e878484 and the reviewed source. The unchanged hard-cut check finds legacy continuation-policy values in loopx/control_plane/todos/read_codec.ts:219. Complete normalized failure details match. This remains a required failure; no gate or limit was weakened.
  • An optional interrupt-event diagnostic also fails identically at base and head; it is retained as failed. No CI was consulted under the configured review policy. Native installed input, live model execution and cross-channel synchronization remain unqualified. No private conversation was replayed or used for test sends.

Visual evidence

Reviewed source 6b30b203ddb6742a9d86cbe3dbfa2102febb232f. Public-safe synthetic conversations in the packaged production UI with production HTTP/store and a deterministic native peer. The captures were made at b0c90a134490557b10caab32a272c18e1495cd82; frontend source and capture bytes are unchanged at this head. Desktop 1440×900 and expanded 390×844 states were visually inspected. Conversation and draft remain primary; runtime readback stays separate from the saved subsequent choice, and optional help uses the shared disclosure. These captures do not certify installed-user acceptance.

Before: new-conversation-only settings

Active Turn remains high; subsequent choice is low

Expanded narrow menu retains the draft and Send

Native refusal retains the conversation and draft

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

未发现本次精确 head 仍未修复的阻塞代码问题,结论 APPROVE;必需预合并检查仍失败,暂不合并。评审对象:a24d8ad2604ce049d61eb0ae8bb4940e7d892967。

动机

普通 Codex 对话中需要调整后续模型或思考深度的用户。
原来选择新模型会要求新建会话;现在保存到当前会话,后续消息沿原线程采用,活动回合保留实际配置。
已验证同一会话保存、后续请求参数、队列采用和失败恢复;保存本身不执行模型工作。
本改动不切换账号或全局默认,不重配外部宿主、管家或注册 Agent,也不代替真实模型质量验收。
安装态和真实模型调用未验;原宿主、管家及跨渠道配置沿既有 owner 继续。

这会减少调模型时另开对话、重新找历史的负担。本轮是可单独回滚和验收的 ordinary Codex 增量,不代表完整聊天、研究工作台或跨 provider 目标已完成。

改动思路

模型选择、保存和原线程确认属于同一个现有 Chat owner;沿原队列与回执恢复完成闭环,比新增会话、配置副本或通用配置框架更小。
当前 PR 交付普通 Codex 会话原位重配及后续采用;原宿主、管家、跨渠道和安装态验收留在既有 owner,不以此阶段关闭父任务。

保存动作只写入用户的后续选择;实际模型仍以原生运行时回读为准。已有活动回合继续用它的原配置,后续消息才沿原线程恢复、确认并发送。仅修改 turn/start 参数无法提供已确认的模型回读;仅换标签则根本没有修复实际调用。这里复用原 Session store、native resume、队列、接收回执和 ContextHelp,没有新增调度器或配置 authority。

用户动作 原行为 本次行为
更改模型或深度 要求新 Session 保存到当前 Session,暂不执行
已运行回合 原有实际配置 继续保留实际配置,后续选择单列
找回已完成请求 后来坏配置可能先被检查 返回原 Turn 回执,不做新原生操作
新消息被原生配置拒绝 容易进入新会话恢复 草稿和原会话保留,可修正再发

具体改动

以预先接受的 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md、版本 2b72d30fca7f452a71dffb723ebf6d1e2e878484 为连续性与授权基准;新模型小节描述本次用户纠正,不拿改写后的规范反推成功。

  • workspace-thread-continuity:已实现。原 Session/thread、工作目录与历史沿现有 resume owner 保留,打包 HTTP/native 路径检查没有新增 thread/start。
  • current-workspace-grant:已实现。保存前后重查原 workspace grant 和 profile,catalog 读取间关闭会话仍拒绝;来源/受众不能由请求 body 冒充。
  • fixture-live-boundary:已实现。双语文档、描述和截图标明源码/打包/原生协议与安装态、真实模型的区别,未将隔离协议结果升级成用户真实采用。

关键代码讲解

  1. model_settings.configure_session_model 校验精确当前会话与 provider 提供的模型/深度,复用已存在的 requested 字段;最终写入有状态 CAS,保存不创建 Turn。支持性由同一派生读模型投射给菜单,避免 UI 自己猜权限。
  2. ChatRuntimeController._ensure_adapter_locked 只在回合之间采用 pending 选择,在原 thread/resume 中验证实际模型/深度。活动 adapter 保留;已受理的队列继续由原队列处理失败和恢复。
  3. ChatRuntimeController.submit_turn 在新消息受理前确认配置,保留确定未投递的草稿。自审实际发现旧请求会先碰到后来的无效配置;现复用 turn_for_client 将已有身份交回 accept_managed_turn,原回执恢复与冲突判定不受后续选择影响。
  4. chooseAgentModel / chooseAgentReasoningEffort 不再删除当前 Session 映射。ChatModelMenu 区分实际回读与保存的后续选择,await 保存后更新引用,并把失败、重试与该 composer 上下文绑定。

新增 API mixin 实际被 ChatRequestHandler 加载,现有 controller 方法仍有真实 HTTP 和测试调用。模型目录与观察配置从大 runtime/server 收拢到既有 native_chat 模块,维护性预算通过,没有抬高上限。英中 RFC 同时修改;测试延伸已有 HTTP、队列和浏览器入口。

对主干的风险

最强反例是“历史消息已完成,后来选了无效模型,再重取旧回执”。新增真实 HTTP/native 用例在 647f1c21a2ddb7efc8bbd6d3c86edab4e1b20b88 先复现 424 而非原 202;当前修复返回相同 Turn、created=false,且原生包数不变。相同请求 ID 换正文仍冲突,新消息配置拒绝仍不创建 Turn。75 项模型/HTTP/配置和 114 项队列/steering 测试通过;完整打包原生协议旅程通过。真实 provider 是边界外的依赖,不声称已测试其模型质量或账号切换。

语义与 CI 对齐

有意改变的是“为新会话设置”到“当前会话后续消息”;本轮实际模型、原始受众、单执行者和未知投递的恢复权没有改变。复用现有 requested/actual 字段与 unsupported_configuration;supported/pending 是派生状态,没有新持久 authority。provider IO 留在既有 Python Chat owner,没有增加通用 Core 业务规则。

按配置未查询、轮询或等待 CI。本地 premerge 的 hygiene、双语、编译及维护性 ratchet 通过,19 项选择检查中 18 项通过;required peer-agent-runtime-v1-smoke.py 仍失败。独立 base 与当前 head 的完整诊断(仅规范化 checkout 前缀)一致:read_codec.ts:219 的旧 continuation-policy 值被 hard-cut 迁移边界检查拦住。该文件和检测因果路径不在本 PR 的改动中;这不构成本 PR 回归,但仍阻止合并,不能放宽必需检查。可选 interrupt-event 诊断在两端同样保留额外 interrupt_requested 事件,完整失败断言一致,仍记 failed。三个 PNG 的自动 manual holds 也原样保留,像素人工检查不伪装成自动放行。

我的整体评价

交付判断是 justified_increment:普通 Codex 的当前会话配置和继续执行可用;long_horizon 与 user_experience 在这条路径得到改善,没有增加必需的确认、复制或新建会话步骤。模型目录响应在同输入 base/head 完全一致,保存前后数据库独立读回保留身份与实际字段;新增目录/空值/不支持/来源冒充均保持无意外写入。

已逐张检查合成完整对话的桌面展开、390px 展开及默认菜单关闭的拒绝恢复画面:对话和草稿占主位,当前运行与后续设置分区,帮助为单一图标;窄屏选择器没有挤成竖列,发送按钮仍可达。
未接管真实原生窗口,未验真实 macOS 输入法、本人消息发送或 Lark 双端;合成协议不证明真实模型已采用。

截图原始版本为 b0c90a,当前 head 的前端与图片 blob 不变,已重看原像素,另在当前源重新捕获并检查了 390px 菜单收起状态;拒绝画面保留真实失败和编辑草稿,未通过隐藏失败换取简洁。结构上保留现有 owner 与兼容入口、派生展示状态,新增机制与原问题相称。精确 head 的评审结论为 APPROVE,CQR/required-check/readiness 仍需清除上述独立合并阻塞,未执行自合并或安装。

English verdict: APPROVE — a24d8ad. Current-Session save, same-thread adoption and original-request receipt recovery are covered by production HTTP/store/native-protocol tests. Required premerge remains red on an independently reproduced, unchanged Core migration-boundary failure; merge and installed/live-model qualification remain on hold.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

未发现本次精确 head 仍未修复的阻塞代码问题,结论 APPROVE;必需预合并检查仍失败,暂不合并。评审对象:6b30b203ddb6742a9d86cbe3dbfa2102febb232f。

动机

普通 Codex 对话中需要调整后续模型或思考深度的用户。
原来选择新模型会要求新建会话;现在保存到当前会话,后续消息沿原线程采用,活动回合保留实际配置。
已验证同一会话保存、后续请求参数、队列采用和失败恢复;保存本身不执行模型工作。
本改动不切换账号或全局默认,不重配外部宿主、管家或注册 Agent,也不代替真实模型质量验收。
安装态和真实模型调用未验;原宿主、管家及跨渠道配置沿既有 owner 继续。

这会减少调模型时另开对话、重新找历史的负担。本轮是可单独回滚和验收的 ordinary Codex 增量,不代表完整聊天、研究工作台或跨 provider 目标已完成。

改动思路

模型选择、保存和原线程确认属于同一个现有 Chat owner;沿原队列与回执恢复完成闭环,比新增会话、配置副本或通用配置框架更小。
当前 PR 交付普通 Codex 会话原位重配及后续采用;原宿主、管家、跨渠道和安装态验收留在既有 owner,不以此阶段关闭父任务。

保存动作只写入用户的后续选择;实际模型仍以原生运行时回读为准。已有活动回合继续用它的原配置,后续消息才沿原线程恢复、确认并发送。仅修改 turn/start 参数无法提供已确认的模型回读;仅换标签则根本没有修复实际调用。这里复用原 Session store、native resume、队列、接收回执和 ContextHelp,没有新增调度器或配置 authority。

用户动作 原行为 本次行为
更改模型或深度 要求新 Session 保存到当前 Session,暂不执行
已运行回合 原有实际配置 继续保留实际配置,后续选择单列
找回已完成请求 后来坏配置可能先被检查 返回原 Turn 回执,不做新原生操作
新消息被原生配置拒绝 容易进入新会话恢复 草稿和原会话保留,可修正再发

具体改动

以预先接受的 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md、版本 2b72d30fca7f452a71dffb723ebf6d1e2e878484 为连续性与授权基准;新模型小节描述本次用户纠正,不拿改写后的规范反推成功。

  • workspace-thread-continuity:已实现。原 Session/thread、工作目录与历史沿现有 resume owner 保留,打包 HTTP/native 路径检查没有新增 thread/start。
  • current-workspace-grant:已实现。保存前后重查原 workspace grant 和 profile,catalog 读取间关闭会话仍拒绝;来源/受众不能由请求 body 冒充。
  • fixture-live-boundary:已实现。双语文档、描述和截图标明源码/打包/原生协议与安装态、真实模型的区别,未将隔离协议结果升级成用户真实采用。

关键代码讲解

  1. model_settings.configure_session_model 校验精确当前会话与 provider 提供的模型/深度,复用已存在的 requested 字段;最终写入有状态 CAS,保存不创建 Turn。支持性由同一派生读模型投射给菜单,避免 UI 自己猜权限。
  2. ChatRuntimeController._ensure_adapter_locked 只在回合之间采用 pending 选择,在原 thread/resume 中验证实际模型/深度。活动 adapter 保留;已受理的队列继续由原队列处理失败和恢复。
  3. ChatRuntimeController.submit_turn 在新消息受理前确认配置,保留确定未投递的草稿。自审实际发现旧请求会先碰到后来的无效配置;现复用 turn_for_client 将已有身份交回 accept_managed_turn,原回执恢复与冲突判定不受后续选择影响。
  4. chooseAgentModel / chooseAgentReasoningEffort 不再删除当前 Session 映射。ChatModelMenu 区分实际回读与保存的后续选择,await 保存后更新引用,并把失败、重试与该 composer 上下文绑定。

新增 API mixin 实际被 ChatRequestHandler 加载,现有 controller 方法仍有真实 HTTP 和测试调用。模型目录与观察配置从大 runtime/server 收拢到既有 native_chat 模块,维护性预算通过,没有抬高上限。英中 RFC 同时修改;测试延伸已有 HTTP、队列和浏览器入口。

对主干的风险

最强反例是“历史消息已完成,后来选了无效模型,再重取旧回执”。新增真实 HTTP/native 用例在 647f1c21a2ddb7efc8bbd6d3c86edab4e1b20b88 先复现 424 而非原 202;当前修复返回相同 Turn、created=false,且原生包数不变。相同请求 ID 换正文仍冲突,新消息配置拒绝仍不创建 Turn。78 项模型/HTTP/配置和 114 项队列/steering 测试通过;完整打包原生协议旅程通过。真实 provider 是边界外的依赖,不声称已测试其模型质量或账号切换。

语义与 CI 对齐

有意改变的是“为新会话设置”到“当前会话后续消息”;本轮实际模型、原始受众、单执行者和未知投递的恢复权没有改变。复用现有 requested/actual 字段与 unsupported_configuration;supported/pending 是派生状态,没有新持久 authority。provider IO 留在既有 Python Chat owner,没有增加通用 Core 业务规则。

按配置未查询、轮询或等待 CI。本地 premerge 的 hygiene、双语、编译及维护性 ratchet 通过,19 项选择检查中 18 项通过;required peer-agent-runtime-v1-smoke.py 仍失败。独立 base 与当前 head 的完整诊断(仅规范化 checkout 前缀)一致:read_codec.ts:219 的旧 continuation-policy 值被 hard-cut 迁移边界检查拦住。该文件和检测因果路径不在本 PR 的改动中;这不构成本 PR 回归,但仍阻止合并,不能放宽必需检查。可选 interrupt-event 诊断在两端同样保留额外 interrupt_requested 事件,完整失败断言一致,仍记 failed。三个 PNG 的自动 manual holds 也原样保留,像素人工检查不伪装成自动放行。

我的整体评价

交付判断是 justified_increment:普通 Codex 的当前会话配置和继续执行可用;long_horizon 与 user_experience 在这条路径得到改善,没有增加必需的确认、复制或新建会话步骤。模型目录响应在同输入 base/head 完全一致,保存前后数据库独立读回保留身份与实际字段;新增目录/空值/不支持/来源冒充均保持无意外写入。

已逐张检查合成完整对话的桌面展开、390px 展开及默认菜单关闭的拒绝恢复画面:对话和草稿占主位,当前运行与后续设置分区,帮助为单一图标;窄屏选择器没有挤成竖列,发送按钮仍可达。
未接管真实原生窗口,未验真实 macOS 输入法、本人消息发送或 Lark 双端;合成协议不证明真实模型已采用。

截图原始版本为 b0c90a,当前 head 的前端与图片 blob 不变,已重看原像素,另在当前源重新捕获并检查了 390px 菜单收起状态;拒绝画面保留真实失败和编辑草稿,未通过隐藏失败换取简洁。结构上保留现有 owner 与兼容入口、派生展示状态,新增机制与原问题相称。本次另外复核了请求校验顺序:在旧 head a24d8ad,错误请求 ID 加上待确认的无效模型会先产生原生准备并返回 424。新增真实 HTTP/native 反例先失败;当前复用 store 的 _opaque_id 校验,在任何配置准备前返回原有 400,原生包数为零。78 项配置测试加 114 项队列/steering 共 192 项通过;没有新增校验框架或改动合法请求。精确 head 的评审结论为 APPROVE,CQR/required-check/readiness 仍需清除上述独立合并阻塞,未执行自合并或安装。

English verdict: APPROVE — 6b30b20. Current-Session save, same-thread adoption and original-request receipt recovery are covered by production HTTP/store/native-protocol tests. Required premerge remains red on an independently reproduced, unchanged Core migration-boundary failure; merge and installed/live-model qualification remain on hold.

@huangruiteng
huangruiteng merged commit 05d55b7 into main Oct 26, 2026
26 of 32 checks passed
@huangruiteng
huangruiteng deleted the codex/current-session-model-settings branch October 26, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants