Repository navigation
Use compact JSON receipts for managed Todo claims - #8556
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
songoow
left a comment
There was a problem hiding this comment.
动机 / Motivation
按 quota 建议领取任务的 Agent,需要拿到原 claim 回执并继续同一 Turn。 一个包含 72 个无关 Todo 的 Goal,领取单个任务时原结果携带整份展示诊断;现在建议命令使用 --thin,成功结果保留操作身份和恢复入口,把逐项诊断放到固定 revision 的只读详情。 真实 File/SQLite 流程验证了领取身份、active lease、同 Turn ready、完整 replay、72 条详情的只读回查,以及展示失败时的内联恢复说明。 本次不改变领取事务、租约、存储或 Host 自动执行参数,也不以单个 JSON 变小推断模型整体成本。
评审 head 05384b7,基线也是当前 main beff0f3。先核对基线 docs/project-agent-todo-contract.md,围绕 C1(claim/lease/原 Turn 身份)、C2(canonical mutation 与展示失败分离)、C3(精确详情和原回执可恢复)审查。
改动思路 / Approach
复用已有 managed claim、projection outbox 和 project-markdown preview,Python 只裁剪成功响应的展示诊断;领取与租约判断仍由原 typed owner 负责。 当前范围是 quota 显示的领取命令和成功 JSON receipt;原 Host cli_args、完整显式 claim、pending/failed recovery 与 canonical transaction 保持。
直接删除所有 projection 信息会隐藏需要处理的错误;额外建立诊断服务又重复现有 preview。当前实现只引用成功结果中的逐 Todo 展示明细,其余 status、count、operation、next action 都保留。详情命令不带 --execute,并固定到已报告的 provider revision;版本推进后应读当前投影,不能为了看详情重复领取。
具体改动 / Changes
关键代码讲解
_thin_claim_projection同时核对 projection schema、delivered/current、finish、parse/render parity、narrative preservation、非 legacy 和逐项数量。任何条件不足都会保留完整响应;只有成功且确实存在省略记录时才移出omitted_active_records。project_selected_todo_execution_preparation只给 Agent 可见的command_line加 --thin。cli_args未改,严格校验原始 argv 的 native capture consumer 仍能识别历史及当前动作。- 既有
project_current_canonical_todos验证 expected provider revision,preview 在写入分支前结束。新的详情引用复用它,不把 Markdown 展示变成另一份 Todo authority。
独立运行真实 claim/同 Turn ready 场景 8/8 通过(43.08 秒):SQLite 的 72 条记录从 thin success 中移出后可全量只读回查,File 无省略时不添加无用引用;显式 full replay 仍返回同一 operation 和 active lease。两种 provider 的展示路径被故意变为目录后,claim 成功但 projection pending,reason、recommended_action、retryable 与 retry_business_mutation=false 都保留。CLI 参数诊断 106/106 通过(22.25 秒);变更 Python 语法及 diff check 通过。
对主干的风险 / Risks
本轮重点排除“claim 已提交而展示失败,compact 输出却让调用方重新 claim”的反例。实际失败测试及成功分支的严谨条件覆盖了这个风险;同一业务 operation 的 full replay 又验证了 compact 输出没有替换 durable receipt。权限、租约过期、存储写入和 quota settlement 都留在既有 owner,只有 JSON 呈现和支持参数扩展。
语义与 CI 对齐
这是 quota 建议命令的明确展示变化,文档和 help 均披露。原生 Host 的 argv、普通无 flag claim 和 pending 错误保留原语义。next_cli_actions 仍要求使用原 claim reference 继续任务并保持正常 Turn 结算。远端 packet 没有可用 check rollup,未把未知 CI 或作者之前的测试统计作为本轮已通过证据。
我的整体评价 / Verdict
未发现需要阻止合入的新缺陷。现有 flag 与 preview 已足够承载这个优化,helper 留在 Python CLI 边界合理,无需增加 TS 决策 owner、额外持久化或新的详情命令。真实成功、失败与续跑均已独立检查,批准这个精确 head。
检查了 agent-facing JSON receipt、命令与只读详情路径;本 PR 没有渲染 UI 改动。 安装 Host、真实模型成本及完整 hosted/Windows qualification 未验证。 局部输出缩小与整体模型工作成本仍是不同结论。
Reviewer: model_agent · GPT-6 Astra Pro · OpenAI · self_reported
English verdict: APPROVE
Goal And Delivered Outcome
On a busy SQLite Goal, following quota's managed claim command can return a display diagnostic for every Todo whose fields were omitted from the Markdown projection. A 72-Todo fixture returned 14,852 bytes before the agent could resume its original Turn.
The displayed command now uses the existing
--thinoption. The JSON receipt keeps the operation ID, projection status, counts, and next actions. It moves the per-Todo list to a read-only command pinned to the projection's provider revision. Pending projection errors still include their recovery instructions. Explicit claims without--thinreturn the full result, and native Hosts retain the original claim argv.main(beff0f3e55d1f70eceebbd8e78c11f1cff34643b).Author Declaration
docs/project-agent-todo-contract.mdon the intended base, ordinary peer claims and canonical Todo projection recovery.loopx/control_plane/quota/execution_preparation.pyloopx/cli_commands/todo.pyScope And Continuation
This is a CLI output change. The existing claim and projection transactions, state format, and Host argv retain their current behavior. Removing
--thingives the full CLI result. Installed adoption and whole-run model costs require separate evidence.Validation
05384b79fac2a58d5e6223885528829f2747984058cced6d.Frontend / Visual Evidence
Type of Change
LoopX Area
Shared-authority RFC fixture impact
N/A. The typed owner and authority storage are unchanged.
Boundary Checklist