Skip to content

Isolate Codex hooks in Orca runtime home - #2350

Merged
brennanb2025 merged 10 commits into
mainfrom
brennanb2025/codex-hooks
May 25, 2026
Merged

brennanb2025 merged 10 commits into
mainfrom
brennanb2025/codex-hooks

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • move Orca-launched Codex hooks, trust, auth, and usage scanning to an Orca-owned runtime CODEX_HOME under userData
  • keep system-default Codex auth/config mirrored into the runtime home without mutating ~/.codex/hooks.json
  • write Codex trust presets to both system config and runtime config so Orca-launched Codex sees trusted workspaces
  • merge on top of Restore agent hook opt-out controls #2778's hook controls while intentionally removing the Codex --profile-v2 orca-agent-status path, so Orca no longer writes or launches from ~/.codex/orca-agent-status.config.toml

Migration / User Impact

  • fixes users whose normal outside-Orca Codex was affected by old Orca-managed entries in ~/.codex/hooks.json: the updated install path removes only stale Orca-managed hook commands from the real system hooks file while preserving user/competitor hooks
  • after the updated Orca runs once, outside-Orca codex keeps reading the user's normal ~/.codex without active Orca hooks, while Orca-launched Codex reads Orca's private runtime CODEX_HOME
  • removes the stale Orca-managed ~/.codex/orca-agent-status.config.toml profile block/file created by the Restore agent hook opt-out controls #2778 approach, while preserving any user-authored content in that profile file
  • this prevents Orca's local hooks from causing hook-review noise or dead callbacks when Orca is closed
  • normalizes deprecated [features].codex_hooks to [features].hooks only inside Orca's runtime Codex config, avoiding the Codex 0.133 warning without rewriting the user's real config

Tests

  • pnpm run typecheck
  • pnpm run lint
  • git diff --check
  • pnpm build:relay
  • pnpm vitest run src/main/agent-trust-presets.test.ts src/main/codex-accounts/runtime-home-service.test.ts src/main/codex-usage/scanner-paths.test.ts src/main/codex/codex-config-mirror.test.ts src/main/codex/codex-home-paths.test.ts src/main/codex/hook-service.test.ts src/main/codex/config-toml-trust.test.ts src/main/ipc/pty.test.ts src/main/providers/local-pty-provider.test.ts src/main/providers/local-pty-shell-ready.test.ts src/main/runtime/orca-runtime.test.ts src/shared/tui-agent-startup.test.ts src/main/agent-hooks/server.test.ts src/main/agent-hooks/remote-hook-service-installers.test.ts src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts --config config/vitest.config.ts (15 files, 678 tests)
  • Electron CDP validation against the exact brennanb2025/codex-hooks worktree with isolated ORCA_DEV_USER_DATA_PATH: verified window.api.app.getIdentity() branch/root, runtime CODEX_HOME hook/config/trust install, plain codex launch in demo-project with no Hooks need review, no loading hooks from both, no deprecated codex_hooks, and no orca-agent-status.config.toml warning
  • Local live hook validation: posted a real Codex UserPromptSubmit payload through $HOME/.orca/agent-hooks/codex-hook.sh from an Orca PTY and verified agentStatus.onSet emitted agentType: codex, state: working, the expected pane key, and connectionId: null
  • SSH validation against a throwaway Linux Docker SSH target with real /work/demo-project: built and deployed the relay, installed /root/.codex/hooks.json, /root/.codex/config.toml, and /root/.orca/agent-hooks/codex-hook.sh, verified all 6 remote Codex hook trust entries, spawned a remote Orca PTY with stable pane env, posted through the remote Codex hook script, and verified agentStatus.onSet emitted the expected remote pane with connectionId equal to the SSH target id
  • Remote backing checks: git -C /work/demo-project status --short --branch, git worktree list --porcelain, remote hook files/config, and relay process state were inspected; no remote repo changes were left behind

Made with Orca 🐋

brennanb2025 and others added 10 commits May 19, 2026 14:15
# Conflicts:
#	src/main/daemon/shell-ready.ts
#	src/main/providers/local-pty-provider.ts
#	src/main/providers/local-pty-shell-ready.ts
# Conflicts:
#	src/main/codex/hook-service.test.ts
#	src/main/codex/hook-service.ts
#	src/main/index.ts
#	src/main/ipc/pty.test.ts
#	src/main/ipc/pty.ts
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