Skip to content

Bound native Markdown Inbox reader output - #9195

Merged
huangruiteng merged 4 commits into
mainfrom
codex/inbox-reader-native-budget-20261121
Dec 4, 2026
Merged

huangruiteng merged 4 commits into
mainfrom
codex/inbox-reader-native-budget-20261121

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Native Codex's shell tool clipped a 12,000-byte Markdown Inbox response even though the command exited successfully. The page could still parse as JSON, but the recovered text was shorter than its declared UTF-8 offset. The caller had to reread the saved page with smaller limits.

Change

Cap the serialized Markdown Inbox response, capture opening, and generated continuation at 5,000 bytes. The same digest-bound reader preserves the complete request text, receipts, and cursors. Recovery guidance now names both flags to lower if a host has a smaller output budget. The JSON command and shared quota reader keep their existing limits.

The implementation reuses the existing native transport profile and private capture path. There is no new CLI option, state transition, or authority check.

Validation

  • On Codex app-server 0.171.0-alpha.13, the same synthetic File workload triggered three byte-gap recoveries on base 7dfdd7a. The candidate used the generated commands with no page-size overrides or clipped pages on File or SQLite. Each candidate run verified the UTF-8 offsets and SHA-256, read all 24 original briefs across a new arrival, and rejected a cursor for a different Agent without writing read receipts.
  • The Inbox regression suite passed 28 cases. Two PowerShell cases were skipped on macOS. Ruff and the changed-path boundary scan passed.
  • The standard local premerge passed all six direct and 18 selected checks against main f0018b1, with the exact-scope change-quality receipt verified.
  • The native test used local inference and isolated stores. Installed Desktop and live Feishu were outside this check. Hosted checks and merge readiness are tracked separately.

Related evidence for the original exact-head Inbox work. #9169

Integration with the delegation reader

  • Tested this head and the original delegation reader together on main 26e7110 from Git tree 80a377b. The native Codex app-server ran two guarded Inbox turns for each isolated File and SQLite store via the stdio Effect runtime. A loopback inference fixture drove the commands. Original delegation reader #9169
  • Both stores reconstructed all 24 briefs with multibyte characters, quotes, and internal whitespace. The reader needed no truncation recovery, and the largest measured serialized response was 4,999 bytes. Plain JSON and the captured Markdown view returned the same briefs and cursor. A different Agent's cursor was rejected without changing read receipts.
  • The combined delegation test suite passed 30 cases. The two PowerShell cases were skipped on macOS. The unchanged PR head also received independent approval. Review

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

@loopx-agent loopx-agent 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.

Reviewer: model_agent · Gemini · Google DeepMind · self_reported

动机 / Motivation

在原生 Codex 会话中调用 manager-inbox read --format markdown 读取含多条请求或长文描述的收件箱时,模型和执行器会遇到工具输出截断问题。在改动前的基线 f0018b1b19 上,Markdown 收件箱默认沿用 12,000 字节上限(如 6.5 KB 中英文页会直接以 8,134 字节内联返回,18 KB 页则会生成 12,000 字节分片),原生 shell 工具在模型历史中截断输出并导致恢复页偏移量与正文长度不匹配;改动后,Markdown 响应开场、私有捕获页与直连恢复命令统一封顶在 5,000 字节,同时引导在继续截断时调小双参数。

所有超过 5,000 字节的 Markdown 收件箱结果都会退避为不超过 5,000 字节的摘要绑定 reader,按 5,000 字节分页并经 SHA-256 与 UTF-8 字节偏移校验无损还原原文和游标;JSON 视图与 quota 首读 12,000 字节预算保持不变。本 PR 不修改 manager-inbox read --format json 输出限制、不改动 quota 首读 12,000 字节常数、不新增 CLI 参数或持久化状态,也不在本地工作树外测试正式 Desktop 安装版与飞书实机。

改动思路 / Approach

如果不区分原生 shell 工具历史保留窗与普通 JSON/quota 捕获通道而直接将 NATIVE_CONTEXT_FIRST_READ_FALLBACK_BYTES 全局降到 5,000 字节,会无故把 quota should-run 首读命令的分页数扩大一倍以上;反之若维持 12,000 字节并在提示中仅泛泛建议“smaller page”,调用方在受限 shell 环境下仍会先遇到一次截断再手动试探参数。因此本方案:在既有的原生传输配置模块 native_context_profile.py 新增专用的 5,000 字节常量 NATIVE_INBOX_MARKDOWN_OUTPUT_BYTES,并仅由 _read_markdown 在构造开场与续读命令时复用,而不改动共享的 NATIVE_CONTEXT_FIRST_READ_FALLBACK_BYTES(12,000 字节)或捕获存储协议。当前 PR 边界仅限定在 Markdown 收件箱渲染入口(manager_inbox.py)、传输上限定义(native_context_profile.py)、能力文档说明及对应契约测试,不扩张到共享 quota 首读器或 JSON 入口。

  • 复用与边界清晰:不变量(摘要与偏移一致、不重复写读取回执)仍由既有的 context_capture_read_command 与 decision_capture 单点负责;manager_inbox.py 仅作为渲染与传输上限消费者引用新常数;--format json 出口完全不受影响,保留原始完整结构输出。

具体改动 / Changes

  • 规范基线与逐条映射:对照变更前的 loopx/capabilities/manager_context/README.md(不可变基线 spec_revision: f0018b1b19c884a8fbe6b1f88a75c479ae296c71)对原生收件箱读取契约的逐条判定:
    • MC-full-delivery(implemented):继续完整保留请求原文、状态、读回执、警告与分页游标(tests/test_delegation_turn_context.py 28 passed 及 6.5 KB 中文多字节对照验证无损重装)。
    • MC-digest-bounded-reader(implemented):超限 Markdown 页继续退避为绑定 SHA-256 与 UTF-8 字节偏移的私有 reader,读回保存捕获时不重复写 Inbox 回执(manager_inbox.py:111-169)。
    • MC-json-parity(implemented):普通/JSON CLI 路径维持原状,不被 5,000 字节限制截断或转为捕获器(实测同一 4 条中文收件箱 JSON 输出 36,597 字节完整返回,Markdown 输出 2,013 字节开场)。
    • 文档同步审阅说明:本 PR 同步将 loopx/capabilities/manager_context/README.md 中英文段落描述的 12,000 字节预算更新为 5,000 字节序列化输出上限(含读取命令和导航),与实现边界及 docs/reference/required-work-context.md 中的 quota 12,000 字节职责分离保持一致。

关键代码讲解

  1. NATIVE_INBOX_MARKDOWN_OUTPUT_BYTES(loopx/control_plane/turn_driver/native_context_profile.py:13-15):新增独立常数 5000,同时保留 NATIVE_CONTEXT_FIRST_READ_FALLBACK_BYTES = 12000 供 quota_capture.py 与 quota_native_context.py 继续使用,避免波及非 Markdown 收件箱路径。
  2. _read_markdown(loopx/cli_commands/manager_inbox.py:111-169):将 limit 由 NATIVE_CONTEXT_FIRST_READ_FALLBACK_BYTES 切换为 NATIVE_INBOX_MARKDOWN_OUTPUT_BYTES,使内联门限、短引用 short_command(page_bytes=5000, max_page_output_bytes=5000)、直连 direct_command 及开场尺寸校验一致受 5,000 字节约束;同时将第 145-146 行恢复指引从泛称“smaller page”细化为同时指定 --page-bytes 与 --max-page-output-bytes。
  3. test_unbound_cli_first_read_leaves_inbox_rows_to_its_required_read(tests/test_delegation_turn_context.py:216-347):将 5 处输出断言上限由 12_000 收紧到 5_000,覆盖开场、分页、引用丢失报错(<= 5000)及超限失败分支。

本 PR 共改动 4 个文件(+19 / -12 行):生产代码 2 个文件 +7 / -3 行,测试 1 个文件 +6 / -5 行,双语文档 1 个文件 +6 / -4 行;无新增模块、协议字段或状态流转。

对主干的风险 / Risks

  • 活跃调用路径与无退化边界:manager_inbox.py:555-558 仅在 manager_inbox_action == "read" 且 format == "markdown" 时调用 _read_markdown;经实测同一 4 条中文收件箱下 --format markdown 输出 2,013B 摘要开场而 --format json 仍完整输出 36,597B 原始数组,确认无非 Markdown 路径溢出。
  • 中文多字节与降级路径反例验证:在 a789e210c3 独立运行 6.5 KB 中文多字节边界样本(介于 5,000 与 12,000 字节之间)时,基线 f0018b1b19 直接内联返回 8,134B(未分页),而候选输出 2,012B short_opening 并拆分为 3 页(每页 <= 5,000B)无损重建原始 JSON 与 next_cursor;当 private_capture_supported() 为 False 退回 direct_opening 时仅 1,571B <= 5,000B;按新提示将 --page-bytes 2000 --max-page-output-bytes 2000 调小后输出精确限制在 2,000B 内。
  • 文本义务对齐:manager_inbox.py:145-146 与 README.md:371-388 的提示更新仅把预算数值与两个分页参数显式化,未削弱摘要校验、EOF 读取与“不代表收件箱为空/不自动消费回执”等安全条款。
  • 本机验证结果:
    • tests/test_delegation_turn_context.py:28 passed, 2 skipped(PowerShell 用例在 macOS 跳过)(PASS)。
    • 周边收件箱与分页/回执测试(test_inbox_pagination.py、test_inbox_receipt_recovery.py、test_inbox_read_recovery.py、test_manager_context_roundtrip.py):177 passed(PASS)。
    • ruff check PASS;mypy(17 个内核源文件)0 errors(PASS);canary premerge --tier quick 4/4 检查组通过且公开边界 loopx check PASS。
    • 远端托管 CI 未查询(wait_for_ci=false),正式 Desktop 安装包与真实飞书通道未在本次审查实测。

我的整体评价 / Verdict

本 PR 对 long_horizon 与 user_experience 均判定为 improved:将 Markdown 收件箱及其引导命令严格收敛到 5,000 字节内避免模型侧 shell 工具静默截断,同时在提示中直接给出可执行的双参数恢复指令,且不伤及 JSON 与 quota 首读路径。visual_review 为 not_applicable(已检查 manager_inbox.py、native_context_profile.py 与 manager_context/README.md,无任何前端或 Lark UI 呈现改动,unverified_scope 为 none)。

前后对比与反例探针确认:基线在 5–12 KB 区间内联输出超标且 12 KB 续页过宽,候选严格守住 5,000 字节上限并在中英文多字节分页、直连回退与双参数调小下完全一致;代码净改动仅 +19/-12,未新增冗余副本、未变更公共词汇或权限契约;合并基线仅落后无需冲突的文档与工作台提交。精确 head a789e210c3fb68a69418e31f9fb8b6b33fd9a926 已核对未变,无阻塞性发现。

English verdict: APPROVE — Exact-head review on a789e21 passes with zero blocking findings. Capping Markdown Inbox responses and capture paging at NATIVE_INBOX_MARKDOWN_OUTPUT_BYTES (5000) keeps openings, fallback direct commands, and CJK multi-byte pages within 5,000 bytes while preserving JSON format and quota 12,000-byte parity (28+177 Python tests, base-vs-head CJK/JSON counterfactuals, ruff, kernel mypy, and quick premerge all PASS).

@mergify

mergify Bot commented Nov 21, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @huangruiteng.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

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 HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 21, 2026

@loopx-agent loopx-agent 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.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

托管 Agent 需要在开始工作前读全 Inbox。原生 shell 容量较小时,成功退出的命令仍可能只交付一部分字节。 当前 main 的 #9095 区分 Markdown 开场的限制与已经声明的大页 reader 配置。 用主干现有的明确 64,000 字节配置,在真实 File 和 SQLite 上读取同一批 23 条请求。两种后端都从主干的 5 次 capture reader 调用增加到本头的 59 次,逻辑页仍为 2 页,全文和原游标均读回。普通 reader 和直连恢复命令都忽略了原显式预算。 提案将 Markdown 开场、直连恢复和引用续读统一限制在 5,000 字节,并明确两项恢复参数。 本轮核验真实本地 CLI、File 和 SQLite。没有复跑托管 CI 或正式安装版 Desktop 的原生输出限制。

改动思路 / Approach

沿现有 Markdown 展示边界限制开场,续读继续使用同一个不可变 capture 和精确字节偏移。 已记录的 Inbox 读取和回执保存在当前作用域,页长由输出现实决定。 沿用主干的显式 native reader 配置,默认以较小预算保护未知容量 shell,避免给 quota 和 JSON 路径引入新的全局限制。

具体改动 / Changes

逐项检查当前头 a789e21 和 merge base 7dfdd7a,4 个文件,+19/-12。当前主干 a6ffb3b 与提案在 Markdown Inbox 预算选择和原生验收测试发生内容冲突。当前主干规范明确了已声明容量的兼容路径。 评审依据为 a6ffb3b。 目标规范

  • bounded-markdown · Keep unknown-capacity native Markdown openings and reader outputs within the intended conservative bound.
  • complete-capture · Preserve all original requests, digest, offsets and cursor after bounded reads.
  • declared-reader-profile · Preserve the existing declared capture-reader output profile for qualified hosts.

关键代码讲解

  • Markdown 开场 计算含结尾换行的 UTF-8 字节数,再决定是否提供捕获引用。
  • 原来源恢复 生成直接和短引用命令,两路均使用单一 5,000 字节限制。
  • 共享原生配置 保留 quota 配置,增加 Inbox 专用常数。
  • 主干正反验收 覆盖两种后端、声明大页、摘要恢复和逐页进度。

对主干的风险 / Risks

[P2] 收紧未知容量时保留已声明的大页 Inbox 读取能力。 在 #9095 的预算 owner 上收紧未知容量时的 Markdown 开场和续读。对已明确声明且能保留较大输出的调用保留原 reader 路径。如需收缩已声明容量的行为,应更新相应契约,并以同一负载明确权衡补读成本。 这些新增调用都发生在业务工作之前。默认压缩的收益已经能独立验收,配置大页的宿主仍需有可用预算。

在 5,000 字节路径,两个后端均完整读回 23 条多字节请求,且所有 capture reader 的最大序列化输出为 5,000 字节。摘要、原不可变文件与 byte offset 验证均通过。相对实际分叉点,本地 quick premerge 通过。 同一强制断言在当前 main 的 File/SQLite × 12,000/64,000 矩阵通过。旧分叉点没有主干新增的显式覆盖接口,提案准确头也未继承它。 两种后端的本地输出与分片数已测量,实际宿主的保留效果和长期总成本未从这些数字推断。

我的整体评价 / Verdict

请求修改。沿现有 Markdown 展示边界限制开场,续读继续使用同一个不可变 capture 和精确字节偏移。 已记录的 Inbox 读取和回执保存在当前作用域,页长由输出现实决定。 5,000 字节路径正确交付全文。当前主干的显式大页路径尚未与该修改完成集成。 请复验小窗保底与已声明大窗两支,记录两个路径的最大全量输出和读取调用数。

English verdict: REQUEST_CHANGES at a789e21. The 5 KB path preserves multibyte content and capture recovery. Current main respects an explicitly declared 64 KB reader profile. For the same 23 requests on File and SQLite, this head increases reader calls from 5 to 59 on each. Preserve the explicitly qualified reader path when integrating the narrower fallback.

Comment thread loopx/cli_commands/manager_inbox.py Resolved
@loopx-agent

Copy link
Copy Markdown
Collaborator

已把原 PR 的提交历史保留下来,消解与主干的冲突。分页实现沿用 #9204,新提交修正了回归测试。开场可以显示请求计数和后续读取指针,原始请求行仍需通过 Inbox reader 读取。测试还会检查显式大页配置下的实际读取次数。

在 db4b26a 上,File 和 SQLite 都完整读回相同的 23 条请求,均为 2 个逻辑页。显式声明 64,000 字节时,两个后端都只调用 reader 5 次。未声明容量时,每次输出最多 5,000 字节,共调用 60 次。测试同时核对了请求全文、原游标、捕获摘要和直接恢复命令。4 个组合均通过,premerge canary 通过。请按此提交复审。

@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Dec 2, 2026
@mergify

mergify Bot commented Dec 2, 2026

Copy link
Copy Markdown

Hi @huangruiteng, the DCO Sign-off check did not pass. Please inspect
its details first: checkout, fetch, timeout or infrastructure errors
need their own recovery, not a rewrite of otherwise signed commits.

If the log confirms a missing Signed-off-by trailer, amend the
affected commit with git commit --amend -s; for multiple commits,
use an interactive rebase against the current base from the correct
base-repository remote and sign off each affected commit. Push the
rewritten PR branch with git push --force-with-lease origin HEAD.

loopx-agent
loopx-agent previously approved these changes Dec 3, 2026

@loopx-agent loopx-agent 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.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

Code review conclusion

动机 / Motivation

原生托管 Agent 在准入前需要读完实际 Inbox,同时保持 opening 预算、原请求身份和已有资格的大页能力。 当前提案把已合入的 Inbox 宿主预算实现和原评审历史衔接,实际可合入增量在既有真实 CLI 用例补足大页调用次数和 summary 归属断言。 相同 23 条多字节请求在当前主干和候选都完整读回。File 与 SQLite 均为两逻辑页;5,000 配置各 60 次 capture read,64,000 配置各 5 次。序列化最大分别为 5,000 与 64,000 字节。 验证为本地实装 CLI 源入口配隔离 File/SQLite。真实 Desktop 上安装后的 shell 截断阈值与实时 Feishu 没有用本批结果代替。

审读提交 db4b26a,冻结基线 f0018b1。

改动思路 / Approach

相对实时目标的有效增量为一个测试文件、增加 4 行、删除 1 行。当前原提交的非主干独有范围包含原提案和后续显式集成提交。 Markdown Inbox opening 保持独立小预算,capture reader 的显式大页由现有 native context profile 决定。候选增加测试约束,复用实际发布的生产实现和 immutable capture reader。

实际目标 main 头 6248a6d 已包含合并后的生产行为。候选合入预览只改一份公开验证文件,GitHub 记录的历史 base 较旧,较旧的祖先链已实测与实时目标合并。

具体改动 / Changes

冻结的接口契约 · 原有权威检查

关键代码讲解

对主干的风险 / Risks

File、SQLite 四组主干对照与四组候选均通过;另外四组补充首读检查通过。 相对实时目标的标准 premerge 执行 5 项直接检查,全通过。目录选择没有额外选中检查。 未声明大页继续走保守 reader。带声明的路径保留原配置。正式工作和认领独立于 Inbox 读取,首读由专门 operator Inbox 命令承接后续 requests。

本地核对精确 tip 的 Git trailer,非 GitHub 生成的本地合并缺少 Signed-off-by。仓库 DCO 规则要求补齐。原预算发现见 上轮评审。

我的整体评价 / Verdict

代码评审通过。 原先忽略显式 reader 预算的问题已解决,测试增量保护当前主干行为。当前 head 是缺少 DCO trailer 的本地合并提交,仍需作者补齐签署后再进入合并。

验证对象为 CLI、不可变捕获和续读命令。 验证为本地实装 CLI 源入口配隔离 File/SQLite。真实 Desktop 上安装后的 shell 截断阈值与实时 Feishu 没有用本批结果代替。

真实配置读回一致,确认原请求留在既有入口,同时保留未声明容量时的隔离。签署和正式合并依旧由各自门禁判断。

English verdict: APPROVE at db4b26a. The tested head preserves the declared 64 KB Inbox reader and the 5 KB fallback across File and SQLite. The first read contains summary/navigation, with original requests reconstructed only by the bounded reader. The tip's missing DCO sign-off remains a separate merge hold.

@huangruiteng
huangruiteng dismissed loopx-agent’s stale review December 3, 2026 04:39

The merge-base changed after approval.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

原生 Codex 会话里的 Agent 在开始工作前,需要先读完收件箱里的交接请求。 原版把续读统一限制在 5,000 字节时,明确能接收大页的宿主也要反复调用读取命令。在同一批 23 条多字节请求上,现有实现允许显式声明容量的宿主用 64,000 字节续读。 这笔 PR 补上调用次数的回归保护。未知容量继续使用小页,声明大页的同一测试最多允许 8 次续读。 合入增量限于测试。验收覆盖源码 CLI 和隔离存储,正式安装版 Desktop 的输出保留和实时飞书交付未实测。

改动思路 / Approach

开场保留可供继续读取的计数和指针,完整内容由同一份私有捕获提供。Markdown 入口限制开场体积,已有宿主预算选择逻辑负责为两种恢复命令设置续读页宽。现有测试可以发现内容丢失,但单凭读回全文无法发现调用次数从 5 次涨到 60 次。沿用现有 File 和 SQLite 测试,把预算能力写为固定负载下的调用次数断言,就能捕捉这种回归。

具体改动 / Changes

审阅提交 db4b26a,前一次通过集成验收的 main 版本是 f2f1810。GitHub 的 PR 文件接口使用旧基线,差异接口因文件超过上限拒绝返回。按两个不可变提交做对比和三方试合并,得到合并树 402fa6f24465998a13a35be945fd7d8a3d9b996c。按这个已验证版本试合并只有一个测试文件 +4/-1,生产读路径、作用域、回执与协议均保持一致。 比较当前主干与 PR 提交

收件箱读取契约 在 f2f1810 约定开场限制、声明容量和捕获恢复。opening-bound 已满足,开场仍有 5,000 字节上限。declared-reader-budget 已满足,显式声明时续读可用完整预算。complete-capture-recovery 已满足,原摘要、字节偏移和下一页游标都可验证。

关键代码讲解

  • test_unbound_cli_first_read_leaves_inbox_rows_to_its_required_read 让两种后端用生成的 CLI 命令读取 23 条交接。新增断言针对 64,000 字节配置,禁止超过 8 次续读。
  • _read_markdown 依据渲染后的字节数决定开场是否引用捕获。它为默认小页和显式大页生成匹配的短引用与直连恢复命令。生产代码已由主干交付,这笔 PR 保护它的调用成本。

对主干的风险 / Risks

[P2] 当前主干的首读断言与本 PR 冲突。 在评审过程中,已合入的 PR #9799 修改了同一测试。以远端 main ca020c4 对当前提交做三方试合并,Git 在此处报告内容冲突。主干的断言既检查父级对象内的 items,也检查扁平路径及其子路径。本 PR 的断言只检查扁平的精确路径。更新分支时保留主干对子对象和扁平路径的两层排除检查,同时保留本 PR 的 8 次大页续读上限,再重跑 File/SQLite 四组合。 当前主干断言 · PR 断言

当前提交的 Inbox 套件 38 项通过、2 项 PowerShell 用例跳过。在 8873983 和 f2f1810 上的两次试合并,分别通过 6 项矩阵与失败分支检查。RFC 双语检查和差异空白检查通过。 两版主干的试合并均复核了 File 和 SQLite 的两种预算,读全 23 条请求和 2 个逻辑页。前一版主干的试合并记录了逐次输出。5,000 与 64,000 字节的配置分别续读 60 与 5 次,最大序列化输出分别为 5,000 与 64,000 字节。第二个已验证的主干版本包含本地权限实现改动,重新运行同一矩阵,大页路径仍满足最多 8 次调用的断言。 首读没有提前展示扁平或嵌套请求列表。短引用丢失时有界报错,直连恢复沿用原摘要和 UTF-8 字节偏移,未新增回执。跨 Agent 读取和不安全捕获路径均被拒绝。

当前测试单独检查扁平 items,未直接检查父级对象里的嵌套条目。可补充检查父级对象内的嵌套 items,把本次探针已经验证的结果保留在长期回归套件里。 当前两个后端的实测均未提前展示两种形态的请求列表。DCO 签署仍是独立的合入条件。 DCO 检查

我的整体评价 / Verdict

请求修改。大页调用预算的回归检查有保留价值。此前两版主干上,23 条交接请求在两种存储上都读回,恢复与作用域检查也通过。现在需要解决当前主干的同一断言冲突并复验,才能确认拟合入版本同时保留预算和首读边界。已检查 Inbox 测试和 Markdown CLI 入口,实际合入增量没有界面或渲染变化。未覆盖正式安装版 Desktop 和实时飞书。其他托管 CI 失败原因未核实。

English verdict: REQUEST_CHANGES — Exact head db4b26a conflicts with current main ca020c4 in the Inbox first-read regression test. Retain main's nested and flattened item-exclusion checks plus this PR's large-page read-count ceiling and rerun the File/SQLite matrix.

@mergify

mergify Bot commented Dec 3, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @huangruiteng.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

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 HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Dec 3, 2026
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Dec 3, 2026
@mergify

mergify Bot commented Dec 3, 2026

Copy link
Copy Markdown

Hi @huangruiteng, the DCO Sign-off check did not pass. Please inspect
its details first: checkout, fetch, timeout or infrastructure errors
need their own recovery, not a rewrite of otherwise signed commits.

If the log confirms a missing Signed-off-by trailer, amend the
affected commit with git commit --amend -s; for multiple commits,
use an interactive rebase against the current base from the correct
base-repository remote and sign off each affected commit. Push the
rewritten PR branch with git push --force-with-lease origin HEAD.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

原生 CLI 的 Agent 在开始工作前要完整读回收件箱交接。 23 条多字节请求可以分两页逻辑读取。即使全文一致,小页需要的续读调用仍显著多于显式大页,曾在该夹具的上一轮试合并中测得 60 次和 5 次。 保住主干的首读隔离断言,并约束声明 64,000 字节容量时的续读次数。这两项保障可以在同一套 File 和 SQLite 验收中一起检查。 相对当前主干只有测试变更。没有扩展到实际安装版 Desktop 或实时飞书验证。

改动思路 / Approach

将当前主干合入 PR 分支,沿用主干已经补强的首读测试。继续使用现有 Markdown 收件箱入口和不可变捕获,单独限制大页配置下的续读次数。两种断言各管一件事。首读不能提前带出逐条请求,显式大页也不应退化成几十次进程调用。

具体改动 / Changes

复审提交 46130bf,基线 ca020c4。上一轮的同文件冲突已解决。对应 GitHub 的最新比较和本地 diff,相对主干仅同一个测试文件增加 3 行,没有生产代码改动。 上一轮评审 · 基线对比

收件箱读取契约 在 ca020c4 约束 Markdown 开场、显式容量和捕获恢复。opening-bound、declared-reader-budget 和 complete-capture-recovery 在现有实现中均保留。
首读断言 检查嵌套和扁平两种请求列表。 续读断言 用现有测试夹具约束配置大页时的调用次数。

对主干的风险 / Risks

当前提交的 Inbox 套件通过 38 项,跳过 2 项需要 PowerShell 的用例。快速合并前检查通过,覆盖 RFC 双语、差异空白和 Python 编译。 File 与 SQLite 在默认 5,000 字节与显式 64,000 字节设置下,均通过 23 条请求原文、两个逻辑页、捕获摘要和 UTF-8 偏移等断言。大页配置续读不超过 8 次。 首读不包含父级对象内的 items,也不包含扁平 items 路径或其子路径。短引用丢失后只从原捕获恢复,不重复写入读回执。当前套件也覆盖其他接收方隔离与不安全的捕获目录。

主干原有的首读校验和 PR 的大页校验同时保留。在已发布的同作者 Inbox 改动中,之前的生产实现和权限校验已经有独立覆盖,这里直接扩充一条现有测试。旧提交的 DCO 缺签仍是独立合并事项。

我的整体评价 / Verdict

批准当前提交,没有阻塞性代码发现。长程执行和用户体验保持已有行为,同一份测试现在同时守住首读边界与大页调用次数。相对主干只有测试断言变化,没有页面或呈现变化。 主机级历史保留与实时飞书仍未实测。旧合并提交的 DCO 缺签仍存在。

English verdict: APPROVE — Exact head 46130bf resolves the conflict, retains main's nested and flattened item exclusions, and bounds declared large-page reads. The Inbox suite passed 38 tests with 2 PowerShell skips. The older DCO sign-off gap remains separate.

@loopx-agent loopx-agent 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.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

Independent review

动机 / Motivation

通过原生 CLI 逐步读取收件箱的 Agent。 保留 5,000 字节的保守输出,同时在显式支持 64,000 字节的宿主上限制读取进程的调用次数。 四个对照组合均读回相同的 23 条多字节请求,均为两个逻辑页。File 和 SQLite 默认各 59 次捕获读取,声明 64,000 字节时各 5 次。序列化最大值分别为 5,000 和 64,000 字节。 验收边界是源码 CLI 原生读取与测试约束。

审读提交 46130bf,冻结基线 ca020c4。

改动思路 / Approach

公开有效 diff 只有既有测试文件新增 3 行。 既有 native context profile 决定声明容量,manager-inbox 生成已固定捕获的 reader 命令。当前提交在原来的生产路径夹具上补充调用次数断言。

读取阶段依旧沿同一个捕获引用,测试计数涵盖实际续页,不冻结正文长度、记录次序或运行耗时。

具体改动 / Changes

  • CALL-BOUND。仅声明大页的 23 条请求夹具限制为最多八次实际读取。 独立验证通过。 test_delegation_turn_context.py
  • CAPTURE-INTEGRITY。完整读回、默认页面预算和短引用失效恢复继续验证。 独立验证通过。 manager_inbox.py

冻结的接口契约 · 原有权威检查

关键代码讲解

对主干的风险 / Risks

完整 Inbox 定向套件 38 项通过,2 项 PowerShell 跳过。基线和候选各 4 个真实 CLI 读取对照。故障注入使基线两组通过,候选两组准确触发新增断言。 Standard premerge 的 5 项直接检查全过,选中检查为空。 首读同时排除扁平和嵌套原请求行。原生捕获按 UTF-8 偏移与 SHA-256 完整恢复,短引用丢失转同捕获直读,读回执保持原字节。

当前 head 已签署,历史合并提交 db4b26a 仍缺 Signed-off-by。代码审查结论与历史 DCO 合并门分别保留。

我的整体评价 / Verdict

代码独评通过。 新断言能捕获内容仍完整但实际读取次数退化的问题。

验证通过 CLI 和真实捕获字节读回。 本轮未运行安装版 Desktop、真实 Feishu 或 PowerShell。两个 PowerShell 用例因平台跳过。

以 GitHub 当前目标和实际分叉点 ca020c4 为冻结主干对照。

English verdict: APPROVE at 46130bf. The test-only change catches extra native reader calls without changing the shipped CLI. File and SQLite reconstructed all 23 requests in five reads with the declared 64,000-byte budget, and the injected 13-read regression fails only on the new assertion.

@huangruiteng
huangruiteng merged commit 12ebfc4 into main Dec 4, 2026
24 of 47 checks passed
@huangruiteng
huangruiteng deleted the codex/inbox-reader-native-budget-20261121 branch December 4, 2026 01:54
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.

2 participants