Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"types": "types/index.d.ts",
"files": [
"dist",
"types",
"scripts"
"types"
],
"exports": {
".": {
Expand Down Expand Up @@ -45,7 +44,6 @@
"build:client:watch": " vite build --config ./vite.client.config.ts --watch",
"clear": "rimraf ./dist && rimraf ./types",
"build": "pnpm clear && tsc && pnpm build:server && pnpm build:client",
"postinstall": "node ./scripts/verify-terminal-runtime.js",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. Spawn-helper chmod too narrow 🐞 Bug ☼ Reliability

Removing the @code-inspector/core postinstall hook leaves ensureNodePtySpawnHelperExecutable() as
the only permission repair, and it only chmods the prebuilds/<platform>-<arch>/spawn-helper path. If
node-pty’s helper binary is present in a different on-disk location in a given installation, execute
permissions will no longer be repaired and PTY startup can fail at runtime.
Agent Prompt
## Issue description
The PR removes the installation-time `postinstall` verification/repair hook. The runtime repair helper (`ensureNodePtySpawnHelperExecutable`) currently only attempts to fix execute permissions for a single `prebuilds/<platform>-<arch>/spawn-helper` location, which is not necessarily the only possible location of node-pty’s helper binary.

## Issue Context
`attachTerminalWebSocket()` calls `ensureNodePtySpawnHelperExecutable()` before running the PTY self-test. With `postinstall` removed, any helper locations not covered by the runtime chmod attempt will never be repaired.

## Fix Focus Areas
- packages/core/src/ai/server/ai-terminal.ts[104-118]
- packages/core/src/ai/server/ai-terminal.ts[653-688]
- packages/core/package.json[40-48]

## Suggested change
Expand `ensureNodePtySpawnHelperExecutable()` to try chmod on a small set of candidate helper paths derived from the resolved `node-pty/package.json` directory (not just `prebuilds/.../spawn-helper`). Only add execute bits (e.g., OR with `0o111`) rather than broadening permissions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

"pub": "pnpm publish",
"pub:beta": "pnpm publish --tag beta"
},
Expand Down
333 changes: 0 additions & 333 deletions packages/core/scripts/verify-terminal-runtime.js

This file was deleted.

Loading
Loading