Repository navigation
fix(chat): verify complete delegation originals - #7692
loopx-agent wants to merge 1 commit into
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. 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 HEADFor a same-repository clone whose Keep the DCO |
songoow
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · GPT-6 Astra Pro · OpenAI · self_reported
动机 / Motivation
从委派列表回看“原对话”的用户,需要确认自己看到的是该次请求的完整原文及回答。例如原件日志损坏了一条已保存的回答,旧入口仍把剩余问题显示成可读原对话;现在沿既有完整历史 reader 读取同一来源的全部分页,任一页无法验证就显示不可用,源恢复后重新打开即可读完整内容。独立执行 source-matched 生产 bundle 的 reader,真实 File/SQLite HTTP 路径均验证225条历史、跨页目标问答、完整长文、损坏拒绝、后页故障和取消后恢复,读取产生零POST且保留原13个Turn。范围是原件读取的完整性、来源一致性与恢复;普通 unpaged snapshot 原本就含完整历史,本 PR 不修一个虚构的普通分页截断问题,也不宣称提升端到端延迟或完成已安装 App/实时 provider 采用。本次读取缺陷已在 source/packaged 边界闭环;更广的实时委派采用、完整媒体交付与性能资格保持独立。
改动思路 / Approach
已有分页、来源和冻结 prefix 验证由 fetchChatSessionHistory 拥有;本次只让原对话入口接入它并传递取消信号,保留已有发现型 caller 的身份检查和老服务整份 snapshot 兼容。当前 PR 保留原件 reader 的复用、最小 signature 扩展和对应真实 fixture 清理;不新增分页器、缓存、存储状态或后台轮询。这沿用用户原本要完成的工作,不要求额外配置、重新描述已有上下文或再作一次例行确认;需要纠正的输入仍由已有拒绝/重开路径处理。比较不修改、手动复制和另建owner后,当前复用方式对完整性与后续恢复的成本更低。
下面是 exact head c6354fcec98ba7eeeea78228395500ac6b0188ce 的来源/结果比较,依据实际代码与验证记录整理,不是新的状态机或额外执行证据:
| 原件状态 | 旧入口 | 当前 head |
|---|---|---|
| 正常完整日志 | 原本可读全部历史 | 完整读取后只显示目标Turn |
| 一条回答日志损坏 | 剩余问题仍像完整原件 | 拒绝部分结果,显示不可用 |
| 恢复源/关闭后重开 | 缺少完整性保证 | 重新完整读取,无POST或新Turn |
具体改动 / Changes
完整审阅范围:6 files, +204/-41; production data reader +14/-5 and caller +2/-3, remaining test/fixture qualification and deterministic cleanup. 独立规格依据为 https://github.com/loopx-project/loopx/blob/c38b3a1a62e844d1d59f68701d3b4684136e50c3/docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md,固定版本 c38b3a1a62e844d1d59f68701d3b4684136e50c3。history-frozen-prefix:implemented; history-failure-recovery:implemented; history-legacy-parity:implemented。这些标识是本次review对既有合同的条目映射;未用作者叙述代替独立契约,也没有把更大路线图改成此PR的隐含完成条件。
关键代码讲解
-
fetchChatSessionHistory(apps/presentation/dashboard/src/data/chat.ts:973):允许原件已有的 Session ID 作为入口;第一份已验证 page 固定 source,后续仍检查 scope、digest、offset、唯一message ID与cursor进展。 -
OriginalRequest(apps/presentation/dashboard/src/features/personal-workspace/conversation-requests.tsx:157):等完整结果后才过滤目标 Turn;关闭、停用或revision变化中止读取,aborted continuation不能覆盖界面。 -
main(examples/personal-workspace-browser/steward_requests_fixture.py:27):在 owner imports 前隔离临时进程命名空间;create_turn 自己拥有用户消息,移除重复 append;关闭HTTP与authenticated runtime后才删临时状态。
对主干的风险 / Risks
未发现阻断性代码问题。完整原件会读取全部冻结历史,服务端已有的全日志读取/哈希成本仍随历史增长;未证明新的延迟收益。首个无分页契约的旧v1服务仍沿已有整份snapshot兼容分支,不能把该兼容声明扩成所有旧服务都具备新prefix证明。最需要反证的场景是“界面看起来成功,实际完整原件/原Turn却丢失或来源不再一致”;因此审阅沿 Delegations OriginalRequest open -> fetchChatSessionHistory(source_session_id, signal) -> existing Session HTTP page owner -> validated full prefix -> exact source_turn_id filter -> existing message/media view 追到真实持久化或完整读取后的消费者,没有用helper单测替代这条路径。
本机依赖缓存缺少zod4.6.6且没有浏览器binary,未冒充完成本地build/browser。我下载当前CI bundle,验证35个asset及670项输入源码与exact head完全一致,然后直接Node import未修改的生产data chunk,对真实 File与SQLite HTTP/store分别运行:225消息、跨页目标问答/完整长文、发现型summary参数兼容、错误scope、损坏日志、后页503、关闭取消、重开恢复均通过;两侧都零POST、原13Turns及Chat/receipt状态不变,fixture退出0。
旧路径反证使用base/head源码完全一致的fetchChatSession/requestJson及PythonHTTP/store/page owners,在同一个损坏源上旧reader实际返回一条目标消息,新reader拒绝;这是有hash证明的旧caller反事实,未宣称本机重建了基线UI。另独立阅读当前CI job123608784980的真实packaged delegation-search完整成功记录,覆盖实际OriginalRequest组件;新旧公开截图也已逐张查看。取消时底层requestJson可能把body中断归一为ChatApiError,组件以signal.aborted抑制迟到结果,不依赖异常名称;本地断言验证此真实约定。
语义与 CI 对齐
复用既有typed输入、历史和权限语义,没有新增业务状态或授予执行权。具体失败已核查:selection replan与native restart两个节点在immutable base和head均2 failed,失败身份和规范化message完全相同。Windows self-update另4个失败已读到日志,未在本机Windows复现;未合并/未宣称全绿,合并检查与代码认可分别报告。本机离线依赖不足属于验证环境限制,当前缺失的本地browser运行由具备源码/asset绑定的CI执行及实际视觉检查有界补足,不表示本机曾构建成功。没有宣称修复无关红灯,也没有修改预算或删除断言。
当前失败的具体归因与审阅范围
补充 current Windows 失败归因:四个 self-update 节点先由 snapshot fixture 生成 Windows 上 apply_supported=false 的 plan,再只覆盖 pip/pipx driver;execute_update_plan 在检查该 plan 时立即返回 ok=false,尚未进入安装或本次改变的代码路径。三个相关 PR 与各自基线的 self_update.py、runtime_activation.py 和这份测试文件逐字一致。独立使用同一个 pytest 节点清单,仅在该 owner 注入 os.name=nt 的平台观测,在 immutable base 与 exact head 都复现4 failed、逐节点 message 相同;这限定证明已观察到的确定性早退原因,不冒充完整 Windows 操作系统回归,也不声称红灯已修复。
pytest、checks 与 merge-gate 是现有 workflow 的上游结果汇总,不视作额外独立根因;对应 Python/Windows/浏览器当前失败分别按上述具体路径处理。APPROVE 只表达已审改动的代码结论,未更改或绕过远端必需状态检查。
我的整体评价 / Verdict
对 exact head c6354fcec98ba7eeeea78228395500ac6b0188ce 给出 APPROVE。已实际检查作者公开的五张绑定当前测试 revision 的 packaged 截图:宽屏默认分组列表、损坏前后、390px默认与展开长原文末尾;原有层级和固定分页保持,失败留在原入口,长文之后的回答可见且只出现一次。本机没有重建或重跑浏览器;已核验 CI bundle 的670项输入源码与 exact head一致并独立执行其中的生产 reader。截图和这些 fixture 不证明已安装 App、真实 provider 采用或阅读理解。 截图在PR正文已有before/after、桌面/窄屏和完整长文末尾;当前CI源码哈希验证支持复用,未把作者截图当作本机浏览器运行。 视觉证据:PR正文公开截图。普通输入/完整读取与故障恢复已通过可区分旧缺陷的真实路径验证;维持当前小切片和现有owner,比继续扩大范围更合适。代码认可与远端CI、冲突解决及最终合并资格分开,未授权或执行合并、安装与发布。
English verdict: APPROVE — c6354fcec98ba7eeeea78228395500ac6b0188ce; the bounded existing conversation journey is covered by independent real-boundary checks, source-matched packaged evidence and actual visual inspection. Local browser-build limitations and remaining merge checks are explicitly separate; no installed or live-model adoption is claimed.
Goal And Delivered Outcome
Opening Delegations → Original conversation used the lenient, unpaged Session read. A damaged journal could omit a saved message while the detail still appeared readable. Ordinary unpaged snapshots already contain the full transcript; the defect is accepting an unverifiable original, not an ordinary page-size truncation.
The detail now reuses
fetchChatSessionHistory: read every bounded page from one source and frozen prefix, then show the complete target Turn. A failed/conflicting page shows the existing unavailable state; closing cancels the read. Existing discovered-summary callers retain their identity checks and legacy full-snapshot compatibility.main. Related perf(collaboration): batch guarded inventory observations #7630, without closing its broader latency/adoption work.loopx/capabilities/manager_context/chat_history.pyand task-first delivery rules at basec38b3a1a62e844d1d59f68701d3b4684136e50c3; the scoped request in this PR is the user-facing basis.Scope And Continuation
Complete within this reader fix. No second paginator, cache, schema or state owner. The companion fixture removes a duplicate user append already owned by
create_turn, isolates its process namespace before owner imports, and reuses authenticated child cleanup before temporary state disappears. Both browser runners check fixture exit, so an early PASS line cannot hide failed teardown.The same existing disclosure, text and layout remain. Source proposal and synthetic packaged qualification do not prove adoption by an installed App, a live provider thread, or end-to-end latency improvement. Broader delegation readback/adoption and performance work remains separate.
Validation
c6354fcec98ba7eeeea78228395500ac6b0188ce(runtime/UI build bytes unchanged by the rebase onto the test-only test(delegation): reap fixture runtimes in their spawning parent #7685 merge).smoke/delegation-search-browser-smoke.mjswith real File and SQLite authority plus Chat HTTP: complete target Turn, long body, later-page hold/failure, reopen/cancel, 390px/keyboard, search/paging and source failure/recoverynpm run smoke:conversation-historyandnpm run smoke:bound-conversation: three real HTTP pages, source/prefix conflicts, ordinary and bound history, cancellation and old-service compatibilitysmoke/delegation-media-browser-smoke.mjs: images/quotes, same-Turn isolation, refresh/native return, English/narrow, executor-offline zero-POST read and successful teardownThe original-reader segment adds zero POSTs and leaves Chat/receipt state and the original 13 Turns unchanged. Workspace startup with the synthetic available executor separately attempts one Session admission, rejected by the read-only fixture; this PR does not claim whole-workspace startup made zero network POSTs. The media journey separately qualifies reading with the executor offline. No backend authority or PostgreSQL implementation changes.
Frontend / Visual Evidence
Synthetic packaged Chat at the tested revision, not an installed or live-data capture. The default grouped list, primary text size, persistent count/paging and existing original-conversation entry stay in place. Failure remains visible within that entry; optional requirements/provenance stay folded until requested. The stress body is synthetic user content, not added interface explanation.
Default populated desktop view (unchanged arrangement):
The long original remains scrollable at narrow width and its later-page answer appears once at the end. This is a completeness/failure review, not a claim of a visual redesign or independent audience comprehension. Generated captures stay outside Git under the repository visual-evidence retention contract.
Boundary Checklist