Skip to content

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

Description

@HypelivebytheHYPER

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions