Skip to content

Read saved quota fields in the first native tool call - #8111

Merged
huangruiteng merged 1 commit into
mainfrom
codex/read-saved-quota-in-one-call
Nov 6, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/read-saved-quota-in-one-call

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

A native benchmark wake already carries its saved quota decision. Previously the
client used one model/tool exchange to locate the decision reader and a second
to obtain the first facts. This change makes quota context-project --initial-read publish and read the saved capture in one call. A caller that
already knows the required fields can use repeated --select pointers instead.

The existing lifecycle still chooses full or delta presentation after native
SessionStart. The output is the ordinary verified reader page with navigation
attached: continuation and later field selection use the pinned reader, while a
missing output falls back to the same SHA-bound capture. The change adds no
guard, hook, notification, acknowledgement, checkpoint, spend or authority
transfer. Ordinary projection and explicit opt-out remain available.

The rebased implementation consumes prepare_codex_context(...).delivery and
its initial_read_plan, so #8111 uses the sole projection owner introduced by
#8100. It preserves the newer private-capture validation and the main retry
path while adding the one-call saved page.

Current head aa0f9492a1, based on main dd7a1c1034. File and SQLite paths
cover cold/resume delivery, continuation after compaction, concurrent pinned
reads, wrong scope, disabled transport and malformed first-page options.

Validation

  • uv run --extra test python -m mypy: 17 source files, no issues.
  • npm run typecheck:control-plane: passed.
  • Changed Python Ruff, py_compile, RFC bilingual and diff hygiene: passed.
  • Affected Python suites: 379 passed, 15 skipped, with one inherited
    bounded-reader failure that reproduces on main dd7a1c1034.
  • Focused saved-page/native-checkpoint cases: 7 passed, 10 skipped.
  • loopx canary premerge --from-git-diff --git-diff-base origin/main: 19
    selected checks, 0 automated failures, plus the existing maintainability
    advisory and benchmark-sensitive manual review hold.
  • Public/private boundary scan: passed.

These are local interaction and correctness results, not hosted token savings,
solver score gains, live-model adoption or total-cost qualification.

@mergify

mergify Bot commented Nov 5, 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, @loopx-agent.

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 5, 2026

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

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

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

动机 / Motivation

处理已保存 benchmark 唤醒结果的 Agent,需要先取得当前任务和停止条件。

原来先调用投影取得读取入口,再调用 reader 才拿到事实;现在同一次原生工具调用直接返回首读页,已知字段也可一次选取。

已验证首读直接返回当前事实,长内容可继续分页,压缩后仍从原文件恢复,原始决定和权限保持不变。

本次不重新准入、不追加扣额或确认步骤,不切换宿主,也不宣称生产模型节省、solver 分数或长期净收益。

这里批准的是准确 head e5110ce2457464dc38fbf144d163d9a5e8e8c8ab 的这个有界读取能力,未发现阻断项。常规测试及架构检查仍有独立复现的基线失败,下面保留其原状态;批准不等于合并就绪。

改动思路 / Approach

现有 selector 与 reader 已拥有完整性和地址规则;Python 只组合一次发布和读取,没有第二套准入、选择或状态 owner。

当前边界是已保存原生决定的首读;保留普通读取及关闭态,不扩大为宿主升级、调度或效果实验。

不改动会保留每次唤醒的入口发现往返;在 benchmark 提示中自行解析并拼接下一条命令,则会再造一套导航规则。复用产品 reader 直接把首读页交给现有调用方,比后者更小,也没有新存储、控制器或人工准备步骤。原生生命周期仍先确定本次 full/delta,再读取当前完整捕获;页面和导航共同受原输出上限约束。

独立执行了真实 native client 的 cold/resume 两种 benchmark 路径,只有 Responses 推理被本地合成服务替代。生成的首条工具调用实际返回事实,原始决定、选择及明确的轮间 fixture 结算保持不变。这是入口与状态完整性证据,不能证明真实模型理解、生产采用或收费 token 收益。

具体改动 / Changes

完整 diff 为五文件 +121/-13:三处运行时/CLI +37/-10,既有测试 +71/-3,参考文档 +13。没有修改 TypeScript 决策 owner、持久化格式、模型设置或页面。

先读了本次变更之前的 spec_ref docs/reference/required-work-context.md,spec_revision 12803354ab13a003de8620ab496250617224ff37。原文没有给这些小节编号,以下是评审映射:SAVED-IDENTITY 保留原决定身份及零新增 authority IO;BOUNDED-READER 保留输出预算、字节 cursor 和摘要校验;OFF-PARITY 保留关闭态原始完整数据;EPOCH-NOT-TURN 保留压缩后沿原捕获恢复,不重做准入或结算。四项均由当前真实 CLI/native 路径及负例验证,新增“一次首读”的说明不用于倒推旧规范。

关键代码讲解

  • preflight_context_instruction 给既有命令加上 --initial-read,保留原路径、完整摘要及恢复命令;已知字段可以改为重复 --select。
  • project_saved_context_capture 在发布前核对原 Goal、Agent、Turn 与参数组合。普通导航路径继续存在,新读取模式仅在 native JSON、offset0 和明确选择下使用。
  • _saved_context_read_page 调用既有 verified reader,把导航计入同一页面预算;失败仍指向原捕获,而非另一条 guard。地址选择、完整性和生命周期规则继续由原 owner 负责。

同一份合成源在 base 和 head 的传统两步读取中都完整还原。新首读调用在 base 不可用,在 head 直接返回页;长 UTF-8 选择分两页完整还原,压缩后的两个并发读者得到完全相同的值,journal 和文件集合不变。关闭态完整对象、未知后续材料及原始字节也逐值相同。错误 Goal/Agent/Turn、摘要、字段、互斥参数和关闭态首读共七项拒绝均未返回正文。

对主干的风险 / Risks

最强反例是“首屏看起来成功,却把未读尾部当成完整要求”,或者恢复时又发布一次决定。这里沿实际 cursor 读取完整选中值,并核对同一原文件、摘要和压缩后 journal;原醒来消息也仍保留不依赖首次输出的恢复入口。页 EOF 仍不代表全文保留、理解或新的执行权。

语义与 CI 对齐

语义词汇复用既有协议;没有新的状态分类、substring 规则或跨域义务。逐条比较了原/新唤醒文本的 actor、顺序、scope、摘要来源、停止和恢复条件;原约束均保留,明确变化是启用 benchmark 的首读默认直接交付页面。关闭态与普通导航未被该提示自动激活。没有查询、轮询或等待 CI。

PASS:两项 native-client 路径、独立 CLI 正反例、changed-file Ruff、配置指定的17项 mypy 和完整 semantic-vocabulary 检查。标准 premerge 的六项直接检查通过;19项选择检查初次17项通过,缺少 npm TypeScript 依赖的检查在按仓库要求安装后独立通过。原完整 premerge 仍保留其失败记录和 benchmark-sensitive 人工 hold,不能称整体全绿。

FAIL 保留:完整 saved-context 模块在 head 为37通过/2失败/10跳过,base为36通过/相同2失败/10跳过。两项旧默认配置断言的完整失败块、失败 fixture 定义和运行环境一致;显式 inherited off 对照也在两版保留相同三项 omitted-mode 断言失败。另一个 advisory ratchet 的完整 JSON 在仅归一 checkout 根路径后相同,仍是未改动 next-action 函数的62/60 decision-points。没有改阈值、删断言或将失败写为通过;strict CQR 对这些失败保留 failed,并绑定独立基线归因及其他已通过的必需覆盖。

我的整体评价 / Verdict

goal_achieved 仅指这个一次首读的有界能力;long_horizon 为 preserved,原决定与后续选择/结算边界未变;user_experience 为 improved,已有授权和已知字段不再需要额外发现往返,没有新增人工配置或确认。

复用现有 reader 的整理已应用;当前没有生产者填充的 first_read_reference shortcut 可在相邻局部清理时删除,属于非阻断简化建议,不要求另建任务。strict CQR 通过也没有让原失败或合并限制消失。当前分支需要处理 main 冲突;整合产生新 head 后必须重新核验,不能沿用本 head 的结论直接合并。

视觉检查不适用:所审是现有 benchmark 唤醒和 CLI 输出,没有页面、布局或产品显示改动。未验证范围是 noneditable package、native Windows、live receiver 采用、真实模型理解、solver 效果及长期完整费用。独立合成探针保留在私有评审证据中,公开可重放的回归入口是本 PR 的 saved-context 测试;没有上传私有脚本或原始记录。

English verdict: APPROVE — e5110ce delivers the first saved native-context page through the existing verified reader. Real native-client flows, exact-value CLI comparisons, scope failures and post-compaction replay pass. Independently matched baseline failures remain failed; conflict resolution, merge policy and live-model benefit remain separate qualifications.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@huangruiteng
huangruiteng force-pushed the codex/read-saved-quota-in-one-call branch from e5110ce to aa0f949 Compare November 6, 2026 05:58
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 6, 2026

@huangruiteng huangruiteng 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-5 Codex | OpenAI | self_reported

APPROVE. Exact head aa0f9492a1f86e17a7294aa274c1e44a851e09d7 now consumes the prepared projection introduced by #8100 and returns the saved first page through the existing verified reader. The changed path passes 379 tests, with one bounded-reader failure reproduced unchanged on main dd7a1c1034.

动机 / Motivation

处理已保存 benchmark 唤醒结果的 Agent,需要先取得当前任务和停止条件。旧路径先调用一次 context-project 取得 reader 入口,再调用一次 context-read 才获得事实;这会消耗一个没有新决策价值的模型/tool round。

Agents processing saved native benchmark wakes need to read the current task and stop conditions before dependent work. Same immutable saved capture: before, projection returned a navigation object and a second reader call returned the page; after, native JSON context-project --initial-read publishes and reads the first page in one call, while known fields can use repeated --select. The page still exposes continuation, current-field recovery and the original SHA-bound capture. This slice does not re-admit, add spend, change scheduling, prove live-model adoption, claim hosted token savings or establish solver-score gains.

规格依据是 Required work context,固定 revision dd7a1c10348194dd357bdd9dbb74deba5b53fe76。评审映射使用既有条款 SAVED-IDENTITY、BOUNDED-READER、OFF-PARITY 和 EPOCH-NOT-TURN:分别要求保留原决定身份、页与导航共享预算、关闭态原始数据,以及压缩后沿原 capture 恢复。

改动思路 / Approach

现有 TypeScript selector 和 Python reader 已拥有完整性、地址顺序、分页和摘要校验;本 PR 只把已保存决定的发布与首屏读取串在同一次 CLI 调用里。prepare_codex_context(...).delivery 和 initial_read_plan 仍是唯一 projection owner,_saved_context_read_page 只把当前 navigation 与 reader presentation 组合起来。

flowchart LR
  S[Saved quota capture] --> P[prepare_codex_context]
  P --> N[Native navigation + initial plan]
  N --> R[Verified context reader]
  R --> F[First page with navigation]
  F --> C[next_command or recovery.command]
Loading

上图是 exact-head source 的示意,不是运行 receipt。The mechanism remains in the existing transaction, selector and reader owners; the current PR boundary is the first saved page and its bounded continuation, not live-host adoption or benchmark economics. The current PR boundary is the first saved page and its bounded continuation, not live-host adoption or benchmark economics.

具体改动 / Changes

完整 diff 为 5 files、+123/−14。生产实现 3 files、+39/−11;参考文档 +13;测试 fixture +71/−3。没有新增 TypeScript decision owner、持久状态、调度行为或权限模型。

关键代码讲解

  • preflight_context_instruction:把既有 projection command 改为 --initial-read,同时保留原 capture、digest 和 recovery command;已知字段可改为重复 --select。
  • _saved_context_read_page:把 navigation 作为 page presentation 交给既有 reader,首屏和导航共用原 output budget;失败时补原 recovery command。
  • project_saved_context_capture:校验首读只用于 enabled native JSON、offset 0、无 replay/continuation 参数,并消费 #8100 的 prepared delivery 与 pinned selection reference。
  • --initial-read / --select registration:复用既有 reader 参数,不新增命令或状态字段,只扩展 context-project 的合法入口。

SAVED-IDENTITY 由 Goal/Agent/Turn 与 capture digest 校验实现;BOUNDED-READER 由 _saved_context_read_page 和 test_saved_page_continues... 实现;OFF-PARITY 由 default/off 测试实现;EPOCH-NOT-TURN 由 PreCompact 后并发读取同一 reference、journal/文件集合不变实现。

对主干的风险 / Risks

最强反例是首屏看似成功却把未读尾部当成完整要求,或 recovery 时重新发布决定。当前 page 只返回选中的连续字节和 next_command,主动读取会沿原 reference 完成;PreCompact 后两个并发 reader 仍得到同一值,且 journal 与文件集合不变。错误 Goal、Agent、Turn、冲突参数、off 与 malformed request 都在返回 content 前失败。

另一个风险是 rebase 后退回旧 project_codex_context owner。当前实现显式使用 prepare_codex_context(...).delivery,并把 first_read_reference 传给 one-call reader,因此与 #8100 的 capture-bound plan 一致;main 的 private-capture 校验也保留。

验证结果:mypy 17 files、TypeScript strict typecheck、Ruff、py_compile、bilingual 和 diff hygiene 通过。受影响套件为 379 passed, 15 skipped, 1 failed;唯一失败 test_bounded_continuation_rechecks_original_capture_and_utf8_cursor 在不可变 main dd7a1c1034 上以相同断言失败,记为 pre_existing_unrelated。新增 saved-page/native-checkpoint 聚焦用例为 7 passed, 10 skipped;premerge 19 项无自动失败,保留既有 maintainability advisory 与 benchmark-sensitive manual hold,public/private scan 通过。

语义与 CI 对齐

唤醒文本仍然读取同一 immutable capture,actor、顺序、摘要来源、权限、继续和停止条件未变;变化只把展示入口和读取入口合成一次调用。关闭 native delivery 时不接受 --initial-read,普通 projection、context-read 续页和原 recovery 保持可用。remote CI 在审查时仍有 pending job,因此本结论依据 exact-head 本地验证;merge readiness 另行检查。

我的整体评价 / Verdict

goal_achieved 仅指“一次调用取得已保存决定首屏”这个有界能力。long_horizon 为 preserved:原决定、session lifecycle、compaction 后的同一 capture 和后续选择/结算边界都保留;user_experience 为 improved:已有授权和已知字段不再需要先发现 reader 的额外 round。没有 rendered UI 变更,visual review 为 not_applicable,检查面是 CLI/JSON 和 native instruction。

代码体积为 necessary:生产实现复用既有 selector、private IO 与 verified reader,测试覆盖 continuation、compaction、并发、off 和错误 scope;没有另造一个 context pipeline。兼容性没有 persisted contract 变化,属于 co-deployed CLI/presentation 扩展。

English verdict: APPROVE — exact head aa0f9492a1f86e17a7294aa274c1e44a851e09d7 delivers and reads the saved native-context first page through the existing verified reader, preserves #8100's prepared plan and off/recovery parity, and passes the changed-invariant suites.

@huangruiteng
huangruiteng merged commit 39770a9 into main Nov 6, 2026
22 of 46 checks passed
@huangruiteng
huangruiteng deleted the codex/read-saved-quota-in-one-call branch November 6, 2026 06:02
huangruiteng added a commit that referenced this pull request Nov 6, 2026
* Recognize direct exec results in the trajectory tool inventory

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit 8e9946d)
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* fix(chat): reject non-string queued input actions

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

* feat(research): compare real captured LoopX request usage

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

* Honor cross-turn delta independently of progressive context

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

* test: isolate machine CLI smokes from model context transport

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

* Honor scoped Todo resume conditions across external and managed schedulers

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

* Audit active solver coverage across every selected benchmark arm

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

* fix(runtime): preserve raw quota JSON for native goal admission

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

* feat(collaboration): share reader guidance and version return formatting

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

* fix(chat): open long returned answers at their beginning

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

* test(lark): verify full versioned returns through body workers

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

* feat(research): compare real captured LoopX request usage

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

* fix(runtime): preserve raw quota JSON for native goal admission

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

* fix(research): show native command cache and output deltas

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

* fix(chat): preserve queue edits when dismissing actions

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

* docs(readme): remove redundant budget disclosure sentence

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

* fix(collaboration): count budgets using persisted return format

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

* fix(research): compare uncached command request shares

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

* fix(context): preserve async reader handles in code-mode guidance

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

* refactor(control-plane): isolate prompt upgrade CLI rendering

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

* test(control-plane): qualify complete continuation decisions

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

* fix(chat): answer exhausted requests through one restricted review

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

* fix(runtime): wait for launchd job removal during service handoff

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

* test(project): make the no-git registry fixture actually degrade the probe

Signed-off-by: Weimr2627 <134630546+Weimr2627@users.noreply.github.com>

* fix(research): distinguish declared retention from verified adoption

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

* fix(doctor): hold every Git read to one budget

`doctor` inspects a checkout the operator may not control, and none of its
six Git reads had a budget: `rev-parse` twice, the metadata runner behind
`git_metadata_for_root`, `merge-base --is-ancestor`, `remote`,
`remote get-url` and `rev-parse --verify`. A repository blocked on a stale
index lock, a network mount or a very large history therefore held the
diagnostic open with no output at all.

Reproduced with a fake `git` on PATH that only sleeps:
`_is_git_worktree_root` was still running after 5s.

All six reads now go through `_run_git`, bounded by
`GIT_PROBE_TIMEOUT_SECONDS`. The helper answers `None` when the budget runs
out, which is the answer every caller already treats as "unknown": root
detection fails closed, metadata fields stay `None`, revision relation stays
`UNKNOWN`, and the trusted release ref is refused. No new failure mode, and
the diagnostic still returns instead of raising.

The same class in `loopx/contract.py` was bounded in #8152.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(doctor): retire the probe's own group and keep a stale manifest out

Two gaps the review found in the ten-second budget.

`subprocess.run(timeout=...)` retires the Git leader only. Git starts its
helpers -- fsmonitor hooks, pagers, credential helpers -- inside the group it
runs in, so a blocked `status` left the hook and its child behind and repeated
diagnostics accumulated them. The query now launches in a session of its own,
and an exhausted budget retires that group through the existing
`terminate_process_tree` before dropping the pipes instead of draining them: an
inherited pipe outlives the leader, so a drain would wait on work this call no
longer owns. Reproduced with a `core.fsmonitor` hook that never answers and
keeps a child writing heartbeats -- leader-only kill left it growing, the group
retirement stops it.

`_is_git_worktree_root` answered False both for "there is no Git here" and for
"there is Git here and it did not answer". `release_manifest._source_metadata`
stood an older `release.json` in for the second case, so a checkout at commit B
that carried a manifest claiming A wrote A back as its own source. The two
cases are separate states now, and only a checkout with no `.git` of its own
falls back to the recorded manifest; an unanswered read stays unknown.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(doctor): retire the probe's session when the diagnostic is cancelled

The budget covered an exhausted wait, not an interrupted one. Git runs in a
session of its own so the budget can retire its helpers, which also means a
terminal Ctrl-C -- a SIGINT to the process group of the running `doctor` --
never reaches Git. `communicate` raised `KeyboardInterrupt` out of the only
place that owns that session, the diagnostic exited, and the fsmonitor hook
and its child kept running. Repeated cancellations accumulate the same
background work the timeout fix removed.

The wait now retires the owned session on any interrupted exit and re-raises
the original interruption, so an exhausted budget keeps answering "unknown"
while Ctrl-C stays Ctrl-C. Reproduced with the manifest writer CLI, real Git
and a real `core.fsmonitor` hook that keeps a child writing heartbeats:
interrupting the writer's group left the heartbeat growing on the previous
head and stops it now.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(chat): retain context-limit failures in pending work

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

* test(collaboration): recover complete per-turn delegation context

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

* fix(lark): hold the collector's Git reads to one budget

Admitting a collector config path asks Git three questions -- whether the
project is a worktree, whether the file is tracked, and whether it is
ignored -- and none of them carried a budget. A Git blocked on a stale index
lock, a network mount or an oversized index therefore held the command open
with no answer at all; reproduced here with a fake `git` on PATH that only
sleeps, where `_project_config_path` was still running after 5s.

The budget alone was not enough: a `TimeoutExpired` would have escaped the
admission check as a traceback, so the refusal paths had to say what "Git did
not answer" means. Acceptance needs proof that the config is ignored and
untracked, so an unanswered probe refuses the path. The three reads share
`GIT_PROBE_TIMEOUT_SECONDS` through `_run_git_probe`, and a Git that exits
non-zero still takes the existing boundary and non-Git fallbacks unchanged.

The queries are local reads that never fan out into helpers, so the
leader-only kill that `subprocess.run` performs covers them.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(lark): stop the collector's Git questions together with its budget

Two gaps in the config admission.

The budget ended only the Git leader. Git starts helpers of its own -- an
fsmonitor hook is the common one on `ls-files` -- inside the group it runs in,
so a blocked admission returned its refusal while the hook and its child kept
running, and repeated runs accumulated them. The probe now runs in a session of
its own, and an exhausted budget retires that group through
`terminate_process_tree` before dropping the pipes instead of draining them.

The three questions each carried a fresh budget. Once the tracked query had
timed out the admission could no longer be satisfied, yet `check-ignore` was
still started and spent another full budget on the same hang. The questions now
share one deadline, an unanswered tracked query refuses at once, and a question
asked after the deadline has passed is not started at all.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* fix(lark): retire the probe's session when collector-plan is cancelled

The budget covered an exhausted wait, not an interrupted one. The probe runs
in a session of its own so an exhausted budget can retire the helpers Git
started, which also means a terminal Ctrl-C -- a SIGINT to the process group of
the running `collector-plan` -- never reaches Git. `communicate` raised
`KeyboardInterrupt` out of the only place that owns that session, the command
exited, and the blocked Git and its helper kept running. Repeated cancellations
accumulate the same background work the budget fix removed.

The wait now retires the owned session on any interrupted exit and re-raises
the original interruption: an exhausted budget keeps refusing the config,
while Ctrl-C stays Ctrl-C. Reproduced with the `collector-plan` planning entry
in a real child process, real Git and a `git` that blocks the ownership read
with a helper writing heartbeats: interrupting the process group left the
heartbeat growing on the previous head and stops it now.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>

* docs: define router-coordinated controller worker units

Signed-off-by: huangruiteng <huangrt01@163.com>

* fix(chat): compact bounded history before new native turns

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

* docs: prioritize controller attention with safe preemption

Signed-off-by: huangruiteng <huangrt01@163.com>

* fix(runtime): pin qualified service executables behind CLI aliases

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

* docs: make controller worker execution the primary loop

Signed-off-by: huangruiteng <huangrt01@163.com>

* Pin the native first read and deliver the same-Turn selection route (#8100)

* Reuse capture-bound navigation for the first progressive read

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

* Distinguish the pinned reader from an explicit navigation replan

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

* Pin the benchmark preflight view and deliver its same-Turn selection route

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit 47db78b33792e584036b2f099bed4aa0904f7e2b)
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* Reuse prepared Codex read guidance in benchmark checkpoint prompts

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

* Prove progressive benchmark choices from receiver-visible pages

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

* Deliver the captured review command on the first replan read

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

* Validate progressive replan against its published reader contract

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

* Isolate the user skill directory for native context comparisons

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

* Verify explicit guard opt-out on the real CLI

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

* test(quota): exercise the original review after a successor loses its claim

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

* refactor(context): reuse the quota action vocabulary for staged review

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

* fix(types): widen context delivery source values

Signed-off-by: huangruiteng <huangrt01@163.com>

* refactor(context): make prepared native delivery the sole projection path

Signed-off-by: huangruiteng <huangrt01@163.com>

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
Co-authored-by: huangruiteng <huangrt01@163.com>

* Read saved quota fields in the first native tool call (#8111)

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

* Avoid reparsing unchanged private delivery journals during discovery

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

* Verify captured vision audits and share them in one display request (#8113)

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

* Keep delivery discovery hints in their bounded provider module

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

* Reuse unchanged observed acceptance and preference bodies in native first reads (#8124)

* Reuse observed preference and acceptance fields in native first reads

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

* Plan field reuse inside the existing delivery transaction and qualify invalidation

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

* Type the mixed native delivery request for the kernel contract check

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

* Keep private field observation descriptors typed on both native routes

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

* fix: observe reusable fields inside complete parent reads

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

* test: distinguish progressive defaults from delta opt-out

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
Co-authored-by: huangruiteng <huangrt01@163.com>

* fix(canary): retain current main maintainability baseline

Signed-off-by: huangruiteng <huangrt01@163.com>

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: Weimr2627 <134630546+Weimr2627@users.noreply.github.com>
Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
Co-authored-by: Weimr2627 <134630546+Weimr2627@users.noreply.github.com>
Co-authored-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>
Co-authored-by: huangruiteng <huangrt01@163.com>
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