Skip to content

fix: keep research loading and read recovery distinct - #7067

Merged
loopx-agent merged 1 commit into
mainfrom
codex/research-source-read-state-20261022
Oct 22, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/research-source-read-state-20261022

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Problem and result / 问题与结果

Opening Research on a source-backed Goal previously reported “Deep analysis is not connected” before the first response, and an initial read failure had no visible retry until opening the analysis panel. Research now distinguishes pending reads, read failures and verified empty sources. One compact status supplies retry where the failure occurred; transport detail is available on demand. A failed refresh retains only the same scope’s last result. Source, Goal, language and pack transitions invalidate old responses.

研究页首次读取时不再提前判断“尚未接入分析”。加载使用占位,失败显示一条可重试提示,详细错误按需查看;确认读回后才显示空状态。返回标签时保留已读内容与阅读位置,摘要和详情共用同一处读取状态。

This is a reversible Research reading/recovery slice of the frontend design work. It changes no model invocation, analysis content, scoring or source authority. The existing typed source API, analysis controller and history reader remain the owners. Broader frontend composition work remains separate.

Validation / 验证

  • Production Chat build and TypeScript checks passed.
  • Packaged research-history journey passed: results, delayed source changes, Back/Forward, language selection, citations, unavailable reads, keyboard focus, mobile and reading-position restoration; no analysis dispatch.
  • Runtime-source workspace passed with production HTTP owners and isolated synthetic state: delayed initial read, failure, disabled in-flight retry, recovery, same-ID physical source isolation, navigation and 390px layout; no writes. Only delay/failure transport is injected; successful reads use the backend.
  • The new pending-read invariant fails at immutable base 49d794463244397aaf28db62a31bd3605daefaf4 and passes at this head.
  • CSS token, diff and RFC checks passed. Risk canary passed all automatic checks (4 direct, 7 catalog, 8 risk, 1 public-boundary). Its raw result remains manual_review_required for the four PNGs; each image and its metadata were inspected. Exact-head COMMENTED approval and ready merge-readiness were recorded before merge.

Visual evidence / 首屏证据

Primary question: can I read this Goal’s research, and recover if the analysis read fails? Default: one status line or quiet loading placeholders, then recorded history. Detail: transport error via accessible contextual help, complete results/citations through existing controls.

Packaged build at 05da820b5d0f2f6aca67b7aac9ed28612142147a, desktop 1512×982 and phone 390×844. Public-safe synthetic Goals and 92 history events from the real HTTP fixture. Screenshots are not installed-App evidence or model-quality qualification. The populated page retains its timeline while read state changes; no repeated error paragraph or full-screen failure banner. The existing narrow timeline remains horizontally scrollable within its region.

Before: pending misreported as disconnected After: pending reads remain pending
Before Loading
Read failure: one local recovery line Phone: retry in progress
Failure Retry

Installed readback / 安装读回

After merge, the native desktop App selected runtime source 795c30a2903638cf4f990adccb4cdceae355c70b. An original read-only child Goal’s Research tab loaded its complete recorded history and existing localized assessments without a false disconnected warning. No new analysis was dispatched. Private operating screenshots remain local. Transport failure/retry was qualified in the isolated packaged journey above, not injected into live state. The broader upgrade command still reports separate custom automation-template review holds; App/runtime activation succeeded.

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-astra · OpenAI · runtime_reported · xhigh

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

评审 05da820b5d0f2f6aca67b7aac9ed28612142147a;未发现剩余阻塞缺陷。

动机

研究页的读者首先需要知道“这个 Goal 的研究是否可读,失败后怎么恢复”。旧版把只读来源尚未收到响应与“未接入深度分析”混为一谈,初始读取失败又没有直接重试入口。这会使正常的慢请求看起来像配置缺失。当前变更交付一条完整的读取和恢复路径;它属于前端体验任务的有限增量,不代表整个前端优化完成,也不改变分析质量、研究收益或实际执行权限。

失败只有一条提示,重试期间按钮禁用,完整错误放在可键盘访问的上下文说明中。 安装回读和整个前端任务仍按各自边界推进。

改动思路

最小的表面修改是调换一个条件,但它只能修正加载文案,不能解决手动重试没有加载状态、初始错误不可见,以及摘要和详情重复显示错误的问题。方案保留已有 useResearchAnalysis,把 snapshot、error、loading 放到同一个带来源身份的读取状态中;展示复用一个 AnalysisReadState。没有新增后端、持久化状态、查询框架或 API。

已有 docs/development/design.md 的 States that are designed 和 Populated Page Review 规则要求:未观察不能等于空状态,错误应在发生处提供恢复,详细说明按需打开。该 PR 把这个已有规则落实到研究页,并补充来源、Goal、语言和所选范围必须绑定同一读取状态。与另外新增一套状态管理相比,当前边界更便于验证和回退。

本 PR 只收敛研究页读取状态、恢复入口和同范围上下文保留。

具体改动

关键代码讲解

  • useResearchAnalysis/read 在自动读取和手动重试时都设置 loading,并按 generation、请求序号、sourceScope 和 packId 核对响应。成功和失败都经过同一守卫,较早响应不能覆盖新选择;来源或语言改变时先同步遮蔽旧状态,再执行下一次读取。
  • applyLocation 保留同一个已读 pack 的内容;切到另一个 pack 时只保留可供选择的目录。这样打开当前结果的详情或引用不会把自身结果清空,同时旧范围的指标也不会借给新范围。
  • AnalysisReadState 区分初始加载、读取失败和后端确认的空状态。失败只有一条提示,重试期间按钮禁用,完整错误放在可键盘访问的上下文说明中。已有结果刷新失败时明确保留上次结果;已确认空状态的后台刷新也不改成大块占位,避免返回标签时滚动位置跳动。
  • ResearchProgress 删除重复的传输错误和加载段落,保留六项指标、原生结果、来源选择与引用。摘要和分析详情按当前展开状态只挂载一处读取提示,既有历史结果适用性提醒仍保留。
  • runtime-source-workspace-browser-smoke 使用原来的生产 HTTP 来源服务和隔离合成记录,补上可控延迟、一次503、重试在途和成功恢复。最终成功响应来自真实后端;注入只负责制造网络时序与失败,没有提供被测 UI 结论。

首屏已直接放在 PR description:1512×982 桌面和390×844手机,92条合成历史事件。加载时历史仍可浏览,失败时没有整屏横幅和重复段落;手机错误与重试控件同处一行,详细传输信息按需显示。四张 PNG 的像素和元数据均已检查,无真实私有上下文。这些是打包页面证据,安装后的 App 回读另做,不据此声称已经安装。

对主干的风险

主要风险是合并读取状态时丢失已有上下文或把旧响应归到新来源。评审按这一反例检查了完整路径:A读取延迟后选择B、浏览器返回到不可用A、同名Goal切换物理来源、语言切换、原文引用、手机和键盘,以及研究标签的阅读位置恢复。第一次实现中暴露的引用清空和占位导致位置跳动已在提交前修正,最终完整回归通过。没有降低原有断言或修改研究数据来获得通过。

生产 Chat 构建及 TypeScript 检查、完整 research-history、runtime-source workspace、CSS token、diff和RFC检查通过。新增“未读到来源不能显示未接入”断言在不可变 base 49d794463244397aaf28db62a31bd3605daefaf4 失败,在当前 head 通过。风险 canary 的自动项通过,原始结果仍为 manual_review_required,四项手工项是 PNG,已逐张核对。按当前 Goal 策略未查询或等待远端 CI。语义探测不覆盖 TSX,人工核对确认此处没有新增共享协议或闭集词汇;该探测不是语义正确性的证明。

浏览、切换和重试没有发送分析写请求,原有模型调用、取消、来源权限和评分协议没有改变。Overview 不读取完整研究历史的既有断言继续通过。真实模型输出质量不在本次验证范围,来源运行时未配置分析的后端行为也没有在此改写。

我的整体评价

这是有明确用户收益、可独立验证和回退的读取体验修复。用现有 owner 完成了加载、错误、恢复和上下文保留,并减少重复提示,成本与问题相称。支持当前 head 合并;安装回读和整个前端任务仍按各自边界推进。合并授权、精确 head readiness 和质量记录是独立条件,当前评审结论本身不授予它们。

English verdict: APPROVE — 05da820b5d0f2f6aca67b7aac9ed28612142147a. Pending analysis reads no longer imply an absent connection; one scoped status provides direct retry and preserves same-scope context. Production build, packaged source/history journeys, immutable base/head regression and automated canary checks passed; four public-safe screenshots were manually inspected. Native installed readback follows merge; no model-quality or overall-frontend completion claim.

@loopx-agent
loopx-agent merged commit 795c30a into main Oct 22, 2026
25 of 31 checks passed
@loopx-agent
loopx-agent deleted the codex/research-source-read-state-20261022 branch October 22, 2026 12:59
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