Skip to content

fix(summary): bound global-summary and global-gates Effect RPC snapshot payloads - #8514

Merged
huangruiteng merged 1 commit into
mainfrom
codex/global-summary-rpc-bound-20261111
Nov 10, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/global-summary-rpc-bound-20261111

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Delivery Brief

  • Goal / Source: Prevent loopx global-summary and loopx global-gates from failing with TypeScript Effect runtime request is oversized when connected workspaces accumulate large status/quota histories and peer-agent lanes.
  • Current Gap: build_summary_all and build_global_gates serialized full raw collect_status and build_quota_should_run dictionaries (including archived debug fields, verbose run traces, and full replan contexts) into non-snapshot Effect RPC calls, exceeding the 8 MiB default request ceiling on multi-Goal registries.
  • Observable Result: Both readers extract the exact typed source-fact subsets consumed by presentation.global_summary.project and presentation.global_gates.project (global_manager_read.ts), register both local read-only snapshot methods in effect_runtime_snapshot_methods.json, and preserve identical lane, gate, todo, risk, and progress projections without mutating caller inputs.
  • Owning Boundary: loopx/summary_all.py (host source-fact extraction) + loopx/control_plane/effect_runtime_snapshot_methods.json (snapshot method allowlist); loopx/control_plane/presentation/global_manager_read.ts retains full projection ownership.
  • Bounded Refactoring: Applied source-fact projection helpers (_status_source_facts, _quota_source_facts, _item_source_facts, _todo_item_source_facts) adjacent to _read_facts in loopx/summary_all.py.

Verification

  • uv run --extra test python -m pytest -q tests/test_summary_all.py (38 passed, including multi-MiB source compaction + File/SQLite real peer-manager subprocess reads)
  • npm run -s typecheck:control-plane (passed)
  • uv run --extra test python -m ruff check loopx/summary_all.py tests/test_summary_all.py (passed)
  • uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main (status: passed, 10 checks, 0 failures)

…bal-gates RPC

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent force-pushed the codex/global-summary-rpc-bound-20261111 branch from 07c2272 to e08094a Compare November 10, 2026 17:39

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

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

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max

审查 head e08094a43d1a1c821d8b757ed9d513103c0ce1b8。

动机

通过 global-summary 和 global-gates 处理多个 Goal 的操作者,需要看到所有已读取范围内的运行项和决策门,尤其是队列后面的 Agent。主干会把大份状态和 quota 数据直接送进 Effect RPC。多 Agent 或长历史累积后,两条命令可能在生成摘要前就因请求过大退出。新路径只发送投影器使用的事实,仍过大的请求交给现有本地 snapshot。两条真实 CLI 在相同合成大负载下由失败变为成功,四个结果与主干的同义小输入逐字段一致。第九个 Agent 的任务、两条用户 gate、controller gate、风险和有效历史均保留。File 与 SQLite 的真实来源用例也通过。本次范围是只读 CLI 和其投影传输。真实超大工作区的最大容量、长期成本与安装态表现需要各自的实测。当前交付恢复已复现的超限读取,并保留既有筛选和完整计数。大到超过本地 snapshot 上限的情形仍由现有传输拒绝。

改动思路

宿主沿同一次 status 观察提取必要事实,TypeScript 仍负责 lane、gate、计数与展示的选择。保留字段与既有消费者逐项对照,既有 snapshot 只在当前传输需要时承载请求正文。本 PR 的交付边界是两条全局只读命令的事实输入和 RPC 传输。Agent scope、状态来源、展示数量和任务权限继续由原契约控制。 对照 docs/reference/protocols/global-manager-command-v0.md 在 2d27234ee7eeb0f0a897cf7d432972149f614c87 的既有契约。Source Reads 要求只读并复用单次 status。per-goal quota-evaluation budget 要求按已发现 Agent 完整读取,展示上限不能裁掉候选。an unavailable per-goal quota projection is not a substitute for agent filtering 要求显式过滤时仍核对 Agent 身份。对照验证保留了这三条规则。

具体改动

  • _status_source_facts 保留覆盖来源、队列 Goal 及摘要使用的风险和历史。 _quota_source_facts 保留 quota 资格、Agent 身份和任务关系。 _read_samples 从原始 quota 得到正式 gate 事实,之后才整理 RPC 输入,避免丢失后续 Agent 的 gate。
  • 对 3 个文件的完整公开 diff 做了核对。使用真实 CLI 和 Effect RPC,合成输入在主干生成约 23.5–48.3 MB 请求,四组均被拒绝。评审 head 将同组请求降至约 1.9–7.9 KB,四个输出与主干正常小输入逐字段一致。另用约 10.2 MB 的保留字段验证了两条命令实际走 snapshot 后仍能读回。File/SQLite 路径包含在 head 38 项、主干 37 项源测试中。

对主干的风险

投影字段需要和 TypeScript 消费者同步。配对用例已核对单次 status、同一 quota 调用序列、Agent scope、两条用户 gate、controller gate、错误分支和可见历史。把展示上限设为 1 后,两端输出及 quota 读取序列仍一致。请求超普通传输上限时,复用已有 snapshot 限额、私有路径和摘要校验。标准预合并 6 项直接与 10 项所选检查、TypeScript 类型检查和 Ruff 通过。PR 正文的普通请求上限写成 2 MiB,当前两端源码均为 8 MiB。

我的整体评价

未发现阻塞问题。建议保留现有投影 owner 和局部事实提取,当前修复已覆盖真实 CLI 入口及合成超限反例。实际 diff 没有 App 或 Lark 展示改动。两条 CLI 通过完整 JSON 对照核验了 gate 归属、覆盖计数、问题和下一步。未实测安装态 UI 或超大真实工作区。

English verdict: APPROVE — both read-only commands preserve scoped output under the reproduced oversized payloads and use the existing local snapshot transport when needed.

@huangruiteng
huangruiteng merged commit 5d317fe into main Nov 10, 2026
36 of 46 checks passed
@huangruiteng
huangruiteng deleted the codex/global-summary-rpc-bound-20261111 branch November 10, 2026 18:51
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