Skip to content

Resume interrupted original tool output in the same record - #8656

Merged
cocolord merged 3 commits into
mainfrom
codex/attached-record-content-retry-20261112
Nov 13, 2026
Merged

cocolord merged 3 commits into
mainfrom
codex/attached-record-content-retry-20261112

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Goal and delivered outcome

Long tool output stays readable in its original Codex work conversation. An interrupted HTTP 200 read retries once at the same record and character offset while the disclosure is open. Closing the record or its work group cancels the pending read, including a close and reopen before the browser delivers its toggle event. Reopening keeps the loaded text and offset available for another explicit read. Permission refusals and stale records still stop the read.

Related to #8633, which covers conversation history pages.

Author declaration

Written by model_agent, Codex (OpenAI GPT-6). The original retry and the subsequent ordinary-close repair are retained in the branch history. This revision adds the coalesced-toggle boundary to the session-runtime adapter and its packaged regression.

Validation

  • Tested 139d5344e925d941cb81f1e82fce9c365ee4c5e0 against eba8a7f95f54fe09cb3dcc28bb1f55443898bbed. The preceding revision c001197817 canceled an ordinary close, but sent a second GET when a close and reopen shared one event loop turn. The new revision cancels both disclosure paths in that case.
  • The isolated wheel, with the real LoopX attached read API and a synthetic Desktop peer, held the success body until after the disclosure changed. At 1200 and 390 px the old revision appended the remainder automatically. The new revision retained the 24,000-character prefix, then read all 9,982 remaining characters from the same offset after another explicit action. The original record was byte-identical and the peer received zero inputs.
  • Exact Dashboard build, 68 native HTTP tests, the packaged attached-host journey, lint and syntax, paired RFC validation, 5 direct and 17 selected standard premerge checks passed. Exact-scope quality receipt cqr_c42091fcee7ca0de833d verified.
  • Installed desktop adoption and fresh readback against a user's original conversation remain pending.

Frontend visual evidence

The public captures use one synthetic work conversation and the packaged read-only HTTP path. Normal entry keeps messages visible and activity folded.

Desktop 1200 × 900 Narrow 390 × 900
Desktop first view with the work activity folded Narrow first view with messages and folded work activity

After an ordinary cancellation, both packaged versions reopen at the same loaded prefix. The request count above distinguishes the immediate reopen case.

Viewport Before After
Desktop 1200 × 900 Previous package reopening the tool record Current package reopening the tool record
Narrow 390 × 900 Previous package reopening the work group Current package reopening the work group
Original retry screenshots from the earlier proposal

The first viewport is unchanged. In the expanded views below, the same synthetic record is scrolled to its last loaded lines after one click and one injected interruption.

Viewport Before After
Desktop 1200 × 900 Before, desktop: the open tool record stops at the prefix After, desktop: the open tool record includes the final checks
Narrow 390 × 900 Before, narrow: the open tool record needs another click After, narrow: the final checks arrive with the first click

First view (desktop and narrow):

First view, desktop: messages are primary and work activity is folded First view, narrow: messages are primary and work activity is folded

Persistent failure on a narrow screen After two failures: the prefix stays readable and the same button remains

@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.

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

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

本次评审对应提交 ed77f42b94e8416c361b0320b875b6c5abfe40a4。

[P2] 折叠后仍在后台继续读取。 独立浏览器用实际

折叠,服务端在确认折叠后才放行首个截断响应。两个折叠入口各记录两次完全同参 GET。 把取消边界连接到实际的记录和工作过程折叠;关闭即取消在途读取,阻止隐藏重试,重新展开保留已核偏移并可显式续读。 取消逻辑

动机 / Motivation

在原 Codex 工作会话中阅读长工具输出的用户。用户展开工具结果并点继续读取,HTTP 200 的响应体断流后,旧版停在 24,000 字符预览,需要再点一次。保持记录展开时,候选版只重试一次,按原偏移读回 27,857 字符,和保存的原文逐字一致。验证使用源校验后的前端包、真实 LoopX HTTP 读取与隔离合成 Codex peer;未验证已安装桌面 App。折叠单条记录或整个工作过程后,尚未返回的读取仍会在断流时发出第二次 GET,并把结果填入已隐藏的记录。

改动思路 / Approach

保持单一 HTTP 读、原指纹与有界重试。补全关闭态再交付;不改变历史、回复或后端协议。 复用已部署的 request/retryableRead 与原 HTTP 指纹校验;按单次点读处理,不新设全局重试器。

具体改动 / Changes

关键代码讲解

loadContent 固定来源与偏移;AttachedConversationRecord 只在卸载清理。 原 HTTP reader 继续按指纹核对。以改动前的适配合同为准,original_record_detail 保留原工具记录,source_fingerprint_guard 拒绝变更来源,read_only_boundary 保留只读。 浏览器用真实 HTTP 断流,在两个视口比对同一合成原记录。已发布的回归测试有同参及无输入断言;折叠时的迟到响应需要一个受控负例。

对主干的风险 / Risks

两次断流保留预览,手动继续可读回;截断 403、完整坏 JSON、真实旧指纹 409 均只发一次;切换会话不接收迟到结果。 只读请求,两个可比版本都没有 POST、输入或原记录写入。 两种折叠都会触发同一缺口;实际切换会话不会把迟到内容带过去。

语义与 CI 对齐

两版各 68 项后端用例,候选类型与标准预合并通过。复审只需在真实浏览器验证折叠后的请求计数、保留偏移和重新展开续读。未查询托管 CI。

我的整体评价 / Verdict

请求修改。保留原同位置恢复方案,补齐记录及父组的关闭语义,再复验整个用户路径。独立查看桌面与 390 像素宽的实际前端。首屏仍以消息和折叠工作过程为主,展开后的中英长行可阅读;窄屏向下可见失败提示、原按钮和续读末行。已安装 App 上的采用未验证。折叠取消缺口由真实请求顺序复现。

English verdict: REQUEST_CHANGES. The same-position retry works. Collapsing either disclosure still issues a hidden retry and appends the late response; cancellation needs to follow the visible record lifecycle.

loopx-agent and others added 2 commits November 13, 2026 15:48
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit ed77f42)
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
@cocolord
cocolord force-pushed the codex/attached-record-content-retry-20261112 branch from ed77f42 to c001197 Compare November 13, 2026 08:13
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)

评审提交 139d5344e925d941cb81f1e82fce9c365ee4c5e0,目标主干 eba8a7f95f54fe09cb3dcc28bb1f55443898bbed。

动机 / Motivation

在 LoopX 查看已绑定 Codex 工作会话的读者,希望留在原记录里读完一段较长的工具输出。 原先响应正文断流会把读者留在预览。第一版会自动补读,但折叠后仍在后台读取。随后提交能处理普通关闭,浏览器合并快速关闭与重开时仍会多发一次。当前提交在这两种关闭方式下都停止旧请求。 记录打开时,短暂断流后可继续读完。读者折叠后仍保留已读文字,重开再点一次会从同一位置继续。 这次交付覆盖绑定会话的原记录读取。原生输入、会话所有权、后端格式与安装路径沿用现有契约。 隔离包已核验。本机原记录接口可按原身份读回,桌面 App 尚未采用这个提交。

改动思路 / Approach

已有读取函数冻结来源、记录和偏移。仅在读者点继续后,原记录组件观察包住按钮的实际展开状态,任一层关闭就取消当前请求。浏览器合并切换事件时,原生属性的变更记录仍保留这次关闭。 改动限于附属会话的记录读取、原浏览器回归和对应文档,两条双语 RFC 更新记录了同一范围。 只用 toggle 事件会漏过一次任务内的关闭再展开。观察器只在读者发起读取后注册,取消或结束即清理。另存一份分组是否打开的 React 状态既增加同步成本,也不能补回已合并的事件。原请求、偏移和本机来源的核验仍由已有读取接口承担。

具体改动 / Changes

关键代码讲解

original_record_detail 已实现。读者展开后可继续原文本,断流恢复一次,关闭会停止本次读取,重开保留已读位置。 source_fingerprint_guard 沿用来源和内容指纹,原会话以错误指纹读回 409。 read_only_boundary 沿用原会话授权,两种宽度和两个折叠入口都没有向原宿主发送输入。 原适配合同

loadContent 固定会话、记录和字符位置。 continueReading 检查真实的展开层级,onVisibilityChange 取消该请求,旧请求的清理不会覆盖后一次读取。浏览器回归先让服务端发出 200 响应头,等关闭后再放行截断正文,覆盖键盘关闭与快速重开。双语 RFC 记录并界定了原工具记录读取的验收。 固定读取范围 折叠取消 浏览器回归 双语 RFC

对主干的风险 / Risks

旧提交 c001197817fd052b4a89db190d97f5978758e45d 已能处理正常折叠。两个快速重开反例仍各发两次同参 GET,未再点继续时已拼上原文余段。当前提交在 1200 和 390 像素都仅发第一条,第二次显式请求沿同一位置补回 9,982 字符,前 24,000 字符和源记录保持一致。原会话正式接口另外核验了历史绑定的 3,989 字符余段。实际桌面采用仍待验证。 首屏与验证

语义与 CI 对齐

打包工作会话、68 项原生接口、Python 3.11 隔离 wheel、双语配对及标准 premerge 通过,变更质量回执已核。采用当前 Goal 的本地验证,托管 CI 未查。

我的整体评价 / Verdict

改动限于附属会话的记录读取、原浏览器回归和对应文档,两条双语 RFC 更新记录了同一范围。 查看了桌面和窄屏首屏与重新展开状态,消息优先,工作过程按需展开,已经读到的原文仍可见。 公开画面来自合成会话。原始私有记录只核验读取边界。正式安装和原生桌面窗口待验。 同位置续读与关闭后的取消都已通过反例,可批准这一提交。GitHub 正式评审和安装仍按现有流程处理。 验证与界面

English verdict: APPROVE. On 139d5344e925d941cb81f1e82fce9c365ee4c5e0, both disclosures cancel the original record read, including coalesced close and reopen. Explicit continuation retains the offset. Packaged, scoped negative and local validations passed. Installed desktop adoption remains pending.

@cocolord cocolord left a comment •

Copy link
Copy Markdown
Member

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 · OpenAI · self_reported

APPROVE。当前完整提交 139d5344e925d941cb81f1e82fce9c365ee4c5e0 已通过实际记录读取与关闭取消验证;CI 导航失败为同基线复现的独立问题,合入 readiness 另行记录。

动机 / Motivation

在原 Codex 工作会话中阅读长工具输出的用户。成功响应的正文断流后,旧版停在预览;当前版本在记录可见时按原位置重试,关闭则取消。这减少同一记录的重复操作,也避免关闭后继续读取隐藏内容。不启动、重发或暂停原 Agent,也不以工具记录可读性证明任务验收。已安装桌面采用、真实模型上下文保留及完整 R1/M3/成本验收仍开放。

改动思路 / Approach

读取仍经过已有 request、retryableRead 和原 HTTP reader,来源、记录指纹与字符偏移在一次点读中固定。只给可恢复的读失败一次重试,拒绝和失效来源继续停止。最初仅在卸载时取消,随后仅监听延后的关闭通知;两者都没有覆盖关闭后立即重开的完整边界。当前实现直接观察正在读取记录的原生 disclosure 属性,每次读取独立创建并释放 observer,保留原文和偏移供用户再次显式读取。

采用当前记录读取 owner 内的原生可见性观察,避免增加分组显示状态或第二套读取控制器。当前 PR 的边界是原记录的有界读取、取消与回读;native input、执行、验收和持久状态继续由原 owner 负责。

具体改动 / Changes

关键代码讲解

loadContent 在发起读取前固定原来源、记录与偏移,每次尝试前后都检查当前 binding generation、来源和取消信号。第二次仍失败时保留已有正文并给出可继续操作的提示。

continueReading 从真实按钮收集其原生 disclosure ancestors;任一已关闭时不发起读取。进行中的读有自己的 AbortController,只有同一 controller 可以清理当前读取状态,迟到的旧操作不会覆盖新操作。

onVisibilityChange 同时核对当前关闭状态与 open 属性的旧值。因此同一事件任务内先关闭再打开,仍会取消原读;成功、失败、取消及卸载均退出观察。原 read_content 继续校验来源和内容指纹,按字符偏移分页;前端不生成新的权限或记录内容。

规范依据是 docs/integrations/session-runtime-control-plane-adapter.md,修订 eba8a7f95f54fe09cb3dcc28bb1f55443898bbed,以及原关闭取消评审。original_record_detail 保留完整工具记录;source_fingerprint_guard 拒绝失效来源;read_only_boundary 不产生输入或原记录写入;visible_read_lifecycle 覆盖记录与工作分组的普通关闭和立即重开。这些条目以实际 HTTP、浏览器动作及原文比较验证。installed_host_adoption 和 managed_minimal_qualification 按现有适配合同与统一最小内核 RFC 的阶段边界保持未完成;本 PR 没有把可选记录读取提升为受管理模型任务的资格。

对主干的风险 / Risks

最主要的风险是关闭通知合并后漏掉取消,或旧读取的结束回调清理了新读取。当前读取直接观察其实际 ancestors,取消时只清理自己的 controller;修改没有改变源记录、原生输入接口或持久回执格式。可见的正常续读、拒绝正文断流、失效指纹、两种 disclosure 的关闭与立即重开、再次显式续读以及完整 Unicode 原文回读都需要保持各自的结果。

记录和活动分组默认仍折叠,普通 Goal 会话、无绑定和不支持的 Agent 仍使用原入口与不可用状态。关闭详情只取消详情读取,原 Agent 和会话观察按原合同运行。新增状态仅是当前 fetch 的 controller 与 observer,没有新的权限、调度或 Goal 生命周期状态。回滚这两个前端文件即可移除该恢复行为,原历史与回执保留。

语义与 CI 对齐

验证 当前结果与边界
源码真实浏览器 PASS;成功正文断流只重试一次,403 断流不重试;记录和工作分组的普通关闭、同任务关闭再重开均得到 ERR_ABORTED;再次显式读取保持原偏移,Unicode 原文完整回读,恢复不增加原生输入。
隔离 Python 3.11 wheel PASS;通过 Python -I 运行实际 LoopX HTTP、SQLite 和原 JSONL reader,1973 个运行文件与当前源码及构建资源逐字节一致。Desktop peer 为合成边界,未验证已安装 Desktop 采用。
完整 premerge 与构建 PASS;5 项直接检查与17项选中检查,包括双语 RFC、语义词汇、公开边界与 Python 编译。当前 Dashboard TypeScript/chat build 已通过。未提交的环境锁文件不属于 PR 的7个文件。
原记录后端 PASS;156 项 native-history/attached 回归。结果来自本轮早期执行;到当前 head 的生产 Python、后端调用者及依赖清单均未改变,另以当前源码/安装包浏览器覆盖真实路径。
CI browser (2/3) FAIL;当前 head 与 immutable base eba8a7f 执行同一 goal-hierarchy 命令,都在 research_lens survives workspace navigation 得到 null 与 graph 不等;本 PR 未触及该导航 owner。Release Artifacts 的 build 仅因 BROWSER_RESULT=failure 前置条件退出,并未发现独立编译失败。
CI kernel-contracts FAIL;类型检查在 decision_context/runtime.py:207 报 no-any-return。使用同一解释器、同一 mypy --no-incremental 命令在 immutable base 与当前 head 都检查17个源文件,并得到完全相同的1项错误;本 PR 没有改变该源文件、mypy 配置或依赖声明。独立记录为原有类型检查问题。
其余 CI macOS/Windows desktop、静态检查、browser (1/3)/(3/3) 等已成功;仍有 queued/pending、cancelled 和 skipped。保留这些状态,未把整个 CI 宣称通过。

基线与当前共用当前浏览器探针及同一隔离 fixture;仅替换基线的测试 harness,不改生产源码。基线在关闭后的真实 requestfailed 得到 ERR_CONTENT_LENGTH_MISMATCH,违反应为 ERR_ABORTED 的独立取消断言;当前源码和 wheel 四种关闭情况均通过。基线第一次设置因缺构建资源得到404;完成基线构建后才获得该行为反例,设置失败保留。关闭取消的旧候选反例保留:成功 headers 后正文仍未结束,关闭时旧代码发出隐藏第二读;当前四种关闭条件均真正中止 HTTP 正文,没有隐式续读。原 Dashboard 冻结延迟失败和其他历史未完成验收没有被重写。

首次 premerge 因根目录 TypeScript 开发依赖未安装而失败;补齐环境后的当前 head 必须通过完整门禁。较早的读取取消失败和设置失败继续保留,不能用后来的成功改写为通过。托管 CI 的观察与合入 readiness 单独记录,不以计数代替当前变更的不变量验证。

我的整体评价 / Verdict

APPROVE,交付判断为 justified_increment。长程工作来源、会话与后续执行保持原 owner;此次改进用户阅读、取消和恢复路径,避免隐藏续读,自动恢复不要求增加说明或确认轮次。九项原验收、完整 R1 与原目标回归仍须由后续实际任务资格证明,不能从这次通过推导完成。当前无未解决的代码阻塞 finding;待发布评审后回读既有阻塞评审,再按独立合入权限和 unchanged head readiness 决策。

当前机制与原记录读取的资源和生命周期一致,使用已存在的 HTTP 错误分类及指纹 owner;删除额外显示状态,使完整关闭行为集中在单次读取上。界面继续以消息为主、常规活动折叠,完整工具正文和失败在同一记录内可达;长中英文记录在桌面和窄屏仍可阅读。未验证已安装桌面 App 的采用或模型上下文保留。长期任务的原来源、原会话与验收 owner 保持;本次只改善读取和取消的用户路径,完整原目标继续开放。

合入决策:当前 readiness=false,原因是 GitHub REVIEW_REQUIRED、已同基线复现的 browser (2/3)/其依赖 build 失败、kernel-contracts 的原有 mypy 错误,以及尚未完成的 CI。正式 exact-head APPROVE 已回读,关闭取消的四种真实源码/安装负例、完整 premerge、双语 RFC 和公开边界均通过,既有 review closeout clear,线程完整且0项未解决。可在已有 maintainer 合入权限下使用 admin bypass 越过这些政策/CI holds;它不覆盖新回归、缺验证、未解决 finding 或 head 变化,立即合入前仍须再次检查当前提交。

English verdict: APPROVE. Exact head 139d534; qualification is limited to bounded original-record reading and cancellation, with installed desktop and managed-model acceptance remaining open.

@cocolord
cocolord merged commit 7bb1b01 into main Nov 13, 2026
20 of 46 checks passed
@cocolord
cocolord deleted the codex/attached-record-content-retry-20261112 branch November 13, 2026 09:04
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