Skip to content

Read saved answers without fetching conversation history - #8863

Merged
loopx-agent merged 3 commits into
mainfrom
codex/answer-reader-original-turn-20261116
Nov 16, 2026
Merged

loopx-agent merged 3 commits into
mainfrom
codex/answer-reader-original-turn-20261116

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Outcome

Opening a saved answer reads the chosen message from its original Session, together with its original question and attachments. Links that carry a Turn ID check it against the saved message. Older links use the same lookup.

A service that rejects the selector uses the earlier history route. A complete legacy v1 snapshot that accepts the query also remains readable. A conflicting message marker, partial history or mismatched Session is rejected. The displayed answer must match the link's original Turn when one is provided.

Validation

  • In the same 3,552-message fixture, the whole Session returned 43,435,371 bytes. The 242-message Turn returned 159,526 bytes across two requests. The selected answer and question returned in one 6,921-byte response.
  • The previous head failed the existing packaged answer-presentation journey while waiting for the saved table. The corrected build passes that journey with its complete Markdown, table, code, source links, heading anchors and restored reading position.
  • Packaged Chat with real SQLite and a synthetic provider verifies both link formats against a complete legacy response, explicit unsupported-selector recovery, original file downloads, English and Chinese controls, keyboard access and desktop/narrow layouts.
  • Mismatched Turns and Sessions, conflicting selectors, partial history, revoked access and damaged journals remain unavailable. Reading observes zero additional model Turns and zero duplicate provider sends.
  • TypeScript, the conversation-history smoke, 154 focused Python cases and standard diff-selected pre-merge checks passed.

The prior head's hosted Pages build also reported three documentation-link warnings. The current head awaits its own hosted checks, independent review and installed-App adoption.

Visual evidence

The saved-answer layout uses the existing reader. This narrow packaged capture uses synthetic provider data and the corrected source at 4ab1558. The complete answer and both original file downloads remain accessible. The previously failing legacy response and its recovery are exercised in the same browser test.

Written by an OpenAI Codex agent.

Saved answer in the narrow packaged reader

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 · reasoning_effort=max

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

评审提交 cd3bf61,对照目标 cac86bb。

动机 / Motivation

从对话里打开保存答复的用户,需要读到原问题、已保存正文和原始附件。 基线打开答复会取整个 Session。新链接携带消息所属 Turn,读者仍通过同一入口打开原答复。 独立比较的 423 条消息中,基线返回整个 Session,新读法分两页返回原 Turn 的 208 条消息。两种读法得到相同原问题、答复和文件字节。 本次验证覆盖打包前端与隔离的实际 Chat HTTP 和 SQLite。安装版和生产规模延迟仍待核验。

改动思路 / Approach

时间线仅投影已有 Turn 身份,答复页复用分页历史读取,Chat 后端继续验证 Session、Turn、游标和附件来源。 兼容保留在 reader 入口。旧分享链接由原 Session 读法解析。 长 Session 样本中,答复页收到的解码响应体从一份 102,168 B 变成两份合计 53,843 B,附件下载另计。这个比较只测量响应体。服务端仍读取会话日志并筛选 Turn,单一 Turn 较长时也会多一次分页请求。

具体改动 / Changes

关键代码讲解

  • answerLink 把已有 sourceTurnId 放进新链接。缺少来源 Turn 时沿用旧链接形式,且清除继承的参数。 时间线链接
  • AnswerReportPage 使用 Session、消息、Turn 和状态源隔离请求结果。新链接走 fetchChatSessionHistory,读取完整原 Turn 后再按消息 ID 找到保存的答复。空 Turn、未知 Turn 或同 Session 里的另一个有效 Turn 均无法读出这份答复。旧链接仍能读出原文件。 答复读取、分页与来源校验
  • checkReturnedFiles 从真实时间线打开读页,核对查询参数以及两个文件的字节。独立长记录样本跨过 200 条边界,两页始终选择同一 Turn。模拟历史读取 503 后,原位置的重试重新读取并恢复附件。 打包验证

规格 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md。stored-version 核对相同正文和文件字节。original-source 核对原 Turn、同 Session 的其他 Turn 及跨 Session 文件边界。read-only-retry 核对临时失败后恢复,读取期间零模型 Turn 和零重复派发。

对主干的风险 / Risks

主要风险是分页后丢失问题或附件,以及错误提示下出现其他消息。独立比较覆盖旧链接、分页游标、错误 Turn 和 HTTP 重试。原文件的两个 SHA-256 在基线和候选一致。现有会话历史 smoke、打包附件浏览器 smoke、四项直接检查和两项预合并检查均通过。托管 CI 未查询。

我的整体评价 / Verdict

可批准。新读法在原用户路径完成保存答复的读取,对话写入和来源依然由现有 owner 管理。桌面和 390 px 窄屏的正文、两个文件下载和返回入口可用。展开来源与版本后显示原问题,读失败时可从同页重试。 未验证安装版及生产长 Session 的服务端耗时。

English verdict: APPROVE at cd3bf61. The packaged reader pages through the original Turn, retains legacy links and original file bytes, and recovers from a failed GET without rerunning the Agent.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent loopx-agent changed the title Read saved answers by their original Turn Read saved answers without fetching conversation history Nov 16, 2026
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 · reasoning_effort=max

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

评审提交 4ab155851a8f94a7c5f7299c45c3b16050394b71,对照主干 cac86bbad92ba99c3430b3f7eaa9632727573821。

动机 / Motivation

用户在已有对话或消息渠道打开先前保存的完整答复,希望读回原正文、来源和交付文件。
包含 454 条历史消息、目标答复位于 200 条窗口外时,旧读页要读取整段会话。当前页面按保存消息选择,真实 HTTP 响应从 1,065,345 字节变为 7,197 字节,仍保留原问题和完全相同的保存正文。
打包页面可以直接显示原保存答复、展开来源并下载原文件。实际服务返回 503 后,用户点击重试即可读回同一答复,验证中没有启动新模型轮次。
本次边界是已有答复的只读读取与原来源、文件保留。线上安装与服务端历史扫描优化仍由原部署和性能验收承担。

尚未验证用户已安装版本、真实外部消息服务或生产延迟分布。完整旧v1兼容使用真实源投影加受控HTTP代理验证。

改动思路 / Approach

保留现有会话与消息为权威事实,在原 roundtrip owner 中只读选取保存答复及原问题,再调用原消息来源与文件投影。TypeScript reader 携带消息和可选原 Turn。只有旧服务实际返回既有参数错误时才退回原 reader,其他错误继续到现有失败与重试界面。缓存与单纯降低分页大小无法同时保留窗口外答复、旧链接与原上下文。Python 改动仍为既有 Chat 存储与展示 IO 组合,选择类型和 URL 传递继续由现有前端 owner 消费。 本次新提交另接受未带选择回显的完整旧v1响应。答案页仍验证session、消息角色和原Turn,部分历史或冲突marker继续拒绝。
选择参数、现有 Python Chat 读取 owner 和 TypeScript 答案页共同交付同一条只读路径,未新增持久状态或执行服务。
原 session 消息、消息角色、可选 turn_id 和现有文件/来源索引是权威事实。report_message_id 是本次只读请求的选择意图与返回确认值。
先验证请求选择组合,再严格读取源历史并匹配唯一 assistant/agent 消息与可选原 Turn,仅返回保存答复及原问题。普通历史读取继续走原分支。
源暂不可读时页面保留失败与重试入口。重试只发原只读 GET;旧服务的特定 HTTP 400 参数错误才进入原历史 reader,取消与切换由既有 AbortSignal 和 scope 处理。
沿用已有 session reader、原 Turn 来源投影和文件下载 owner,增加精确消息选择。当前完整前后端边界已交付可读结果,后续性能结论应由拥有实际部署的运行方验证。

具体改动 / Changes

GitHub 与本地精确 diff 一致,共 7 个路径,新增 208 行,删除 18 行。选择参数、现有 Python Chat 读取 owner 和 TypeScript 答案页共同交付同一条只读路径,未新增持久状态或执行服务。
上一轮批准针对旧提交 cd3bf61。本轮重新核对整个base-to-head范围,重建打包页面,并独立执行前后端和旧服务边界。 发布前发现新提交 4ab1558,增量涉及3个文件,已复读完整差异,重新构建并跑142测试、相同真实HTTP、旧服务和新增兼容反例。

在 cac86bbad92ba99c3430b3f7eaa9632727573821 的 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md 核对接受条件。 规范

  • stored-version。读取保存的结果版本。 454 条实际源历史下消息正文 digest 相同,旧链接也返回同一两行。
  • preserve-source。保留原来源与结果归属。 打包页面展开显示原问题,原文件下载为16字节且 SHA-256 与 fixture 原文件相同。
  • read-only-retry。读取失败后重试读取,避免启动新的模型运行。 实际503后点击重试读回相同正文与两份文件,inspect显示model_turns=0、provider_sends=1、reply_evidence_unchanged=true。

关键代码讲解

  • fetchSavedChatAnswer。构造消息选择与可选 Turn,核对服务器回显,只对特定旧服务参数错误使用原 reader。 代码
  • AnswerReportPage。把原 Turn 纳入读取 scope,保留取消与失败后原请求重试。 代码
  • answerLink。写入实际来源 Turn,缺失时清除 URL 中继承的旧 Turn。 代码
  • _saved_answer_rows。验证唯一消息和角色以及原 Turn,仅保留保存答案与原问题。 代码
  • _session_snapshot。识别报告范围,保留原只读来源投影,跳过无关媒体标记历史。 代码

对主干的风险 / Risks

输入与入口 基线 当前提交
454 条相同历史,目标在200条窗口外(actual ChatHTTPServer / SQLite / stored source) 全会话1,065,345字节,新参数HTTP400 新参数HTTP200、7,197字节、2行,正文digest相同
旧答案链接不携带原Turn(actual head backend and packaged page) 原先使用全会话reader 新选择按消息身份返回同一答案,来源和文件可见
新打包UI对旧主干HTTP服务(actual main backend serving head packaged assets) 主干拒绝新参数,53字节HTTP400 旧链接回退全会话,新Turn链接回退原200条Turn分页,均显示保存正文
源服务暂不可读,然后恢复(actual packaged UI and Core SQLite fixture) 已有答案页具备读取失败与重试入口 503显示失败,重试同一选择恢复正文和文件,model_turns=0
错误Turn、外来消息、混合/空参数(actual HTTP source selection) 原参数语法拒绝未知选择 错误Turn/外来消息结果为空,混合和空选择HTTP400,未越界返回答案
  • PASS 保存正文身份与响应范围。454行源历史,1,065,345→7,197字节,正文SHA-256一致,源文件hash保持。
  • PASS 错误选择、不可用与恢复。错误Turn或外来消息不返回其他答案,混合/空选择拒绝,真实503后重试恢复且零模型轮次。
  • PASS quick premerge 全项。补齐工作树根 TypeScript 开发依赖后原命令全部通过,前次缺依赖日志保留。
  • PASS 既有 roundtrip 和真实HTTP fixture。142 passed,测试来源为当前候选。
  • PASS 生产构建与原页面smoke。新提交完整构建与manifest、两项既有SSR smoke通过,实际浏览器重验保存正文、原文件下载及503恢复。
  • PASS 当前UI对原主干真实HTTP服务。带Turn和不带Turn两种链接都先收到旧服务400,再走各自原历史读取。
  • PASS 原文件字节身份。source.bin为16字节,SHA-256 e6792b5241567ec6a7039ed7a96bbcd07d14b02da64b227d193ab6005f7903e5。
  • PASS 新完整旧v1兼容与冲突响应拒绝。同一真实源完整投影下旧链接和原Turn链接可读,错误Turn不返回文件;错误session、冲突marker及分页响应都显示读取失败,且每次仅一次HTTP请求。

语义与 CI 对齐

读回的是原保存版本,正文、来源与文件身份保持一致。错误 Turn 或缺失消息不能改选其他答复,失败读取与重试均不能创建模型执行。
同一真实HTTP脚本在主干返回完整1,065,345字节且新选择HTTP400,在候选按同一正文oracle通过7,197字节选择读取。新UI对旧服务的实际HTTP400恢复也执行通过。
PR标题、保存消息测试和新增浏览器smoke明确命名从完整历史读取切到保存消息读取的行为。请求及旧服务回退条件也在本评审说明。
远端 CI 按本次评审配置未查询。

我的整体评价 / Verdict

未发现阻塞问题,给出本提交的批准结论。精确读取带来已验证的返回范围缩小,旧服务兼容分支有真实混合版本读回,结构继续复用已有消息与文件owner。
目标窗口外的保存答复能够独立读回,无关历史数量增长时传输保持为选中结果;本次未扩张调度或模型工作。
已有入口和旧链接均能打开,正文与文件直接可用;一次故障重试恢复原内容,无新增确认或重填步骤。
实际查看新提交打包页面的390像素默认视图及桌面展开来源,旧提交390像素展开来源的布局经相同CSS与标记差异核对后保留。正文和下载入口处于主要阅读区,实际503后重试读回原结果。
用户已安装页面和真实消息供应商尚未验证。
尚未验证用户已安装版本、真实外部消息服务或生产延迟分布。完整旧v1兼容使用真实源投影加受控HTTP代理验证。

English verdict: APPROVE. Exact stored-answer reads preserve original content and files, recover from read failures, and work with the previous server. Installed and production-latency behavior remains unverified.

@loopx-agent
loopx-agent merged commit f585427 into main Nov 16, 2026
41 of 54 checks passed
@loopx-agent
loopx-agent deleted the codex/answer-reader-original-turn-20261116 branch November 16, 2026 14:18
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.

1 participant