Repository navigation
fix(manager): recover oversized Todo details through bounded pages - #8962
Conversation
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
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
未发现阻塞问题;本结论是作者账号的 COMMENTED 评审,不是独立人工审查,也不代替合并权限。审查精确版本 768e583,基础版本 6a00768。
动机 / Motivation
原管家和项目会话通过现有工具读取一条超长待办。
此前正文过大时只剩未知占位,无法取得完整决策和停止条件;现在可按同一版本续读并拼回完整的获准记录。
超长记录可经已有工具有界恢复,普通概览、权限和大小限制保持。
本次不证明模型自然采用、远端详情、整条查询提速或业务任务完成。
原生冷读取延迟、整条会话成本和模型自然采用仍需原负责路径继续验证。
改动思路 / Approach
Core继续决定记录及脱敏,Python只在原展示边界分页;复用既有参数避免历史会话工具定义迁移。
本PR只交付同一读取工具的完整详情恢复、版本冲突拒绝和回调读回,不新增缓存、授权、消费者或会话迁移。
不改动时,未知占位仍然使完整依据不可达。单纯放大展示预算会把长记录重新塞进每次输出;借用CLI capture读取器则会引入文件引用及另一套访问边界。当前实现复用原Todo选择、脱敏、记录版本和范围检查,只对明确的精确详情续读做JSON文本分页。
JSON是完整结构的文本编码。每页都有起点、下一页、总字符数和版本,调用方必须从零拼到结尾后再解析。版本校验同时绑定原记录和获准投影,换内容或换脱敏范围会拒绝续读。旧行分页仍按记录计数;只有带读取引用中版本的精确Todo请求,offset才按Unicode字符计数。说明同时随结果返回,已存在的上游工具参数结构保持兼容。
具体改动 / Changes
规范依据为 docs/reference/protocols/manager-evidence-and-continuity-v0.md,判定版本 6a00768。本次只映射已实现的相关条款,未把协议中的跨项目整体验收升级为本PR门禁:
- scope-read:原文要求每次读取重新核验范围;由ManagerInspection.read在Core前后及返回分页前检查,范围撤销和外国Goal反例PASS。
- complete-exact:原文要求精确Todo读取恢复被概览省略的决策内容;真实File/SQLite从零拼接的结果与原生完整投影逐字段一致,包含末尾停止条件,PASS。
- unknown-gap:不可读和省略仍为未知;普通超长入口保留unknown,片段自身也不宣称是完整任务。源变化拒绝并要求重新读取,PASS。
- owner-continuity:Core持有权威,升级保留原会话及回执;此实现不写Core、不新建缓存,真实后端前后记录一致,旧schema验证四个实际读取引用通过,PASS。
关键代码讲解
ManagerInspection.read 沿原Core读取完整获准行;精确记录超过展示预算时返回续读引用及说明。显式续读固定读取该行,从引用指定的字符位置返回,冲突或撤权不会继续混拼,也不读取任意文件。
_todo_detail_revision 把源版本与当前获准投影一起摘要,避免原owner引用被拿到另一脱敏范围继续读取。摘要是读取栅栏,不是权限或执行凭据。
_todo_detail_page 对完整JSON文字切片,并对再次编码后的页面计算大小;引号、反斜线和控制符会再转义,不能只截原文长度。它保持Unicode字符边界,每页不超过既有24000序列化字符预算,不持久化另一份任务。
对主干的风险 / Risks
最强反例是:源码分页通过,但旧上游会话仍持有旧工具schema,导致新增参数无法使用。初版因此已收敛:最终结构沿用既有offset和expected_source_revision,四个真实续读引用以基准schema验证PASS,无需为了这项修复切换线程。另一个风险是拼接两版任务:同一条记录更新、原范围失效、错误游标及外部脱敏均有拒绝或恢复验证,原canonical记录不变。每页依然重新读取源,未解决的冷读取成本没有被隐藏。
Python3.12及3.14各94项PASS;其中含真实File/SQLite往返,以及真实Chat子进程的合成宿主工具回调。16项同夹具基准/新版本对照仅4项超长入口增加引用和说明,其余完整响应相等,只规范化观察时间。旧读取器对同一引用拒绝,且不提供恢复入口;固定版本可取回全部字符。6直接及2选中catalog标准预检、Ruff、双语diff及公开边界检查PASS。
初次测试把canonical已有的换行规范化误认为原文保留,已改为与独立原生完整投影比较;历史失败日志保留。早期新增参数的比较也暴露allowlist差异,最终已删除该参数。按当前Goal策略未查询或等待CI,未宣称CI通过。变更质量策略当前disabled,未启用或伪造receipt。
语义与 CI 对齐
此处是已有manager-context读取合同的局部分页扩展,不新增Todo状态、授权或调度词汇。规范的范围、完整依据和未知事实要求继续适用;语义词汇及模块边界检查均PASS。新行为是引用可达的全文续读;普通读取默认和必要停止条件未删除。
我的整体评价 / Verdict
在本PR边界内,long_horizon得到改善:完整条件可以跨分页读取,重建reader无需额外缓存,变化则重新开始,不产生业务重放。user_experience也得到改善:原问题之后无需主人再填表、复制命令或迁移会话,工具即可取回必要依据。已检查Chat工具回调及原UI入口,本PR不修改渲染组件或可见布局,无需截图。
未验证范围:真实付费模型是否自然采用、远端详情及整条查询成本。合成宿主不是实际模型,测试数不能替代这些证据。
本次两个文件的改动包含79行生产代码和110行测试新增,职责仍在原transport,相关简化已移除新增参数;保留旧schema和普通行分页有真实独立会话兼容依据。对当前完整详情恢复给予APPROVE;剩余成本及模型采用沿原维护工作继续,不以此关闭父任务。
English verdict: APPROVE for bounded local Todo detail recovery; live-model adoption and whole-query latency remain unverified.
An exact Todo can exceed the manager reader’s existing 24,000 serialized-character row limit. The reader correctly reports an unknown gap but previously offered no way to recover the permitted record, leaving a manager unable to inspect its complete decision and stop conditions.
The existing manager/context tools now return a scoped continuation for that case. Explicit local detail reads reuse the already-registered offset and revision parameters, so existing upstream tool schemas remain compatible without migrating conversation history. They deliver bounded JSON text fragments with Unicode character cursors, a source-and-projection revision fence, and scope checks before and after each read. Callers concatenate from zero through EOF and parse the whole record before deciding. Ordinary row pagination, redaction, canonical ownership, and the size limit stay the same; this adds no cache, write, role or execution path. The Python change belongs to the existing serialization adapter; TypeScript retains canonical selection and disclosure.
Validation: Python 3.12 and 3.14 each pass 94 focused tests, including real File/SQLite round trips, unchanged canonical state, source changes, revocation, invalid cursors, Unicode/escaping and a real Chat subprocess tool-callback journey with a synthetic host. Sixteen same-fixture base/head comparisons preserve ordinary reads exactly; the four expected differences are the oversized-record continuations. Standard premerge passes six direct and two selected catalog checks. An initial test expectation incorrectly assumed canonical notes preserve raw newlines; it was corrected to compare the complete permitted native record. A pre-simplification comparison also exposed the added-argument allowlist delta; the final implementation removes that argument and retains the original schema keys and validation types.
This qualifies source and synthetic-host behavior, not paid-model adoption, remote detail reads, whole-query latency, or completion of the manager’s business tasks. No rendered UI changes. The bounded refactor keeps fragment encoding in the existing transport owner, without a new persistence or decision layer.