Skip to content

Recover Steward steering receipts after Chat restart - #9200

Merged
loopx-agent merged 5 commits into
mainfrom
codex/steward-cold-receipt-20261121
Nov 22, 2026
Merged

loopx-agent merged 5 commits into
mainfrom
codex/steward-cold-receipt-20261121

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A private Steward correction can reach the original Codex Turn before its acknowledgement is lost. After Chat restarts, retrying the held queue operation now reads the original managed Codex store and settles the existing receipt when the complete native inventory confirms the same Turn, client message ID, and text. Missing or contradictory evidence leaves the original reservation pending.

This follows the private Steward steering delivery in #9185 and targets main.

Author Declaration

  • Written by: model_agent · GPT-6 · OpenAI

Implemented against

Turn-bound steering A23

Criterion Disposition Owner Validation
Preserve the requested Session, Turn, text, and ingress identity during a retry implemented Existing typed steering readback and the Codex adapter Restart with the original process stopped and repeat the same HTTP operation
Confirm delivery from the selected Host implemented Persisted native item readback and existing transcript and queue settlement Accept the exact item; retain pending on missing evidence, different text, or a different native profile

The existing retry control now receives the same delivered receipt from a freshly started Chat backend. The cold reader shares the existing stdio client lifecycle for persisted native work.

Scope And Continuation

This change covers retries against the original managed Codex store and the existing private Steward queue admission. The packaged Composer keeps the existing recovery action and makes its accessible name, tooltip, and icon identify receipt verification in the original Turn. Installed Desktop, live Feishu, and further model adoption evidence are separate end-to-end qualifications.

Validation

  • Historical tested revision: c1cde62c153cec6a495ae2000e01bc1c396a0587
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence
regression_parity passed The original qualification run left the replay unresolved on the baseline when the exact item was available after restart. The candidate confirms it and preserves the reservation for missing items, different text, and a different profile.
real_entrypoint passed The isolated wheel and Codex app-server 0.171.0-alpha.13 returned HTTP 409 after simulated acknowledgement loss, then HTTP 200 in a fresh Chat process after the original native process stopped. Recovery issued only initialize and thread/items/list. The entire run contained one native Turn start and one steering call. Inference used a local fixture.
integration passed Three focused Python steering/recovery tests, nine typed steering tests, and the packaged composer-session-admission browser scenario passed. The browser scenario uses synthetic service responses for Composer recovery and queue behavior.
static passed Ruff and the standard premerge checks passed on the exact diff, including the change-quality receipt.
manual not_run Installed Desktop and live Feishu qualification.

Validation against current main

The candidate now includes main at a6ffb3be6e7bdb48e02311ec58d618200fe0501c. The PR still changes the same three files. All six failing hosted browser jobs stopped on the same execution-observation assertion. The old target and the corresponding PR merge tree both reproduced that failure locally. The same check passes on the updated candidate, which includes the existing fix. Release job · Chat browser job · Main fix #9210

The new wheel passed the isolated Codex app-server recovery check and the packaged Composer scenario. After the original native process exited, recovery returned HTTP 200 following the simulated lost acknowledgement and initial HTTP 409. The original Turn had one start and one steer, and the repeated request returned the same receipt. Three focused Python tests, nine typed steering tests, Ruff, standard premerge and the change-quality receipt passed. The prior baseline reproduction is recorded above.

Installed Desktop and live Feishu remain separate qualifications.

Windows fixture dependency

The head-specific Windows PowerShell job failed on four captured research fixtures. The shared fixture used a socket selector on an anonymous subprocess pipe and raised WinError 10038. The fixture has identical contents on the tested base, the PR head, and main at b4e1ded.

On macOS, restricting the selector to socket behavior reproduced the four hosted failures on this exact head. Combining it with the shared fixture proposal in #9218 passed 20 tests under the same restriction. These covered the research fixtures, portable pipe behavior, and the original-turn and cold-restart steering paths. The combination was tested locally. The current shared fix at 843e531 received an independent approval conclusion. The captured research fixture step passed on native Windows at that head. The rest of its Windows job is still running.

The independent review of c1cde62 approved the existing head. The Windows job remains failed for that head.

Hosted artifact and cold HTTP replay

The Release Artifacts workflow passed all 87 distinct browser scenarios, including Composer admission and attached-host follow-up. Its three receipts bind the same candidate artifact and wheel SHA-256 44b1807e6b8afa4ba080cd3050cc723bdf09a456c09fc18407d2a1f30b701740. GitHub built merge commit 7a6dd07 with PR head c1cde62.

A separate install of that hosted wheel used the real Codex app-server with a loopback inference fixture. Simulated acknowledgement loss returned HTTP 409 and preserved the queued correction. After the original process exited, retry against a different Codex store returned 409 and left the reservation intact. Restoring the original store returned HTTP 200 after only initialize and thread/items/list. Repeating the request returned the same receipt. The original native Turn started once, received one steer, and supplied the correction to the local inference fixture exactly once. Web history contained one correction.

The independent approval still applies to c1cde62. The shared Windows fixture described above remains a separate failed check on this head.

Source Chat and private Feishu return

All three source Chat browser shards passed on this PR. The jobs exercised the compiled UI and covered the retry and upgrade window, team evidence and recovery, and Goal workspace composition. Shard 1 · Shard 2 · Shard 3

A separate check of the same hosted wheel followed the corrected Codex answer from App history through the private Feishu delivery code. A mismatched source sender produced no provider write. Restoring the sender and interrupting provider readback left one terminal message pending verification. A fresh delivery worker verified that message against the original request, Session, and Turn. Repeated reconciliation made no additional provider write or Codex request. The test used a synthetic Feishu provider and loopback inference. Live Feishu and installed Desktop validation remain open.

Three corrections and concurrent receipt recovery

The same hosted wheel ran three queued corrections against one real Codex Turn in an isolated session. The two acknowledged corrections each returned the same receipt on retry. The third returned HTTP 409 after simulated acknowledgement loss. After the original process exited, four concurrent retries returned the same HTTP 200 receipt. The fresh process used only initialize and thread/items/list. It sent no correction during recovery.

Codex started one Turn and received three steering calls targeting that Turn. The loopback inference fixture saw all three corrections exactly once and in order. App history contained all three in order, and the synthetic private Feishu provider received one terminal answer.

The three source Dashboard browser shards and Dashboard acceptance passed. Six Python shards were pending at that readback. The source Windows job failed at the shared research fixture with WinError 10038. The native Windows job on #9218 passed, with integrated hosted checks still pending. Shard 1 · Shard 2 · Shard 3

Saved answer and return to the original conversation

Chromium used the packaged UI and HTTP reader from the same hosted wheel, with a read-only copy of the isolated Codex run. At 1440 px the saved answer showed the original question and source Session. At 390 px a separate web answer stayed scoped to its own Session. Wrong Session, Turn and binding reads were refused, and a history cursor could not cross between Sessions.

Using the verified synthetic Feishu binding, Back to original conversation returned to the original Session and displayed all three corrections in order, followed by the saved final answer. The history API returned five unique messages across three pages. Reading and returning generated no workflow writes, native stream reads or synthetic Feishu sends. Both the source and its isolated copy remained byte-identical.

Live Feishu and the formally installed Desktop app remain open.

Packaged queue recovery after reopening Chat

Current proposal 9db0fb9e352917969508d376c5c2321b15607084 includes main at b4e1ded37d4ecf1d43b788cf9d870d3e1020d3ab. The earlier approval and hosted check results above describe c1cde62. This revision has its own review and CI.

The same isolated browser scenario exercised the earlier hosted wheel and a locally built wheel of the current proposal. Both used the real Codex app-server, loopback inference, and a synthetic private Feishu binding. Previously the button displayed 核对插入 while its accessible name and tooltip described insertion into the current Turn. The current button uses 核对插入 throughout, identifies the original Turn in its tooltip, and shows a retry icon. The normal active-Turn control retains its insertion label.

After reopening Chat with the original worker stopped, the browser received HTTP 409 when the native store was unavailable. The same queue row and receipt stayed pending. Restoring access and reopening Chat preserved the pending action for keyboard retry. HTTP 200 then settled the same Session, Turn, queued message, and operation. The native observer used only initialize and thread/items/list. Reopening again showed the original answer and all three corrections in order, with one receipt for the recovered correction. The full run had one initial Turn start, three initial steers, and zero Feishu writes during the browser check.

The Chat bundle and wheel built successfully. The standard premerge gate, 72 focused Python tests, nine TypeScript steering tests, and the control plane typecheck passed. Composing the head with #9218's checked revision changes only two test files, so the wheel evidence covers the same package inputs. The installed Desktop WebView and live Feishu are still separate qualifications.

Hosted wheel and three corrections through the original Composer

The release artifact run passed all 87 browser scenarios across three partitions. Each partition identifies the same wheel and source manifest. The verified manifest binds the wheel to integration commit ccfaadea3ab2, whose tree matches 9db0fb9. The isolated installed wheel also passed 72 Python steering and recovery tests.

In an isolated binding, a synthetic private Feishu message started one real Codex app-server Turn. While it was active, typing and pressing Enter in the packaged Composer queued each of three corrections. Enter alone made no native steering request. A button click at 1440 px and Command+Enter on the queue at 390 px steered the same Turn. The third correction reached that Turn, and the simulated acknowledgement loss kept it visible as Check insertion. All three corrections used separate ingress identities and the same native Thread and Turn.

After the original worker exited, the reopened page preserved the third correction when the native store was temporarily unavailable. Reopening with the store restored and pressing Enter verified the same receipt. The fresh observer used initialize and thread/items/list. Four concurrent HTTP retries returned the same receipt with no further native request. After another reload, the three corrections and one saved answer appeared in order. The run used loopback inference and a synthetic Feishu binding. It made no Feishu writes.

The current Windows job failed in the unchanged shared research fixture with WinError 10038. The fixture proposal #9218 passed its own native Windows job. Its composition with this revision changes only the two fixture test files. Current head independent review, the remaining source checks, installed Desktop WebView, live Feishu and native IME qualification remain separate.

Revocation and an in-flight receipt read

The hosted wheel for 9db0fb9 exercised both revocation orders through the bound Chat HTTP route and an isolated Codex app-server. The fixture used local synthetic inference. Both runs first lost acknowledgment after the original native steer. A retry with a different ingress returned HTTP 409 without reading the native thread.

When revocation happened first, the original retry returned HTTP 400 without any native calls and left the pending reservation intact. When receipt verification entered the existing binding lock first, revocation waited for it. The original retry returned HTTP 200 and wrote one receipt from the original Turn's persisted item. The next retry, after revocation, returned HTTP 400. Each run made one native Turn start and one steer. An unrelated binding stayed unchanged.

Receipt recovery for identical messages

The hosted wheel at 9db0fb9 queued three corrections with identical text and distinct ingress IDs against one isolated Codex app-server Turn. The first insertion received HTTP 200. The second lost its response before any native send. The third reached Codex before its acknowledgement was lost. Both uncertain requests initially returned HTTP 409.

After the original worker stopped, the native inventory contained two identical-text items with distinct client IDs. The third correction recovered with HTTP 200, and replay returned the same receipt. Retries for the second correction still returned HTTP 409 and preserved its reservation. The experiment recorded one native Turn start, two native steering calls, and two delivery events. Recovery only read the original Thread and Turn. The fixture used local synthetic inference and made no Feishu writes.

Recovery after interrupted local writes

The hosted wheel and an isolated Codex app-server exercised local write failures before the ingress receipt, queue completion record, and queue completion event. Each failure followed the original native insertion. After the original worker stopped, four concurrent retries in each case returned the same successful receipt. The missing ingress receipt required one original thread item listing. The other two failures recovered from local records without a native call. Each case retained one original Turn start, one insertion, one steering event and one queue completion event. The original transcript was unchanged.

Alternating App and private chat inputs

The current hosted wheel used one real Codex app-server Thread for three ordinary inputs in order from a synthetic Feishu binding, the App HTTP queue, and the same binding again. An App replay and a redelivered Feishu event both reused their original Turn. App showed the queue depth moving from two to one to zero. All three inputs and replies appeared once in the original history, in source order. One native model request ran at a time.

The private transport fixture recorded both Feishu replies and the App question and answer with App source labels. A repeat reconciliation made no new fixture writes or native calls. Model inference and the Feishu transport used isolated fixtures.

Bound queue input changes

The hosted wheel reproduced the bound source restriction for editing and cancelling queued App messages. Retrying each rejection preserved the original rows and revisions. Their messages still ran in FIFO order with the private transport fixture. #9227 projects this existing restriction in the App. Its isolated desktop and narrow captures show the available steering action beside the unavailable edit and cancel menu.

A local wheel combining this branch and #9227 on main eb49d6a passed 44 focused tests, the Chat build and queue input recovery smoke. The packaged browser kept Edit and Cancel unavailable for all three bound queue inputs. After the third steering acknowledgement was lost, reopening preserved the reservation and returned 409 until the native store became available. The next check returned 200 using the original native items, with one original Turn and the saved answer. The fixture made no Feishu sends.

Explicit Feishu mention during uncertain App insertion

A local wheel combining this head and #9227 with main d316980 passed 45 focused tests and the Chat bundle build. Its HTTP test used one real isolated Codex app-server, loopback inference and a synthetic private Feishu transport.

The App insertion reached Codex and its acknowledgment was lost. An explicit Feishu mention then entered the same active Turn once. Redelivery of that event reused the original result. The next ordinary App and Feishu inputs ran in their original queue order on that same Thread. The native log recorded exactly two insertions and three Turn starts.

After restarting the controller, a request for a later Turn and a request with the original native store withheld each returned HTTP 409. With access restored, three concurrent retries returned one identical receipt after a single original Turn item listing. The App message retained its queue ID and the completion receipt linked it to the original Turn. The history retained all five inputs and three saved answers in source order. Recovery made zero provider sends.

Frontend / Visual Evidence

The screenshots show the packaged conversation renderer with synthetic content at 1440 px and 390 px. The waiting row remains visible at both widths. The DOM check also verified the accessible name and tooltip on both widths.

1440 px before and after

Previous insertion icon on the held queue row at 1440 px Current retry icon on the held queue row at 1440 px

390 px before and after

Previous insertion icon on the held queue row at 390 px Current retry icon on the held queue row at 390 px

Current hosted wheel, isolated active and recovered conversation

Active Turn and queued correction at 1440 px Active Turn and queued correction at 1440 px
Queue keyboard path at 390 px Queue keyboard path at 390 px
Third correction held after acknowledgement loss at 390 px Third correction held after acknowledgement loss at 390 px
Recovered original conversation with three corrections at 1440 px Recovered original conversation with three corrections at 1440 px

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • Host or runtime integration

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 previously approved these changes Nov 21, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

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.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

私有 Steward 操作者用已有重试动作确认一次已提交通道的纠偏。 原 live adapter 消失后,既有回执无法通过重试回到已交付。 用户在原 Codex Turn 接收纠偏后丢失 ACK。重新启动 Chat 并核查同一队列项时,当前主干一直保持交付未决,本提案只在原受管 store 的完整列表含有同一 Turn、输入 ID 和原文时交付一次。 同一入站身份由原队列回执延续,冷启动只读原生库存,同一个回执继续承载最终结果。 独立使用源码 HTTP 队列和合成 stdio;作者另录真实 app-server 跨进程运行。已安装 Desktop、实时飞书以及模型采纳未在本轮复验。

改动思路 / Approach

Python 原生适配器打开短命的只读 Codex 观察者。现有 TypeScript effect 判定匹配,现有 queue settlement 负责写回。 冷读限原受管 Codex store,重读当前 Session 核对绑定,沿用原先的权限与确证阈值。 复用已有持久化线程观察者和全量读取。仅扩展已保留输入的恢复入口,避免启动新的 Turn 或恢复原进程。

具体改动 / Changes

准确头 c1cde62,merge base a6ffb3b,3 个文件,+162/-24。将三个文件的准确头与 a6ffb3b 比较。b4e1ded37d4ecf1d43b788cf9d870d3e1020d3ab 已合入新提交,merge-tree 无冲突,原反例在该主干及其整合树上分别重跑。 按修订 1be3f3d 的现有规范核对各项要求。 目标规范

  • exact-turn-ingress · Keep the original Session, Turn, input and ingress across retries.
  • same-store-delivery · Only complete matching evidence from the original managed store may settle.
  • single-settlement · Preserve one transcript event, original queue result and replay identity.

关键代码讲解

对主干的风险 / Risks

独立运行 5 项 Python steering 测试、41 项队列 HTTP 测试、9 项 TypeScript 状态测试和源码 quick premerge。丢回执用例关闭旧 native 进程再创建 ChatRuntime,在相同仓库脚本驱动的隔离 stdio 下读回原 Turn,重复调用得到同一条 delivered 回执。总计一次 Turn start、一次 steer 和一条 turn.steered 事件。 缺少持久化输入、文本不符或换到另一 Codex store 时,原队列预留保持 pending,FIFO 无法领取。复用同一丢回执断言,当前主干在返回原 store 后仍报 live_steering_delivery_unresolved,干净合并树通过。 精确源码和干净整合树上的冷读通过;同一冷读证明在未改主干失败。选择未改 UI 的既有 HTTP 路由覆盖回执与失败行为。 独立冷读验证使用合成 native 对端。真实推理中的纠偏消费与后续工作仍需分别观察。

我的整体评价 / Verdict

批准。当前准确头满足一次交付、同 Turn 和同 ingress 的 A23 要求。恢复结果继续由原队列动作读回。无证据时的保留行为有回归覆盖,后续真实推理中的纠偏采纳仍可按原生消费和实际工作结果单独验证。

English verdict: APPROVE at c1cde62. Approve this exact head. The cold read settles the original reservation only on matching complete evidence. The same restart witness fails on current main and passes on the clean merge tree. Wrong or missing evidence leaves the reservation intact.

…ceipt-20261121

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

mergify Bot commented Nov 22, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @huangruiteng.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 22, 2026
loopx-agent
loopx-agent previously approved these changes Nov 22, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

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.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

私有 Steward 操作者通过原 Chat 队列确认一次已经提交的纠偏。 旧 native adapter 退出后,已接收但丢失 ACK 的纠偏持续显示交付待核对。 重开 Chat 后重试同一条队列预留,原受管 Codex store 提供完整且匹配的 Turn 输入时恢复交付。 同一纠偏在原对话中可读回;证据不完整时继续保留预留。 独立运行使用隔离源码环境;截图取自 PR 附件。本轮未重跑安装版 Desktop、真实飞书或模型对纠偏的采纳。

改动思路 / Approach

短生命周期的只读 Codex 观察者读取原线程项目,类型化判定匹配后交给原队列写入回执。 沿用持久化 Codex home、原 Session/Turn 和现有入站权限;重试前后重核绑定。 复用线程观察者、已有分页读取及回执写入,避免新增线程或恢复原执行进程。

具体改动 / Changes

准确头 9db0fb9,merge base b4e1ded,4 个文件,+171/-29。复审当前代码和按钮文案,并复核旧批准对应的提交已不同。 按修订 1be3f3d 的现有规范核对各项要求。 目标规范

关键代码讲解

  • 队列恢复 从原回执恢复入站身份,冷读后重验 Session。

  • 原生读回 只向原受管线程观察者读取指定 Turn;类型化匹配 核对原文本与 ID。

  • 队列按钮 根据预留状态投影操作名称;重启回归 核对原回执和原生调用次数。

  • A23-same-turn 同一 Turn 与入站身份:复用原队列预留。

  • A23-complete-evidence 完整证据:有缺页或错误输入时保留待核对。

  • A23-single-delivery 单次交付:重复核对读回同一条确认。

对主干的风险 / Risks

110 项 Python 队列、steering 和 readback 测试及 9 项 TypeScript 测试通过。独立用例把匹配项放在第二页,关闭旧进程后复用原 Session、Turn、入站 ID 和队列预留,连续重试得到同一回执,只记录一条 turn.steered,原生请求中仍只有一次 Turn start 和一次 steer。 独立用例同时验证第一页虽有匹配项、后续 cursor 重复时仍保持 pending,FIFO 不可领取。证据缺失、原文不符或切换 Codex home 也保留预留;恢复后没有重复发送。 在当前准确头执行源码 premerge、相关 Python 测试和 TypeScript steering 测试,并独立检查当前主干三方合并。 前端构建与源码标准 premerge 通过。对已取证的当前 main 02fd18d 做三方合并检查,codex_adapter.py 仍有内容冲突,两侧均改动原生适配器。批准针对当前 PR 提交;解决冲突后应对新头重跑冷读、失败证据和队列用例。

我的整体评价 / Verdict

批准。短生命周期的只读 Codex 观察者读取原线程项目,类型化判定匹配后交给原队列写入回执。 沿用持久化 Codex home、原 Session/Turn 和现有入站权限;重试前后重核绑定。 当前提交满足 A23 的冷恢复、无证据保留和同一回执单次确认。

核对了当前头打包 Chat 的桌面和 390 px 截图。重试图标、核对插入和暂停自动出队的提示在原 Composer 上方可见,窄屏长消息换行后仍保留恢复操作。已恢复图中第三条纠偏出现在原对话;本次 UI 调整仅涉及操作标签和图标,既有消息展开结构沿用。 独立运行使用隔离源码环境;截图取自 PR 附件。本轮未重跑安装版 Desktop、真实飞书或模型对纠偏的采纳。 桌面待核对 窄屏待核对 恢复后原对话

English verdict: APPROVE at 9db0fb9. Approve the exact head. Original-store pagination resolves the held ingress once; a repeated cursor or a different store preserves the reservation. The current main still conflicts in the Codex adapter.

…ceipt-20261121

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 22, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · Gemini · Google · self_reported

动机

在私有个人管家受管 Codex 会话中发起排队本轮纠偏(steer)、遭遇 ACK 丢失并重启 Chat 后端后重试「核对插入」的个人用户与 Chat 队列运行时。 原执行进程重启后,虽然纠偏文本已送达 Codex 原 Turn,但队列仍无限期滞留 pending 且冻结后续 FIFO 消息出队,迫使用户重复发送纠偏甚至人工清理会话状态。 改动前(含主干叠加 #9179/#9021 后)Chat 进程重启丢失内存 live adapter 后,reconcile_steering_delivery 无法读取持久化线程条目,重试持续返回 live_steering_delivery_unresolved 且阻塞后续 FIFO;改动后复用 CodexAppServerAdapter._persisted_thread_observer 打开只读 stdio 观察者调用 persisted_steering_delivery_readback,在严格校验 session_mode/codex_home/绑定未变与完整 thread/items/list 后单次结算原回执,并将 Composer 挂起按钮图标与无障碍标签统一为「核对插入」。 重启后重试同一持有纠偏在缺失条目、文本不符或切换 codex_home 时保持 pending(HTTP 409 / live_steering_delivery_unresolved)与零误入队,切回原 store 且完整清单匹配时单次结算返回 delivered 并仅写一条 turn.steered;并发合并主干 #9021/#9179 后上述回归与全套 steering/report/premerge 门禁均通过。 本 PR 不支持在未验证完整清单或跨 codex_home 时放行纠偏,不恢复已退出原生执行进程或新开 Turn,也不改动桌面安装态或真实飞书端到端发信验收。

改动思路

原 PR 已在 9db0fb9e 获得独立 GPT-6.2-sol 批准,唯一遗留为与 origin/main 在 codex_adapter.py 的合并冲突(主干 #9021 在 failed_request_observation 中增加了 in_progress_contradiction 状态回退与 #9179 路径清理)。本次干净合入最新 main 并将 _persisted_thread_observer 上下文管理器包裹完整 #9021 循环,同时保留 in_progress_contradiction 返回与统一 finally: native.close() 清理,零平行机制且完全复用 chat.queue.steering_readback TypeScript 状态机与 _control_items 全分页守卫。

具体改动

依据规范 Turn-bound steering (A23)(spec_ref: https://github.com/loopx-project/loopx/blob/1be3f3d6eb7b9dce5b799143016e17d991a9be18/docs/architecture/rfcs/capable-manager-semantic-handoff-v0.md#L934-L950, spec_revision: 1be3f3d6eb7b9dce5b799143016e17d991a9be18),准确提交 dd6ef73b53eac4c403292c33effea44ae58c52aa 严格收敛于 4 个文件(+171 / -29):

  • exact-turn-ingress -> implemented:通过 queued_admission.py 保留原 Session、原 Turn、原文与 client_ingress_id;
  • same-store-delivery -> implemented:通过 codex_adapter.py 仅对原 checked_session_home 受管 Codex 存储只读校验,不符/跨目录/缺页一律维持挂起;
  • single-settlement -> implemented:确认后仅记录一次 turn.steered 与 delivered,UI 显示为「核对插入」。

关键代码讲解

  1. CodexAppServerAdapter._persisted_thread_observer 与 failed_request_observation:抽取只读 stdio 观察者上下文管理器,安全包裹合入后的 #9021 in_progress_contradiction 分支,确保绝不调用 thread/start / resume / turn/start 且稳定释放子进程。
  2. CodexAppServerAdapter.persisted_steering_delivery_readback:复用 _persisted_thread_observer 与 _control_items 游标分页读回完整 thread/items/list 清单。
  3. reconcile_steering_delivery:在无内存 live adapter 时校验受管 Codex 非项目绑定身份、checked_session_home 一致性与 9 项不可变 Session 字段未漂移,经 chat.queue.steering_readback 确认 inventory_complete=True 且精确匹配唯一 userMessage 后单次结算。
  4. QueuedMessage:挂起 steering 状态切换为 RefreshCw 图标与「核对插入 / Check insertion」标签,明确区分于首次发送纠偏。

对主干的风险

  • 风险评估(低):只读冷恢复路径严格限于私有管家受管 Codex 会话(project_context is None),异常或证据不匹配均 fail-closed 返回 None -> live_steering_delivery_unresolved,不会误放行 FIFO 或跨家污染,且 #9021 in_progress_contradiction 与 #9179 模块拆分契约完整保留。
  • 准确头 dd6ef73b53eac4c403292c33effea44ae58c52aa 独立实测矩阵:
    • node --test tests/control_plane_ts/chat_queue_steering.test.ts:PASS(9/9)。
    • npm --prefix apps/presentation/dashboard run build(tsc --noEmit && vite build && build:chat):PASS。
    • uv run --extra test python -m pytest -n auto tests/test_lark_private_conversations.py -k 'steer or cold or receipt or contradiction' -q:PASS(18 passed in 19.69s,含冷读恢复与反例全过)。
    • .venv/bin/python -m pytest -n 6 tests/test_native_steward_reports.py -k '...' -q:PASS(72 passed in 142.93s)。
    • ruff check & mypy --follow-imports=silent(变动行零新增问题):PASS。
    • loopx check(errors=0, warnings=0)& canary premerge --tier quick --from-git-diff --git-diff-base origin/main:PASS(direct=6/6, catalog=3/3, failures=0)。

我的整体评价

原因:视觉核查 PR 附件中已打包 Chat 渲染器的 1440 px 桌面端与 390 px 窄屏实际截图,并核对当前精确 head dd6ef73 相对 9db0fb9 在 conversation-queue.tsx 的代码零差异且当前头前端全量构建通过;仅修改挂起队首行按钮文案与图标,未改动对话流布局与展开面板结构。 未验证范围:本次合并后 head dd6ef73 在桌面安装态应用与真实飞书会话里的端到端实盘触发尚未复跑(本轮已重跑前端构建、TS 单测、Steward 队列/冷读与 #9021 并发合并回归及 canary premerge)。

准确头 dd6ef73b53eac4c403292c33effea44ae58c52aa 已消解与最新 main 的单点冲突并完整保持原有 A23 冷读不变式、#9021 矛盾保护与视觉呈现质量,本地全链路门禁均已通过,批准合并。

English verdict: APPROVE at dd6ef73. Cleanly resolves the codex_adapter.py merge conflict against latest main while preserving #9021 contradiction handling and all A23 cold-recovery invariants; TS/frontend build, focused cold-steering & steward_reports suites (9 + 18 + 72), ruff, loopx check, and canary premerge quick all pass.

@loopx-agent
loopx-agent merged commit bbd2683 into main Nov 22, 2026
11 of 13 checks passed
@loopx-agent
loopx-agent deleted the codex/steward-cold-receipt-20261121 branch November 22, 2026 08:53
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