Skip to content

test: adjust compaction budgets for slimmer prompts - #4558

Merged
liruifengv merged 1 commit into
mainfrom
test/adjust-compaction-budgets-2.4.1
Oct 30, 2026
Merged

liruifengv merged 1 commit into
mainfrom
test/adjust-compaction-budgets-2.4.1

Conversation

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator

Requirement or Bug

修复 #4557 合入后 main 的 fullCompaction 测试失败;该 PR 合并时尚未包含精简提示词后的预算与断言调整。

Bug Reproduction Steps

在 cca9bae3d7a4c0eba95aec76e1b7aef912238973 运行 CI=true pnpm --filter @moonshot-ai/agent-core-v2 exec vitest run test/agent/fullCompaction/fullCompaction.test.ts,8 条用例因旧 token 数和 40k pre-shrink 预算失败。main CI run 41045333295 的 test (4) 出现同样失败。

Root Cause

#4521 精简内置提示词后,测试夹具仍使用旧绝对 token 数和 40k pre-shrink 预算,导致不再触发预期的 compaction 行为。#4557 在测试修正提交推送前已经合并。

Code Changes

  • 将 3 处绝对 token 断言改为 expect.any(Number),继续检查 compaction 的行为与计数,而不绑定提示词长度。
  • 将 pre-shrink 窗口和对应历史、system prompt、工具 schema 夹具调整为 80k,恢复测试对 pre-shrink 分支的有效覆盖。

仅修改 packages/agent-core-v2/test/agent/fullCompaction/fullCompaction.test.ts,无产品代码或行为变化。

Behavior Changes and Affected Users

None:仅修正测试预算与断言。生产代码、默认配置、公开契约和用户可见行为均不变。

验证:CI=true pnpm --filter @moonshot-ai/agent-core-v2 exec vitest run test/agent/fullCompaction/fullCompaction.test.ts,120/120 通过。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. (本 PR 为测试修复,目标文件 120/120 通过)
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR. (无产品行为变化)
  • Ran gen-changesets skill, or this PR needs no changeset. (测试专用修复)
  • Ran gen-docs skill, or this PR needs no doc update. (测试专用修复)

@changeset-bot

changeset-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 588cd79

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T11:09:47.000193Z 588cd79 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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 30, 2026

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

commit: 588cd79

@liruifengv
liruifengv merged commit a2afdbc into main Oct 30, 2026
17 checks passed
@liruifengv
liruifengv deleted the test/adjust-compaction-budgets-2.4.1 branch October 30, 2026 11: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.

2 participants