Repository navigation
Conversation
Move managed hook scripts to the shared appData runtime, route Windows hook launches through a bash wrapper that preserves cmd.exe flags, and keep the daemon dev PATH prepend from dropping inherited Windows PATH entries. Also record the unified runtime + PTY env target architecture in the managed hook runtime spec.
Tasks 8 and 9 (combined since they are tightly coupled): Task 8 - Resolve PTY spawn env in main process: - Add resolvePtySpawnEnv() in pty.ts to centralize env resolution - Call it in pty:spawn handler before provider delegation - Update DaemonPtyAdapter to pass ambientEnv to daemon subprocess - Update all pty.test.ts assertions to use ambientEnv/envOverrides API - Fix preAllocatedHandle allocation for local PTYs - Remove buildSpawnEnv configuration from LocalPtyProvider Task 9 - Remove PTY provider host env repair: - LocalPtyProvider: trust caller's ambientEnv, don't merge process.env - DaemonPtyAdapter/pty-subprocess: same - drop process.env merge - Both still add terminal-shape defaults (TERM/COLORTERM/LANG/etc.)
- SSH spawns now get ambientEnv: { ORCA_TERMINAL_HANDLE: ... }
- Remote agents can self-identify without full host env resolution
- Update SSH spawn test to expect terminal handle injection
- Fixes 'injects ORCA_TERMINAL_HANDLE for non-local PTY providers' test
|
Linked issue: #1308 I opened the issue first so the two reproducible user-visible failures and the underlying ownership problem have a stable discussion thread. This Draft PR is the concrete implementation proposal for that direction. |
|
Thanks for the draft and for documenting the ownership problem. I recommend closing this PR as superseded rather than rebasing it wholesale: current main has since shipped the narrow Windows managed-hook path fix (#1329), shared managed script path (#1546), managed hook controls and remote installers (#2778), and Windows PATH refresh (#2810), while this branch now conflicts with those paths and would regress SSH remote hook installs, Codex managed runtime home/trust handling, Gemini BeforeTool support, and parallel dev endpoint namespacing. I also found branch-local blockers: I did not push changes, merge this draft, or merge any PR. |
Summary
Problem statement
This branch is attached to #1308.
The current behavior exposed two reproducible problems:
While investigating those failures, the deeper issue turned out to be ownership drift across layers:
What changed
Managed hook runtime
userData-derived runtime root, e.g.orca-devvsorca)PTY environment ownership
ambientEnv,envOverrides, andenvToDeleteWhy this is one PR
I realize this is a large change set, so I am opening it as a Draft PR specifically to get maintainer feedback on scope and direction before expecting merge.
I chose to keep the fixes together because the two visible bugs came from the same ownership problem. Splitting only the symptoms from the infrastructure changes would leave the old contracts in place and make the fix rationale harder to review.
If maintainers would prefer this split into follow-up PRs after agreeing on direction, I am happy to do that.
Testing
Feedback requested
I would especially appreciate feedback on:
userDatanamespace matches project expectationsMade with Orca 🐋