Skip to content

test: prune low-value tests and exclude agent-core from the root suite - #3040

Open
sailist wants to merge 1 commit into
MoonshotAI:mainfrom
sailist:refact-045-08-18-test-suite
Open

test: prune low-value tests and exclude agent-core from the root suite#3040
sailist wants to merge 1 commit into
MoonshotAI:mainfrom
sailist:refact-045-08-18-test-suite

Conversation

@sailist

@sailist sailist commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — the problem is explained below.

Problem

The root pnpm test suite has grown slow and noisy: it collects 1,100+ Vitest files, and a first-pass audit found a large number of low-value tests — permanent skips for removed features, accepted-limitation it.fails wishes, unreachable input cases, and matrices duplicated verbatim across the engine / SDK / TUI aggregation layers. In addition, the legacy packages/agent-core (v1 engine) suite is still part of the default gate even though it is no longer the shipping engine.

What changed

Test-only cleanup based on a file-by-file audit; no production code is touched.

  • Delete tests for removed functionality: the whole agent-core/test/agent/compaction/micro.test.ts (24 permanent skips for the removed MicroCompaction), related dead cases in full.test.ts / compaction-scenarios.test.ts / harness/runtime.test.ts, an accepted-limitation it.fails, and an empty agent replay range build suite in agent-core-v2.
  • Delete spy-only and unreachable-input tests: a cron scheduler stop() spy and two CLI cases whose input combinations are already rejected by the real validator.
  • Delete TUI aggregation-layer matrices duplicated in component/util tests (inline skill tokenization, media retain/release counts, AgentSwarm panel states, model effort fallback) from kimi-tui-message-flow.test.ts.
  • Delete strictly redundant search / MiniDB cases: a private-structure restart test in searchService.test.ts, and duplicated batch/TTL/RESP/compaction-race cases in review-round2 / review-fixes / e2e/compaction-race that are covered more strongly elsewhere.
  • Exclude packages/agent-core from the root Vitest projects so local pnpm test and the five CI shards collect the exact same reduced set; the package's own suite can still be run manually inside packages/agent-core.

Verified: full agent-core (4,211 tests), minidb (541), kimi-code affected files (274), agent-core-v2 index (14) and kap-server search (96) all pass; root vitest list confirms the agent-core package is no longer collected while agent-core-v2 remains.

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. (test-only change; remaining suites verified green)
  • Ran gen-changesets skill, or this PR needs no changeset. (tests/tooling-only, not user-perceivable)
  • Ran gen-docs skill, or this PR needs no doc update. (no user-facing behavior change)

- delete dead MicroCompaction/flag tests, an accepted-limitation it.fails,
  unreachable CLI input cases, duplicated TUI aggregation matrices, and
  strictly redundant search/minidb cases identified in the test-suite audit
- exclude packages/agent-core from the root vitest projects so local
  pnpm test and CI shards collect the same reduced set
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 75e9c41

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 Aug 18, 2026

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

commit: 75e9c41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75e9c414ba

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread vitest.config.ts
export default defineConfig({
test: {
projects: ['packages/*', 'apps/kimi-code', 'apps/vscode'],
projects: ['packages/*', '!packages/agent-core', 'apps/kimi-code', 'apps/vscode'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the shipped legacy engine in an automated test gate

When users set KIMI_CODE_LEGACY_FLAG, apps/kimi-code/src/cli/run-shell.ts still selects createKimiHarness, so agent-core remains a supported runtime path rather than an unused package. Both Linux shards and Windows CI run only the root pnpm test command (.github/workflows/ci.yml lines 49 and 109); this exclusion therefore removes all 4,211 agent-core tests from every automated gate, allowing regressions in that selectable engine to merge and ship unnoticed. Keep this project in the root suite or add an explicit agent-core CI job before excluding it.

Useful? React with 👍 / 👎.

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