Skip to content

test(agent-core-v2): synchronize resume regression with agent disposal - #5442

Merged
RealKai42 merged 1 commit into
mainfrom
codex/issue-013-await-dispose-signal
Nov 25, 2026
Merged

RealKai42 merged 1 commit into
mainfrom
codex/issue-013-await-dispose-signal

Conversation

@RealKai42

Copy link
Copy Markdown
Collaborator

Requirement or Bug

013 的恢复回归从 node:timers/promises 调用 setImmediate()。随后合入的 fixed-waits 检查把这类调用识别为固定等待,导致最新 main 上的 pnpm lint 失败。

Bug Reproduction Steps

在 d983b22ff 运行 node scripts/checks/fixed-waits.mjs。检查报告 packages/agent-core-v2/test/wire/resume.test.ts 的 timers-promises 计数从 0 增加到 1。

Root Cause

旧回归先等 wire 刷新,再让一次事件循环过去,以便夹具进入关闭阶段。测试真正需要的信号是 Agent 服务容器已经开始并完成异步清理。

Code Changes

在现有回归中挂起真实元数据写入,监听 Agent 容器实际的 disposeAsync() 完成,再释放写入。如果夹具先返回,测试立即释放闸门,随后检查落盘顺序。夹具本身与生产关闭实现沿用原有代码。

Behavior Changes and Affected Users

行为 改动前 改动后 受影响人群
恢复回归的关闭同步 wire 刷新后用 setImmediate() 推进事件循环 等 Agent 关闭信号或夹具返回,然后验证写入顺序 运行引擎恢复测试和仓库 lint 的开发者与 CI

Verification

  • macOS 本地从 d983b22ff 复现 fixed-waits 的基线报错。
  • 临时撤掉夹具关闭后的等待,回归仍在写入顺序断言处失败。恢复后,恢复与任务历史套件共 38 项通过,回归连续 12 次通过。
  • agent-core-v2 类型检查、pnpm lint 和 diff 检查均通过。

Checklist

  • 阅读贡献指南并复现基线 lint 阻塞。
  • 保留恢复回归的原断言,并验证其仍能检测过早返回。
  • 变更限于测试,按 changeset 规则豁免。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T15:18:54.785589Z f9e1c0d PR opened
🔒 Security Review ✅ Completed 2026-11-25T15:19:55.184894Z f9e1c0d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@changeset-bot

changeset-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f9e1c0d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@f9e1c0d
npx https://pkg.pr.new/@moonshot-ai/kimi-code@f9e1c0d

commit: f9e1c0d

@RealKai42
RealKai42 merged commit 3d58fad into main Nov 25, 2026
20 checks passed
@RealKai42
RealKai42 deleted the codex/issue-013-await-dispose-signal branch November 25, 2026 15:19
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