Skip to content

Use compact JSON receipts for managed Todo claims - #8556

Merged
huangruiteng merged 1 commit into
mainfrom
codex/thin-managed-claim-output-20261111
Nov 11, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/thin-managed-claim-output-20261111

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

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 --thin option. 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 --thin return the full result, and native Hosts retain the original claim argv.

  • Outcome basis: reproduced in the standard Codex App quota → managed claim → ready path on File and SQLite.
  • Intended base: main (beff0f3e55d1f70eceebbd8e78c11f1cff34643b).

Author Declaration

  • Written by: model_agent, OpenAI Codex (GPT-6 family).
  • Implemented against: docs/project-agent-todo-contract.md on the intended base, ordinary peer claims and canonical Todo projection recovery.
Criterion Disposition Path Verification
Claim identity, authority and original Turn continuation implemented loopx/control_plane/quota/execution_preparation.py File/SQLite same-Turn ready and native Host tests
Bounded successful JSON; exact detail and actionable errors implemented loopx/cli_commands/todo.py File/SQLite display failure, read-only detail and idempotent replay tests

Scope And Continuation

This is a CLI output change. The existing claim and projection transactions, state format, and Host argv retain their current behavior. Removing --thin gives the full CLI result. Installed adoption and whole-run model costs require separate evidence.

Validation

  • Tested revision: 05384b79fac2a58d5e6223885528829f27479840
  • Run state: finished (local qualification).
  • Input classes: synthetic, public_fixture.
Check kind Result Public-safe evidence / limitation
real_entrypoint passed macOS source CLI, disposable File and SQLite stores. SQLite claim stdout: 14,852 → 3,925 bytes. Guard through ready, including reader output: 48,367 → 37,461 bytes; offline token estimate: 11,619 → 8,779. Same Turn, claim operation, and active lease generation. File claim stdout stayed at 3,333 bytes. These are tool response measurements.
regression_parity passed The SQLite success case on main still emits all 72 diagnostic rows. On the candidate the pinned diagnostic recovers all 72 without a state write, and explicit full replay returns the same operation and lease. Both providers retain display failure recovery.
integration passed 377 focused tests passed and one platform case skipped on the runtime-equivalent pre-amendment revision. After clarifying the help and docs, eight affected CLI cases passed on the tested revision. Eight claim and same-Turn cases also passed with the runtime patch applied to C1 58cced6d.
static passed Ruff, configured mypy, scoped semantic advisory, signed commit, public boundary, and bilingual diff checks.
real_entrypoint passed Standard premerge ran six direct and 19 selected local checks with no technical failures. The exact quality receipt remains non-passing while required hosted checks are outstanding.
integration not_run Full hosted checks, Windows coverage and independent review are pending.

Frontend / Visual Evidence

  • UI impact: none. Source data for visuals: none.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Control plane

Shared-authority RFC fixture impact

N/A. The typed owner and authority storage are unchanged.

Boundary Checklist

  • The diff and this body use public-safe evidence.
  • The change addresses the reproduced CLI response; no benchmark task was duplicated.
  • No paired RFC changed; the bilingual diff check passes.
  • UI impact is none.
  • The commit has a DCO sign-off.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@songoow songoow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

动机 / 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

@huangruiteng
huangruiteng merged commit 3ea25f1 into main Nov 11, 2026
38 of 46 checks passed
@huangruiteng
huangruiteng deleted the codex/thin-managed-claim-output-20261111 branch November 11, 2026 08:06
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.

3 participants