Skip to content

fix platform api build oom#66

Merged
alongubkin merged 1 commit into
mainfrom
codex/fix-platform-sdk-build-oom
Jun 2, 2026
Merged

fix platform api build oom#66
alongubkin merged 1 commit into
mainfrom
codex/fix-platform-sdk-build-oom

Conversation

@alongubkin
Copy link
Copy Markdown
Member

No description provided.

@alongubkin alongubkin merged commit a6efc32 into main Jun 2, 2026
13 of 15 checks passed
@alongubkin alongubkin deleted the codex/fix-platform-sdk-build-oom branch June 2, 2026 18:40
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jun 2, 2026

Greptile Summary

This PR fixes an OOM crash during the @alienplatform/platform-api TypeScript SDK build by moving the 8 GB Node.js heap limit from a NODE_OPTIONS environment variable in the root generate:platform-api script into the sub-package's own build script, using node --max-old-space-size=8192 to invoke tsc directly.

  • client-sdks/platform/typescript/package.json: build changed from plain tsc to node --max-old-space-size=8192 node_modules/typescript/bin/tsc, ensuring the memory limit applies regardless of how the build is triggered (root generate:platform-api, turbo build, or a direct pnpm build inside the package).
  • package.json: The now-redundant NODE_OPTIONS=--max-old-space-size=8192 prefix is removed from generate:platform-api.

Confidence Score: 4/5

Safe to merge — the change is small and targeted, correctly relocating the heap limit so it applies regardless of how the build is invoked.

The memory limit is now baked into the sub-package's build script, which is the right place for it and fixes the OOM for all callers. The only minor concern is the path node_modules/typescript/bin/tsc — while it works under pnpm's symlink layout, ./node_modules/.bin/tsc is the more portable and conventional choice.

Only client-sdks/platform/typescript/package.json needs a second look for the binary path convention; package.json is straightforward cleanup.

Important Files Changed

Filename Overview
client-sdks/platform/typescript/package.json Build script changed from plain tsc to node --max-old-space-size=8192 node_modules/typescript/bin/tsc to embed the 8 GB heap limit directly in the package; path resolves via pnpm symlink but is non-standard compared to ./node_modules/.bin/tsc.
package.json Removes NODE_OPTIONS=--max-old-space-size=8192 from the generate:platform-api root script now that the limit lives inside the sub-package's own build script.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["pnpm run generate:platform-api (root)"] --> B["speakeasy generate sdk"]
    B --> C["pnpm -C client-sdks/platform/typescript build"]
    C --> D["node --max-old-space-size=8192 node_modules/typescript/bin/tsc"]
    E["turbo build (root)"] --> C
    F["pnpm build (inside sub-package)"] --> D
    style D fill:#90EE90,stroke:#228B22
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
client-sdks/platform/typescript/package.json:55
Using `node_modules/typescript/bin/tsc` reaches directly into the package's internal directory tree. The conventional and more portable path is `./node_modules/.bin/tsc` — this is the symlink every package manager (npm, pnpm, yarn) guarantees to create for declared `devDependencies`, and it doesn't depend on TypeScript keeping `bin/tsc` at that exact internal path.

```suggestion
    "build": "node --max-old-space-size=8192 ./node_modules/.bin/tsc",
```

Reviews (1): Last reviewed commit: "fix: increase platform api build heap" | Re-trigger Greptile

"scripts": {
"lint": "eslint --cache --max-warnings=0 src",
"build": "tsc",
"build": "node --max-old-space-size=8192 node_modules/typescript/bin/tsc",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Using node_modules/typescript/bin/tsc reaches directly into the package's internal directory tree. The conventional and more portable path is ./node_modules/.bin/tsc — this is the symlink every package manager (npm, pnpm, yarn) guarantees to create for declared devDependencies, and it doesn't depend on TypeScript keeping bin/tsc at that exact internal path.

Suggested change
"build": "node --max-old-space-size=8192 node_modules/typescript/bin/tsc",
"build": "node --max-old-space-size=8192 ./node_modules/.bin/tsc",
Prompt To Fix With AI
This is a comment left during a code review.
Path: client-sdks/platform/typescript/package.json
Line: 55

Comment:
Using `node_modules/typescript/bin/tsc` reaches directly into the package's internal directory tree. The conventional and more portable path is `./node_modules/.bin/tsc` — this is the symlink every package manager (npm, pnpm, yarn) guarantees to create for declared `devDependencies`, and it doesn't depend on TypeScript keeping `bin/tsc` at that exact internal path.

```suggestion
    "build": "node --max-old-space-size=8192 ./node_modules/.bin/tsc",
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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