MoonshotAI / MoonshotAI/kimi-code

Search and text-index workers fail to start on Node.js 25+ (removed --experimental-transform-types flag)

Open
#3,698 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Environment

  • Node.js 25 or newer (tested on v26.8.1, macOS arm64)
  • kimi-code at current main (dev / from-source runs; engines allows >=24.15.0 with no upper bound)

Problem

The global search index and the minidb text-index maintenance worker never start on Node.js 25+. Both spawn node:worker_threads workers with --experimental-transform-types in execArgv:

  • packages/kap-server/src/search/worker/host.ts (search worker)
  • packages/minidb/src/worker/text-build.ts (text-index build worker)

Node removed that flag in v25, so the spawn fails with:

Error: Initiated Worker with invalid execArgv flags: --experimental-transform-types

In the CLI this surfaces as the session search index stuck in degraded state, and full-text index builds silently falling back to the slower inline core. On Node 26 the kap-server search test suite fails (test/search/searchRoute.test.ts, test/search/searchService.test.ts) for the same reason.

Root cause

--experimental-transform-types enabled full TypeScript transformation. Node has run TypeScript through native type stripping by default since v23.6, and the flag was removed in v25 — leaving only the stricter strip-only mode, which additionally rejects constructor parameter properties (used across the two worker closures).

Proposed fix

  • Drop the flag from both execArgv lists (it is a no-op on the supported 24.x range anyway).
  • Rewrite constructor parameter properties as explicit class fields in the worker closures so they parse under strip-only mode (the closures already use explicit .ts import specifiers, scoped by the existing oxlint override).

A branch with this fix is ready: https://github.com/HypelivebytheHYPER/kimi-code/tree/fix/strip-only-worker-node26

Verification

On Node 26.8.1: kap-server search suite 143/143 green, minidb suites green, full repo suite matches its pre-change baseline (remaining failures are pre-existing environment issues unrelated to this change), lint/typecheck clean, CLI bundle smoke passes. CI on Node 24.15 is expected to be unaffected since the removed flag was already a no-op there.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/kap-server/src/search/worker/host.ts and packages/minidb/src/worker/text-build.ts, then run the search tests named in the issue on Node.js 26. Confirm both workers start without the removed flag, the listed search tests and minidb suites pass, and lint, typecheck, and CLI smoke checks remain clean.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend, cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.