Repository navigation
test: adjust compaction budgets for slimmer prompts - #4558
Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
The behaviour of MoonshotAI#4421 has been in the requester since 94397aa, but its suite still asserted only that the lowered system message lost its `tools` field, which a message kept in place would also satisfy. Assert instead that no system message survives and the history keeps its length, and rename the case after what it protects. Also settle ten ledger rows that were already implemented here: MoonshotAI#3733, MoonshotAI#4413, MoonshotAI#4418, MoonshotAI#4421, MoonshotAI#4435, MoonshotAI#4460, MoonshotAI#4465, MoonshotAI#4516, MoonshotAI#4523, MoonshotAI#4532 and the MoonshotAI#4558 test calibration, each with a probe over the suite that pins it. Two rows carried a probe without a test-name selector (MoonshotAI#4557, MoonshotAI#4558), which aborted `--verify` for every other row; MoonshotAI#4557 is a changelog sync and now carries a manual probe.
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
expect.any(Number),继续检查 compaction 的行为与计数,而不绑定提示词长度。仅修改
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
gen-changesetsskill, or this PR needs no changeset. (测试专用修复)gen-docsskill, or this PR needs no doc update. (测试专用修复)