Skip to content

fix(scheduler): preserve current Host readback in installed launchers - #6276

Merged
huangruiteng merged 4 commits into
mainfrom
codex/host-ack-launcher-readback-20261012
Oct 12, 2026
Merged

huangruiteng merged 4 commits into
mainfrom
codex/host-ack-launcher-readback-20261012

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

After #6259, installed Unix and PowerShell launchers still dispatched bound scheduler follow-ups directly to Node. A Codex ACK could bypass the entrypoint's actual Host readback, and an outer-controlled follow-up could bypass its existing write guard.

This change routes matched Codex ACKs and outer-controlled calls through the established entrypoint before the same typed scheduler commit. An actual 60-minute Host rejects a declared 30-minute ACK; after actual Host update/readback to 30 minutes, the original bound ACK writes once and replays without another write. Other generated follow-ups retain their native fast path.

Author Declaration

  • Written by: model_agent, GPT-6, OpenAI.

Implemented against

Criterion Disposition Symbol / path Evidence
Actual Codex Host read before ACK commit implemented Unix/PowerShell routing; existing entrypoint Real launchers and actual App API, File/SQLite
Missing/mismatched observations reject before persistence implemented requestFromArgs; existing commit Matching, wrong, absent and ambiguous Host cases
Failure preserves its bound target/observation pair implemented Existing native failure route Actual Unix/PowerShell with invalid Python executable
ACK/replay remains bound to original Turn implemented Existing receipt fence One write, original replay, newer guard rejects stale original
Elapsed timer, installed adoption and pre-model admission qualify separately deferred Existing RFC boundary Not claimed by this PR
  • Self-check: whole diff and native repository validators; identical final test oracles against immutable baseline. No new receipt schema, state engine, configuration switch, or Cron observer.

Scope And Continuation

  • Completed slice: current Host readback and permission enforcement through shipped launcher call paths. The decoder also binds the existing host-match flag to its captured fact and honors an explicit neutral current-RRULE argument for other App adapters; explicit empty observations remain unavailable, while absence preserves their bound observation.
  • Future-facing pass: reuse the existing reader/guard rather than introducing another TOML parser or Python decision branch. Native failure, Trae and unbound compatibility paths retain their owners.
  • Remaining: maintainer review/merge, then qualification of the adopted installation; actual Windows OS, elapsed timer/backoff and pre-model admission remain separate acceptance. Existing SQLite-default/migration program gates are unchanged. This is an independently reversible scheduler repair.

Validation

  • Tested revision: 1b636bc2063a266d987dbbbb16ff697a0dab619e.
  • Run state: finished. Input classes: synthetic, public_fixture.
Check kind Result Public-safe evidence / limitation
static passed Control-plane TypeScript typecheck, repository mypy (19 files), repository ruff scope, Bash syntax, semantic advisory then full inventory smoke, diff/public-boundary checks
real_entrypoint passed 132 focused Python tests: launchers, interpreter selection, console/module entrypoints, controller scope and actual Host binding; zero failures/skips
unit passed 49 TypeScript scheduler commit/follow-up/CLI/receipt-fence tests; flag stripping, wrong and explicitly empty neutral observations reject
regression_parity passed Identical final launcher test oracle on immutable baseline: 10 failures/17 passes; final source passes all 27. Two old module/controller fixtures independently failed on baseline because they omitted actual post-update readback; fixtures now perform it
real_backend passed Disposable canonical File/SQLite stores, actual Codex App API update/readback; wrong 60-minute Host rejected, actual 30-minute Host acknowledged once, original replay idempotent, stale receipt rejected, quota unchanged
real_entrypoint passed Proper wheel build after real bundled-frontend build; independent wheel install and archive-layout Unix launcher outside source checkout, source/provenance checked; actual PowerShell 7.6.6 process on macOS
regression_parity passed Eight alternating archive/console pairs per provider, identical stale denied ACK workload and complete equal outputs. Median archive/console: File 172/167 ms, SQLite 162/155 ms. Bounded startup/read observation, not a formal latency or capacity qualification
integration passed Risk-selected native canary: 15 checks plus 4 direct checks; final exact-scope quality receipt recorded
manual not_run Actual Windows OS, global installation adoption, elapsed timer and pre-model admission; not claimed
  • Coverage: the real launcher/backend matrix exercises both routing and rejection before effects, with original receipt replay and native default-off paths. Disposable probe automation removed. No PostgreSQL authority-store/refactor or provider promotion is changed; no live Goal is used as a mutation fixture.

Frontend / Visual Evidence

  • UI impact: none. No screen, settings editor or configuration capability changed; the existing App API was used for isolated validation. Screenshots and attention/craft review are not applicable.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Control plane
  • Host or runtime integration

Technical Direction

  • Existing overall-roadmap S7/S4/R2 and automatic-execution-admission §5: shared typed Host follow-up semantics across real entrypoints. A passing schedule ACK is not elapsed-wakeup or SQLite-default qualification.

Shared-authority RFC fixture impact

  • No authority-provider routing/promotion or compatibility-projection change. Synthetic canonical File/SQLite conformance arms cover this scheduler boundary; production-scale/legacy/PostgreSQL promotion rehearsal is not claimed.

Boundary Checklist

  • Public-safe diff/body; no private state, raw logs, credentials or local machine paths.
  • No duplicate benchmark work or new benchmark launch.
  • Cohesive reproduced repair scope.
  • UI impact none.
  • All three commits include DCO sign-off.

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: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@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=xhigh

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

精确 head:1b636bc2063a266d987dbbbb16ff697a0dab619e。没有发现阻断这份修复 PR 的问题;这是可独立验收的入口修复,正式安装采用和时间调度仍有边界。

动机

Codex App 用户通过已安装的 LoopX 命令确认定时配置时,会遇到这个问题。 App 定时器已改为30分钟时,旧启动器仍因没有重新读取实际配置而拒绝确认;修复后重新回读并接受一次,重复确认不会再次写入。 真实60分钟配置拒绝声明30分钟的确认;真实30分钟配置确认成功,原回执重放保持单次效果。 这份 PR 不宣称实际时间唤醒、模型启动前准入或新 Goal 默认 SQLite 已完成。 当前正式安装尚未采用此修复,实际 Windows 系统执行、时间唤醒和后续退避仍需原验收。

这里的 ACK 是对实际定时配置的确认,原回执绑定本次执行。旧入口绕过读取或权限守卫,会让后续调度无法取得可信确认;只验证 console 无法证明安装启动器具有相同语义。

改动思路

实际 Host 读取留在已有 Python IO,状态与效果判断留在既有 TypeScript owner;启动器只选择已有入口,避免增加第二份 Host 解析与决策。 本 PR 完整交付启动器到实际回读、拒绝和单次持久化的调用链;合并后的正式安装采用和时间唤醒继续归原验收。

Unix/PowerShell 在已有生成命令中识别绑定的 Codex 确认与 outer-controller 环境,交回已有 entrypoint。它重新读取实际 App 配置,再把观测交给同一 TS commit;其他原生 failure、Trae 和无绑定兼容路径保留。提示生产者生成的 flag 与捕获事实必须一致,读取、决策和效果没有新增平行 owner。相比复制 Node TOML 解析或把所有命令送回 Python,这个边界更小且保留未受影响路径的成本。

具体改动

依据 docs/architecture/rfcs/automatic-execution-admission-v0.md,验收文本固定在 fb5273002fae9d652a0c21c579bb65ee07755f18;先读改动前 §5 Host contracts,而非用本次文档修改证明自身。

  • §5 Host contracts: actual schedule:implemented。实际 App60分钟拒绝声明30分钟,实际更新/readback30分钟后接受一次。
  • §5 Host contracts: reject before effects:implemented。错、缺、歧义 Host 与明确空观测在迁移/写入前拒绝;丢弃 flag 也不能绕过读取路由。
  • §5 Host contracts: failure pair:implemented。失败命令保留原 target/observation,并用无效 Python 路径证明原生路由仍可执行。
  • §5 Host contracts: separate qualification:deferred。源代码和独立候选安装已验;正式安装采用、实际 Windows OS、时间唤醒/退避和模型前准入保持原验收。

关键代码讲解

  1. scripts/loopx:59 的 native dispatch gate 把 matched Codex ACK 和 outer-controlled 调用留给现有 Python entrypoint,其他绑定 followup 继续 exec node。条件使用现有明确 flag;并不在 shell 决定状态迁移。
  2. scripts/loopx.ps1:57 的 needsCodexHostRead 与 isNativeSchedulerFollowup 执行相同选择,保留已有 $LASTEXITCODE 传播。实际 PowerShell7.6.6 进程在 macOS 上验证,不以源码字符串断言替代运行。
  3. heartbeat_followup_cli.ts:191 的 requestFromArgs 校验捕获事实与 --host-match-observed,复用原 identity mismatch 错误。显式 neutral current RRULE 也对其他 App生效;Object.hasOwn 区分参数缺席与明确空值,缺席继续保留其绑定观测,空值不拿旧值冒充新读回。

其余三份测试覆盖真实 File/SQLite、原回执重放、控制范围及已有 source fixture 的 post-update读取。RFC只补当前调用链和已有接受规则的适配边界,没有把未测 timer/hook 写成已完成。七个文件整体审查,没有新模块或持久化协议。

对主干的风险

最强反例是 console 已成功但安装脚本仍跳过 Host读取,或 controlled Goal换 actor 就绕过权限。相同最终 oracle 在不可变主干的 launcher矩阵出现10失败/17通过,在 head全部27通过;TS相同新 oracle 主干10通过/5失败,修复后整个相关 TS套件49通过。source scope测试还覆盖同容器其他 Goal、激活后新增独立 Goal、scope escape以及 owner释放后真实恢复写入,避免修成全注册表误拦截。

最终132项 Python与49项TS验证零失败/跳过;typecheck、mypy、ruff、语义 smoke和风险选择 canary15项加4个direct检查通过。首次 canary 的 missing quality receipt是独立执行门,随后经精确范围质量评审补回执再通过,未改预算消除失败。早期 fixtures没有实际读回的失败独立复现后修正,相关原断言保留。按本 Goal当前政策没有读取或等待远端 CI。

正常构建 bundled前端后完成 wheel、独立 wheel install及 archive-layout启动器,并用实际 App API在隔离 File/SQLite验证错误拒绝→匹配写入→原回执幂等重放→后续 guard稳定和 stale原回执拒绝;quota为0。八对相同 stale拒绝负载的 archive/console全输出相同,median约File172/167ms、SQLite162/155ms,仅是有界启动/读取观察,不能替代正式p95或容量资格。正式安装未切换,实际 Windows OS与timer仍未验证;测试没有修改活跃 Goal或正式automation。

语义与 CI 对齐

复用既有 Host surface、flag、neutral参数和错误码;临时路由布尔值仅留在 launcher。状态/效果继续由typed owner执行。当前新错误是硬拒绝,不是可忽略guidance;没有新权限、peer生命周期或默认 SQLite推广。无 packet指令压缩、冻结门放宽或语义登记绕过。文档及重命名原生Trae测试公开披露调用默认变化。

我的整体评价

结论为 APPROVE,交付判断是 justified_increment:long_horizon improved(后续稳定、原回执单次效果和旧回执失效),user_experience improved(原命令自动完成必要回读,无新手工同步步骤)。本 PR 完整交付启动器到实际回读、拒绝和单次持久化的调用链;合并后的正式安装采用和时间唤醒继续归原验收。

有意改变的是原入口缺陷、丢弃绑定flag以及非Codex显式观测被忽略的行为;native失败、无绑定与非Codex无覆盖观测仍保留。已落实面向未来的复用重构,避免第二份 Host解析/决策;保留真实receipt/独立adapter兼容,不把代码减少等同验收。剩余风险是实际Windows与正式采用/时间资格,runtime合并交maintainer。

English verdict: APPROVE - head 1b636bc2063a266d987dbbbb16ff697a0dab619e; real launchers now reuse actual Host readback and scoped guard before the existing typed commit. 132 Python/49 TS tests, native quality/canary and isolated actual App File/SQLite candidate-install validation pass; Windows OS/global adoption and elapsed/pre-model remain separate.

@huangruiteng
huangruiteng merged commit 39019a3 into main Oct 12, 2026
5 of 8 checks passed
@huangruiteng
huangruiteng deleted the codex/host-ack-launcher-readback-20261012 branch October 12, 2026 04:27
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