Skip to content

Fix RC PTY regression from agent hook build output collision - #2788

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/rc-release-issue
May 25, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/rc-release-issue

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • fixes the RC-only PTY spawn/reattach crash caused by the GUI main bundle linking against out/main/agent-hooks/managed-agent-hook-controls.js and build:cli overwriting that file afterward
  • preserves the Restore agent hook opt-out controls #2778 dev CLI behavior by keeping the Electron main side-entry, but runs build:cli before build:electron-vite so the final packaged out/main file is the Electron/Rollup version
  • keeps orca agent hooks ... available after Electron dev/build output cleans out/main

Root Cause

PR #2778 added an Electron main entry for managed-agent-hook-controls so the CLI import path survived Electron output cleanup. In the release script order, build:electron-vite produced an out/main/index.js that required that side-entry and expected Rollup-generated exports such as claudeHookService. Then build:cli overwrote the same path with the tsc-generated CLI module, which does not export those Rollup-hoisted values. At runtime PTY env construction called claudeHookService.buildPtyEnv() through an undefined export, producing TypeError: Cannot read properties of undefined (reading 'buildPtyEnv').\n\n## Verification\n- pnpm run build:cli\n- pnpm run build:electron-vite\n- verified final out/main/agent-hooks/managed-agent-hook-controls.js exports claudeHookService, getSpawnArgsForWindows, grantDirAcl, and isAgentStatusHooksEnabled\n- verified out/cli/index.js agent hooks status --json still works after the reordered build sequence\n- pnpm run typecheck:node\n- pnpm run typecheck:cli\n- pnpm vitest run --config config/vitest.config.ts src/main/ipc/pty.test.ts src/main/providers/provider-dispatch.test.ts --reporter=dot\n\nNote: the focused vitest run still logs the existing renameSync fs mock warning in provider-dispatch.test.ts, but the suite passes.

Made with Orca 🐋

Co-authored-by: Orca <help@stably.ai>
@Jinwoo-H
Jinwoo-H merged commit c1bd349 into main May 25, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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