Skip to content

test(calendar): retain managed tasks across process restarts - #7781

Merged
loopx-agent merged 1 commit into
mainfrom
codex/calendar-task-process-restart-20261101
Nov 1, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/calendar-task-process-restart-20261101

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Existing managed calendar Task recovery tests reconstruct controllers in one Python process. This adds acceptance across actual process exits: fresh Python interpreters reopen the same physical File or SQLite state, retain the original Session and result, honor a saved pause, execute one next independent period after re-enabling, and honor cancellation at a later deadline.

The consumer is the existing managed Session calendar recovery work. This closes a process-boundary evidence gap without changing runtime behavior or introducing a new fixture service.

Author Declaration

Criterion Disposition Implementation / evidence
Retain the exact managed Session, actor, physical Task state and original result across restart implemented Three sequential child interpreters reopen the original disposable store; the test compares the original Turn bytes and message prefix.
Pause prevents work; re-enable permits one next independent window implemented The next deadline is evaluated while paused, then the real HTTP preview/apply transaction enables one new native Task execution and one original reply.
Cancellation survives restart and prevents a later independent window implemented A third child evaluates the following day's deadline and verifies unchanged model calls and history.

Scope And Continuation

The change is confined to the existing calendar integration test module. It reuses the native setup, independent artifact validator, HTTP settings, calendar pump, Task/Turn and physical backend owners. Each child exits before the next starts; there is no Lark transport or external recipient in the resumed local Session.

This qualifies the controlled Python controller/process boundary. Whole-service restart, live model quality, natural production deadlines, complete frontend task authoring and production delivery remain with the existing recurring-task acceptance. No product installation is needed for this test-only increment.

Validation

  • Tested revision: bd531b9fecc68647004404289e265f2b13309343.
  • Run state: finished.
  • Input classes: synthetic, public_fixture.
Check kind Result Evidence / limitation
integration / real_backend passed python -m pytest -q tests/test_managed_session_calendar_tasks.py -k physical_state_survives: File and SQLite cases passed in 56.45 seconds; each uses three fresh child interpreters. The model is synthetic and computes the independently checked artifact.
static passed Ruff, diff hygiene, compilation and bilingual RFC checks; standard premerge selected five direct checks and no additional catalog checks for this test-only diff.
static passed The target-file public-boundary scan is clean. The aggregate local check command remains non-passing because of unrelated existing authority-health errors; it is not reported as an overall pass.
integration failed An earlier run reached the existing 15-second SQLite Turn-wait limit. Separate backend runs and the final serial pair passed without increasing that limit; the earlier timing failure remains unattributed.
real_entrypoint not_run No live accounts, installed service restart or natural production delivery is qualified.

The original in-process lifecycle tests remain unchanged. The final test also advances the cancellation clock to a new deadline, so a completed previous window cannot make that negative case pass accidentally. No performance improvement is claimed.

Frontend / Visual Evidence

  • UI impact: none. No shipped editor, page or renderer changes; screenshots are not applicable.

Type And Area

  • Test update; native managed Session calendar recovery.
  • Shared-authority RFC fixture impact: N/A; no authority format, migration or provider-routing change.

Boundary Checklist

  • Public synthetic fixtures only; no credentials, private evidence, raw traces or local machine paths.
  • No benchmark work or production consumer is introduced.
  • The diff is scoped to the named recovery evidence gap.
  • No paired RFC changes; the bilingual diff check passed.
  • UI impact is none.
  • The commit has its DCO sign-off.

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; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max.

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

动机 / Motivation

维护者需要确认,已安排的任务在重启后仍保留原身份、暂停状态和已完成结果。 旧测试在同一进程重建控制器;新测试让独立解释器读取同一物理状态,下一到期点保持暂停,重新启用后只执行一个新窗口。 File 与 SQLite 均保留原 Session、actor、旧 Turn 字节和消息前缀;后续窗口只有一次模型开始和一条原回复,取消后再下一日没有新增执行。

此 PR 仅新增隔离回归,不改变运行时行为,也不证明线上重启、真实模型质量或自然到期送达。 完整服务进程树重启、真实模型报告质量和生产自然到期交付仍需原有周期任务验收。

改动思路 / Approach

核心差异是让新 Python 解释器重新打开原物理数据,而不是继续借用同一进程里的对象。保留现有 setup、HTTP preview/apply、calendar pump、native Turn 和独立 artifact validator;父进程先关闭旧控制器,各子进程顺序退出后才启动下一次。再次启用仍由原配置 owner 决定执行,测试没有另造持久状态或业务规则。

不修改会继续留下明确的证据缺口;重跑旧生命周期用例不能证明解释器内存丢失后的行为。扩展浏览器 fixture 成独立服务会增加不必要的装配。当前边界只给已有 Task 恢复增加有消费者的回归,没有把未完成的编辑器或自然语言旅程改写成已交付。

具体改动 / Changes

关键内容讲解

  • _resume_calendar_process 使用同一 runtime root、registry、Session 和 actor 重建控制器。暂停或取消时先要求模型请求与历史完全不变;恢复路径通过真实 HTTP 配置启用,完成一个窗口后清除配置。该普通 local Session 没有 Lark transport。
  • test_calendar_physical_state_survives_independent_processes 独立检查子进程 PID、原 Turn 字节、历史前缀、不同窗口、一次模型开始和每窗一条原回复。取消后的时钟推进到再下一日,避免用“旧窗口已经完成”误充取消证明。PIDs 不要求跨顺序进程永不复用。

独立规格为 周期 Task 合同,revision bc8658523968d2ff5c59d56afeb920fbe95f71ef。original-task-and-session、existing-configuration-transaction、retained-recovery-and-no-replay 在本次隔离边界内 implemented;complete-product-journey deferred,仍由现有产品验收完成。差异仅一份测试文件、105行新增,没有生产、文档、生成资产或兼容分支变化。

对主干的风险 / Risks

没有发现阻塞缺陷。最强反例是同进程缓存掩盖持久化缺失,以及在已完成窗口测试取消而误通过;新解释器和后续到期时钟分别给这两个假设施压。File/SQLite 最终串行两例 PASS(56.45秒),先前单独运行也分别 PASS。Ruff、编译、RFC/差异检查及标准 premerge 的五项直接检查 PASS;该测试差异没有选中额外 catalog smoke。按本 Goal 策略未查询或等待 CI。

首版 fixture 曾错误装配不需要的外部 transport,已在当前差异移除;同轮 SQLite 第一次 native wait 在启动子进程前触及原15秒上限。旧失败完整保留,原因未归因,不能声称已修复其根因。当前分别运行与最终整组验证覆盖同一原生等待及跨进程不变量,没有提高15秒限额或删除生命周期断言;仍应保留再现时的诊断。目标文件公开边界扫描 PASS;aggregate local check 的既有 authority-health 错误没有改称整条命令通过。

已检查既有 controller-only 的 #7706、report fixture 隔离的 #7738 和 editorial 的 #7708。另有同账号25条有界批次观察,存在结果上限且账号被多个 Agent 共用,不作全账号行为推断。该新例保护不同的 OS 解释器边界,保留旧用例的撤权/迟到回调覆盖。没有新增独立 smoke 或第二套服务。合成模型、fake clock、父测试驱动器以及共享 effect-runtime 的生命周期限制仍明确;这不是完整服务树或真实发送恢复验收。

我的整体评价 / Verdict

这是 justified_increment:长期接续行为保持原样,仓库获得对后续周期和旧结果保留的进程边界验证;用户配置、会话和回传步骤不变。主要代价是隔离集成测试增加启动成本,当前两例整体56.45秒;没有费用或运行时提速结论。复用现有测试 owner 和 HTTP 辅助函数,比新服务或新兼容机制更合适,新增测试可单独回退。

当前差异仅为 tests/test_managed_session_calendar_tasks.py,没有渲染、布局或产品文案变化。 没有新增页面验收;已有任务编辑器和线上服务验收仍属后续工作。 完整服务树、真实模型质量与生产自然到期仍欠现有产品工作,不能据此完成其父目标。

English verdict: APPROVE. Head bd531b9fecc68647004404289e265f2b13309343 adds justified process-boundary persistence and no-replay coverage; File/SQLite and required local checks pass. Production service-tree and live-delivery qualification remain outside this increment.

@loopx-agent
loopx-agent merged commit 6e33f2c into main Nov 1, 2026
15 of 30 checks passed
@loopx-agent
loopx-agent deleted the codex/calendar-task-process-restart-20261101 branch November 1, 2026 05:15
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.

1 participant