Skip to content

fix: prevent type-check OOM in business consumers - #1180

Open
baokimho wants to merge 1 commit into
ChatbotXIO:mainfrom
baokimho:fix/check-types-oom
Open

baokimho wants to merge 1 commit into
ChatbotXIO:mainfrom
baokimho:fix/check-types-oom

Conversation

@baokimho

Copy link
Copy Markdown

Summary

Fixes #1169.

Raises the Node heap limit for the six check-types scripts that can OOM when TypeScript loads the @chatbotx.io/business dependency graph.

The scripts now invoke TypeScript directly with:

node --max-old-space-size=8192 ../../node_modules/typescript/bin/tsc --noEmit

This also avoids relying on POSIX-style inline NODE_OPTIONS assignment, so the scripts work from Windows package execution as well.

Validation

Reproduced the failure by limiting the outer Node heap to 2048 MB:

NODE_OPTIONS=--max-old-space-size=2048

A direct tsc --noEmit for @chatbotx.io/business failed with:

FATAL ERROR: Ineffective mark-compacts near heap limit
Allocation failed - JavaScript heap out of memory

With the updated scripts, Turbo completed all six affected workspaces successfully under the same constrained environment:

Tasks: 6 successful, 6 total
Cached: 0 cached, 6 total
Turbo exit code: 0

Validated workspaces:

  • worker
  • @chatbotx.io/ai
  • @chatbotx.io/automated-response
  • @chatbotx.io/business
  • @chatbotx.io/variables
  • @chatbotx.io/integration-api

Also verified with git diff --check.

Copilot AI lite review requested due to automatic review settings September 14, 2026 09:53
@github-actions github-actions Bot added the bug Something isn't working as expected label Sep 14, 2026

Copilot AI 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.

馃煛 Changes recommended

Concurrent type checks may exceed available host memory; resource or concurrency handling needs validation.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates six type-check scripts to use Node with an 8 GB heap limit, preventing TypeScript out-of-memory failures and improving Windows compatibility.

Changes:

  • Replaces direct tsc invocations with explicit Node commands.
  • Preserves --noEmit type-check behavior.
File summaries
File Description
packages/variables/package.json Raises type-check heap limit
packages/business/package.json Raises type-check heap limit
packages/automated-response/package.json Raises type-check heap limit
packages/ai/package.json Raises type-check heap limit
integrations/api/package.json Raises type-check heap limit
apps/worker/package.json Raises type-check heap limit
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

馃挕 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

},
"scripts": {
"check-types": "tsc --noEmit",
"check-types": "node --max-old-space-size=8192 ../../node_modules/typescript/bin/tsc --noEmit",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

2 participants