Skip to content

Conversation

@ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Dec 29, 2025

Summary

Fixes PTC (Programmatic Tool Calling) failing in production builds due to missing TypeScript lib files.

Problems Fixed

  1. nanoid not found - nanoid was only a transitive dev dependency (via postcss). Replaced with crypto.randomBytes.

  2. TypeScript lib files missing - The type validator uses TypeScript's compiler API which needs lib.es2020.d.ts and dependencies. electron-builder has a hardcoded filter that excludes all .d.ts files from the asar (electron-builder#5064).

Solution

  • Copy only needed lib files (es5 through es2020, 48 files) to dist/typescript-lib/ during build
  • Rename to .d.ts.txt to bypass electron-builder's filter
  • Custom compiler host in typeValidator.ts maps TypeScript's requests back to the renamed files

Other Changes

  • Collapse code_execution Result boxes by default (was always expanded due to useState bug)
  • Add margin between consecutive code execution blocks
  • Update tool description to emphasize batching calls

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

@ethanndickson ethanndickson added this pull request to the merge queue Dec 29, 2025
@ethanndickson ethanndickson removed this pull request from the merge queue due to a manual request Dec 29, 2025
- Replace nanoid with crypto.randomBytes (nanoid was dev-only transitive dep)
- Copy TypeScript lib files (es5-es2020) to dist/typescript-lib/ during build
- Rename to .d.ts.txt to bypass electron-builder's hardcoded .d.ts filter
  electron-userland/electron-builder#5064
- Custom compiler host in typeValidator.ts resolves libs from bundled dir
- Collapse code_execution Result boxes by default
- Add spacing between consecutive code execution blocks
- Update tool description to emphasize batching over Promise.all note
@ethanndickson ethanndickson changed the title 🤖 fix: replace nanoid with crypto.randomBytes in PTC 🤖 fix: bundle TypeScript libs for PTC type validation in production Dec 29, 2025
@ethanndickson
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ethanndickson ethanndickson added this pull request to the merge queue Dec 29, 2025
Merged via the queue into main with commit 30f8cb5 Dec 29, 2025
20 checks passed
@ethanndickson ethanndickson deleted the tooling-yewq branch December 29, 2025 08:34
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