Repository navigation
fix(context): keep unfinished delegation agenda in the first read - #7857
Conversation
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; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
当前精确 head 可以批准;CI 未作为批准条件。change-quality qualification 仍是独立的未通过合并门禁,本结论不授予合并权限。
动机 / Motivation
受管理 Turn 唤醒、通过原生文件首读查看当前工作的 Agent。例如一个委托已被采纳,关联 Todo 也已完成,但仍欠原路答复。旧首读只给来源和完整读取路线,隐藏已经生成的待办委托议程,Agent 可能因此漏掉返回步骤;当前首读直接保留该议程及不完整读取标记,完整请求仍须在行动前展开。File、SQLite 的真实 CLI 冷启动和当前 Turn 的 warm recovery 都能读到该议程;两轮观察不改写委托回执。这个切片修复首读的信息遗漏,不证明模型已理解或采用议程、委托已经完成、实际长期效果提升或完整成本下降。
改动思路 / Approach
沿用已有 TypeScript 首读选择器和已有委托投影,只把当前 capture 中两个既有字段加入地址集合;Python 继续负责摘要校验、只读分页和当前捕获恢复,不新增生命周期、权限或配置 owner。当前 PR 只有四个文件 +97/-9:生产选择器新增两条字段选择及两行说明,其余是已有用例扩展和中英参考说明。已有投影按至多 20 个可见请求、10000 行字节收敛,保留遗漏计数、不可用观测和完整读取路线。复用这一 owner 比新增生命周期或展开全部请求更贴合问题;增加输入字节的代价仍需保留,不能把可见性等同成本收益。
正向路径是:现有回执分类出仍欠答复的请求,Turn hook 捕获议程,首读选择同一 capture 中的值,然后调用者在行动前展开完整请求。负向路径中,来源不可用或有遗漏时仍显式保留;损坏 capture、选择 profile 或游标会按原校验拒绝,恢复只读当前 Turn,不重新入场或重放效果。
具体改动 / Changes
关键代码讲解
initialReadPointers通过现有 own-property 地址遍历加入read_complete与unfinished_delegations,字段不存在时不新增值;它不推导完成状态,也不修改回执。capturedDecisionSelection继续把 initial-read 和发现模式接到同一选择器;普通显式地址选择、未知 schema 和失败语义不变。read_context_capture是沿用的实际消费者:逐页校验原 SHA 和选择 profile,再返回当前值。selected EOF 仍不表示完整 Inbox 或模型阅读;完整 brief 可以从同一 capture 按需读取。
两个测试文件扩展现有用例:available/unavailable 保留整份摘要与 false 标记;File、SQLite 各自走真实 CLI 的 host envelope 和 native 冷启动/当前捕获恢复,两次读取前后委托 JSON 字节相同。文档的英文、中文补充也保留了“完整请求在评估、执行、回传前读取”的次序。
依据是已存在的manager-context 议程与 partial-read 契约和原生首读契约,两份文档在所核基线与当前目标主干之间未变。对应已有条款标签:unfinished delegation agenda → implemented,保留采纳后工作、待返回及遗漏/不可用事实;read_complete=false → implemented,完整请求仍须展开且观察不消费结果;Native first_read_command → implemented,冷首读和 warm current recovery 走同一当前来源,不把选择 EOF 当完整输入。
对主干的风险 / Risks
最强风险是把部分议程误读成完整 Inbox,或把 Todo 完成、采纳、queued return 当作已经返回成果。当前只搬运已有 typed 投影,不新增字符串分类或状态 owner;整个摘要、未完成标记和原读取路线一起保留。真实 overflow、回执生命周期、损坏来源与选择 profile 的负例通过,但 Agent 仍可能忽略正确输入,不能据此认证模型遵循。
明确 off、unsupported projection 和默认惰性 cache 查找用例通过,原 host envelope 在基线与 head 的两例均通过;没有改变 native 激活默认、权限、调度、预算或效果。实际调用者是已有 managed quota context reader,属于内部投影修复,没有新设置或前端操作。这是现有 agent context 的文本投影,没有页面、布局或设置变化;检查了实际 CLI 返回,不适用截图审查。
语义与 CI 对齐
新增选择复用既有词汇,没有新 Enum、Literal、closed set 或 schema;原 read/adopt、work done、queued、delivered、consumed 与 accepted 区别保留。既有文本中的完整读取义务没有降为可选,机器执行的 SHA/profile/权限校验也没有放松。CI 未查询或等待。标准预合并的 5 direct、5 catalog、8 risk 与 1 public-boundary 命令均 PASS,但整体 FAIL(exit 1),原因是当前 quality_stale_receipt,merge_gate_passed=false;没有改写或豁免 receipt。作者另有完整 Python 资格未完成的说明,也没有当成通过。
我的整体评价 / Verdict
交付判断为这个有实际调用者的首读遗漏修复已完成。long_horizon=preserved:原生命周期和验收边界保留,长期采用与收益未知;user_experience=improved:调用者第一次有效读取就能看见已有委托事实和后续路线。两条现有字段选择无需额外框架或相邻重构,维护成本与已复现问题相称,兼容层也没有增加。
独立验证:当前 39 项 pytest PASS(9.01 秒,零失败、零跳过),9 项 TypeScript 选择器测试、类型检查、Ruff、diff/双语检查、CLI 输出预算以及上述 19 个预合并命令均 PASS。同一组最终新用例在精确基线 c334 得到 4 个预期 FAIL、2 个原 host envelope PASS;head 的同例通过。旧 native 例在冷首读就失败,旧 warm 流程未执行到第二轮;head 的当前 Turn warm recovery 实际执行通过。真实模型理解和采用、安装版读回、跨平台 native 支持、完整 Python 仓库测试、长期跟进效果与完整费用净益均未在本轮验证。主干 change-quality receipt、后续独立合并资格和授权仍由相应 owner 满足;新 head 或具体新证据需要重新核验。
English verdict: APPROVE this exact head for the bounded first-read projection repair; CI is not an approval prerequisite. Change-quality qualification and merge authorization remain unmet, separate gates.
Goal And Delivered Outcome
原生 context delivery 的首次读取保留了收件来源和读取入口,却漏掉已经生成的未完成委派摘要。一个请求即使已被采纳、关联 Todo 已完成,仍可能欠结果或等待回传;首次读取应直接呈现这个状态。
本次沿现有 TypeScript
initialReadPointers交付source.content.unfinished_delegations和read_complete,保留计数、遗漏、不可用观测和下一步。完整请求正文仍从同一不可变 capture 按需读取,评估、执行或返回请求前仍须读全文。读取不会消费结果、完成请求或增加执行权限。mainatc334bbaf196505778149ae4edeefaa013d343259.Author Declaration
model_agent— Codex / GPT-6 family (OpenAI).loopx/capabilities/manager_context/README.md(compact unfinished-request agenda), anddocs/reference/required-work-context.md(first-read selection), both at the base revision above.turn_envelope.ts::initialReadPointersScope And Continuation
Four files: one projection change, focused regressions and the existing English/Chinese reference paragraphs. Reuses the capability-owned bounded agenda and existing pointer helper; no new schema, configuration, state machine, permission or request lifecycle.
This is a complete, reversible author proposal for the first-read omission. The wider delegation follow-through, actual adoption, installed behavior and outcome/cost qualification remain open in their existing work. This PR does not prove model retention, better attention or lower total cost. The bounded agenda adds input bytes.
Validation
69dd8f5c068cf94b32ff1d33d64def89edff63f8.finishedfor the checks listed below; complete repository qualification remains held.synthetic,public_fixture.test_context_first_read.py,test_delegation_turn_context.py,test_context_read_reference.py; isolated real File/SQLite, two consecutive CLI guards, cold first read and warm recovery of the current capture. Existing host envelopes retained.npm run test:control-plane: 5,825 passed, 77 skipped, zero failed/cancelled out of 5,902 tests. Skips are not counted as passing coverage.quality_invalid_receipt, exit 1. The isolated managed runtime exited normally after the checks.The existing default-provider and capture contracts are unchanged. No authority-store schema, routing or promotion change; no new live PostgreSQL, installed host, cross-platform or sustained-effectiveness qualification is claimed. Dependency setup initially lacked
tsc; installing declared dependencies and rerunning typecheck succeeded without lockfile changes.Frontend / Visual Evidence
none; no frontend, Lark controls, documentation chrome or layout changed. Existing journeys still use the same typed owner. Screenshot/viewport evidence: N/A.Type Of Change And Area
Shared-authority RFC Fixture Impact
N/A: no migration or shared-authority promotion claim; File/SQLite read-path evidence is scoped above.
Boundary Checklist
none.Signed-off-by.Reviewable proposal only. Keep unmerged until required qualification, exact-head review/readiness and maintainer authorization are satisfied.