(Regression) PTY config overlay source dirs#1694
Merged
brennanb2025 merged 6 commits intoMay 12, 2026
Merged
Conversation
Contributor
Author
|
@brennanb2025 i tested the new 1.3.48 release, but it seems i missed something. Fix seemed to work fine with existing workspaces but not with new workspaces. This should fix that. |
Co-authored-by: Orca <help@stably.ai>
…on' into P-de-Jong/opencode-dir-regression # Conflicts: # src/main/ipc/pty.test.ts # src/main/ipc/pty.ts # src/main/pty/shell-startup-env.ts
Co-authored-by: Orca <help@stably.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a regression where Orca created a per-PTY OpenCode/Pi overlay, but could lose the user's original config directory as the source to mirror.
The overlay creation itself was working when Orca already knew the real config dir: the user config contents were mirrored and Orca's plugin was added. The broken case was source discovery/preservation. If Orca launched without inheriting
OPENCODE_CONFIG_DIR/PI_CODING_AGENT_DIR, but the user's shell startup file later exported them,.zshrccould overwrite the PTY-scoped overlay after spawn. Also, nested Orca terminals could inherit an overlay as the public env var and accidentally re-mirror the overlay instead of the user's real config.This patch preserves the original source dir in internal
ORCA_*_SOURCE_*env vars before replacing the public env vars with the PTY overlay, and adds a POSIX startup-file fallback for simple exported config-dir assignments.Fixes #1534
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test src/main/ipc/pty.test.ts src/main/opencode/hook-service.test.ts src/main/pi/titlebar-extension-service.test.tspnpm buildAI Review Report
Reviewed the PTY env injection path for local, daemon, fallback shell, and SSH behavior. The fix is scoped to host-local PTY env construction; SSH paths continue to skip host-local OpenCode/Pi overlay injection.
Cross-platform review: POSIX startup-file parsing is guarded off on Windows. Existing PowerShell and shell wrapper restore behavior remains unchanged. Path handling uses Node path utilities.
Security Audit
Reviewed input/path handling around config-dir discovery. The new startup-file reader only reads known shell startup files under the user home directory and extracts simple env assignments; it does not execute shell code. No new IPC surface, command execution, auth, secrets, or dependency changes.