Skip to content

Only install agent hooks for installed CLIs - #7474

Closed
brennanb2025 wants to merge 6 commits into
mainfrom
brennanb2025/check-clis-before-hooks
Closed

brennanb2025 wants to merge 6 commits into
mainfrom
brennanb2025/check-clis-before-hooks

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This changes managed agent hook auto-install so Orca only mutates hook config for an agent when the matching CLI is positively present on that host, or when a configured command override resolves. Disabling hooks still removes Orca-managed hook entries even if the CLI is gone.

This does not add a manual force-install path, and config status reads remain authoritative rather than reporting a skipped install attempt as current config state.

Design Approach

The implementation adds shared managed-hook target descriptors derived from the TUI agent config, then uses a main-process manifest to derive installers, removers, status readers, and remote support. Local installs use a bounded PATH/override presence detector; SSH installs ask the relay to detect remote CLI presence before opening SFTP. Codex source-control launch prep also routes through the same single-agent presence gate so it cannot bypass startup/settings gating.

Design Review

Design review completed clean. The chosen shape is the standard pattern for this class of problem: gate the managed-config write on positive CLI presence, but keep cleanup ungated so stale Orca-managed entries stay removable even after a CLI is uninstalled. Direct config mutation (rather than a launch-time wrapper) is required because Orca's status hooks must already be present for agents launched outside Orca's own spawn path. Presence-gating the write is a deliberate improvement over prior-art managers that mutate agent config unconditionally.

Implementation

Implemented local, Settings, runtime RPC, offline CLI, Codex launch-prep, SSH, and relay presence-gated install paths. Remote hook install is best-effort after provider registration so SSH becomes usable even if relay PATH probing is slow or unavailable. One deviation from the initial design is intentional: SSH provider registration no longer waits for remote hook install because the relay login-shell PATH probe can be slow; tests verify provider registration continues and hook install remains best-effort.

Completeness Verification

Completeness verification first found the offline CLI async regression, which is fixed and covered. A later final review found Codex launch prep could still install hooks directly; that is fixed by routing through installManagedAgentHooks(..., { agents: ['codex'] }). Final targeted verification reported no blockers.

Headline Status

Implemented. Startup, Settings, runtime settings updates, offline CLI, Codex model/commit-message launch prep, and SSH remote setup now avoid installing managed hooks without positive CLI presence. Cleanup remains ungated.

App Consistency

Compared desktop startup, Settings toggle, CLI orca agent hooks on/off/status, runtime paired-client settings update, Codex source-control generation/model discovery, web fallback/status shape, and SSH startup. The PR fixes the previous mismatch where startup/settings/SSH installed all hook configs regardless of installed CLIs, and preserves config-authoritative status reads plus ungated removal.

Risks And Non-Goals

Remaining gaps: no real Windows runner evidence yet; Windows behavior is covered deterministically for PATHEXT and path parsing. Live SSH Linux behavior was validated with Docker. No visible UI behavior changed, so no screenshot evidence is included.

Tradeoffs

  • Pre-probe vs. self-probing remote hooks (SSH): we probe remote CLI presence (a bounded relay login-shell PATH lookup) before writing any remote hook config, so absent CLIs never get config written on the remote — consistent with the local goal. The cost is one bounded relay round-trip plus the deferral/cancellation machinery. The alternative — write config unconditionally with a self-probing hook command that no-ops when the CLI is missing — would delete that machinery but reintroduce unconditional remote config writes. We chose "don't write config for CLIs that aren't there" over minimal machinery.
  • SSH startup responsiveness vs. first-prompt status: remote hook install is best-effort and runs after provider registration instead of blocking it, so SSH terminals/filesystem/git come online quickly even when the PATH probe is slow or unavailable. The cost is that a remote agent pane spawned in the very first moment may miss status on its first prompt until the background install lands. We chose responsiveness.
  • Launch-prep: promotion always runs, config write stays gated. On a launch where the CLI is genuinely present but the main-process probe can't see it (a cached shell-PATH-hydration failure, or a relative command override that resolves only in the pane's shell), the managed hook config may not be (re)written that launch — but fix(codex): stop 'hooks pending review' from reappearing on every Orca-launched Codex session #7896 approval promotion always runs, so in-Orca /hooks approvals can never be silently swept by stale-trust cleanup. We accept a possible missed config refresh over risking approval loss.
  • File-presence probe, not a CLI spawn: detection is a PATH + executable-bit check (PATHEXT-aware on Windows), which is fast and side-effect-free but can't see CLIs reachable only via shell aliases/functions or a relative-path override. Those resolve to unknown, which never installs and never falsely removes — detection fails safe.
  • Cleanup stays ungated: disabling hooks always removes Orca-managed entries even when the CLI is gone, so removal may touch a config file for an absent CLI — necessary to clean up stale entries a since-uninstalled CLI left behind.

Performance

Perf audit passed. Local detection scans deduped PATH entries against deduped executable candidates; Codex launch prep uses a single-agent filtered detector; SSH adds one bounded relay request and avoids SFTP when no remote CLI is found. No polling, timers, listener leaks, per-pane/session fanout, or telemetry cardinality growth were introduced.

Code Review Loop

The review loop found and fixed: offline CLI override propagation, runtime settings.update awaiting hook application, startup race handling when hooks are disabled during async detection, CLI typecheck coverage for new hook modules, relay login-shell timeout coverage, and the Codex direct-install sibling path. Final targeted review returned clean.

Product Validation

Brennan's PR process validation result: land after fixing full lint. The full lint blocker was an unrelated exhaustive-switch default arm in SourceControlActionRepoOverrideNote.tsx; it was removed and pnpm run lint now passes.

Live SSH validation was run against a Docker Linux SSH target through Electron. The remote had a fake codex CLI and no other agent CLIs; backing remote state showed only Codex hook config was installed, and absent agent config dirs remained absent. Offline CLI smoke with a temp user data path and no agent CLIs returned 14/14 skipped statuses with cli_not_found, then persisted hooks disabled on agent hooks off.

Checks

  • pnpm run typecheck
  • pnpm run lint
  • pnpm exec vitest run --config config/vitest.config.ts src/main/agent-hooks/managed-agent-hook-manifest.test.ts src/main/agent-hooks/local-agent-cli-presence.test.ts src/main/agent-hooks/managed-agent-hook-controls.test.ts src/main/agent-hooks/install-telemetry.test.ts src/main/agent-hooks/remote-managed-hook-installers.test.ts src/main/ssh/ssh-relay-session.test.ts src/relay/agent-hook-cli-presence.test.ts src/relay/agent-hook-cli-presence-timeout.test.ts src/cli/handlers/agent-hooks.test.ts src/main/runtime/rpc/methods/client-ui.test.ts src/main/runtime/orca-runtime.test.ts src/main/text-generation/commit-message-agent-environment.test.ts
  • pnpm run check:reliability-gates
  • pnpm build:relay
  • git diff --check
  • Real offline CLI smoke with temp ORCA_USER_DATA_PATH
  • Live Electron + Docker SSH validation

Post-PR Stabilization

Completed. I ran the required quiet wait, checked PR review comments, issue comments, reviews, and checks, then waited again while the pending verify check finished. Required checks pass: verify, native-smoke (ubuntu-22.04), native-smoke (windows-latest), and track-community-pr; matrix packaging jobs were skipped by workflow conditions.

CodeRabbit later posted five inline comments; all are replied to and resolved. Three were fixed in 08cf8433d: agents omitted from the remote presence map now report remote_presence_unavailable instead of cli_not_found; installManagedHooksOnRemote re-checks cancellation after the SFTP open await before mutating remote config; and relative (non-absolute, non-home) command overrides report unknown presence instead of being probed against the main process CWD. Each fix has a regression test. Two were declined with rationale: the offline CLI cannot reuse the main-process telemetry recorder because the telemetry client imports electron, and the manifest invariant assertion stays CI-enforced because the manifest is static and a runtime throw would conflict with fail-open startup.

Follow-up Review Fixes

An adversarial re-review landed three fixes (commit 6b2eb9cd0):

  1. Codex launch-prep no longer drops fix(codex): stop 'hooks pending review' from reappearing on every Orca-launched Codex session #7896 approval promotion. Routing launch-prep through the presence gate meant that when the probe couldn't see codex (cached PATH-hydration failure, or a relative command override reporting unknown), install() — and with it the approval promotion — was skipped even though codex was actively launching; the disabled path still promoted, so the asymmetry was backwards. Launch-prep now always runs promotion and only presence-gates the managed-config write. Guarded by src/main/codex/codex-launch-hook-upkeep.test.ts.
  2. Removed a duplicated, now-dead installer loop. The refactor left an identical runManagedHookInstallers/errorStatus in both install-telemetry (electron-coupled, no remaining production callers) and the CLI-safe managed-agent-hook-controls. Deleted the dead copy, kept the single CLI-safe one, repointed the telemetry test at recordManagedHookInstallFailure directly, and added fail-open loop coverage where the loop actually lives.
  3. Honest Windows-remote presence. The relay now reports unknown (not a false missing) on a Windows relay host, and the unused unsupported_remote_platform skip reason was removed.

Checks re-run: pnpm run typecheck, targeted vitest (666 passing across the gate suite), pnpm run check:reliability-gates, pnpm run check:max-lines-ratchet, oxlint on changed files, git diff --check.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7d678104-690e-4d1c-9315-8a4215fb250f

📥 Commits

Reviewing files that changed from the base of the PR and between 6b2eb9c and 881c788.

📒 Files selected for processing (5)
  • config/tsconfig.cli.json
  • src/cli/handlers/agent-hooks.test.ts
  • src/cli/handlers/agent-hooks.ts
  • src/main/codex/hook-service.ts
  • src/main/index.ts
✅ Files skipped from review due to trivial changes (1)
  • config/tsconfig.cli.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/main/codex/hook-service.ts
  • src/cli/handlers/agent-hooks.test.ts
  • src/cli/handlers/agent-hooks.ts
  • src/main/index.ts

📝 Walkthrough

Walkthrough

This change adds shared managed-agent target and executable-token utilities, local and relay-side CLI presence detection, and a manifest-driven hook installation pipeline. Local and remote installers now return structured per-agent statuses with skip reasons and error handling. CLI, IPC, runtime, startup, Codex launch, and SSH relay flows use asynchronous presence-gated installation. Tests cover PATH probing, overrides, timeout cleanup, manifest alignment, status reporting, cancellation, and remote installation behavior. Configuration updates register the new compilation inputs and reliability gate.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: gating agent hook installs on CLI presence.
Description check ✅ Passed The description is thorough and covers summary, implementation, testing, and review, but it does not follow the template’s Screenshots, Security Audit, and Notes sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

♻️ Duplicate comments (1)
src/main/agent-hooks/managed-agent-hook-controls.ts (1)

13-19: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Duplicate ManagedHookInstaller type, errorStatus, and runManagedHookInstallers vs install-telemetry.ts — see linked comment in that file for the functional regression this causes (lost default telemetry on install failure).

This file's runManagedHookInstallers (line 92: onInstallError: InstallOptions['onInstallError'], used as onInstallError?.(agent, error)) does not default to recordManagedHookInstallFailure the way install-telemetry.ts's version does, so call sites that omit onInstallError (e.g., the CLI offline path via applyAgentStatusHooksEnabled) silently skip failure telemetry.

Also applies to: 77-109

🧹 Nitpick comments (5)
src/shared/managed-agent-command-token.ts (1)

7-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Explain the platform-dependent backslash-escape rule.

shouldTreatBackslashAsEscape silently disables backslash-escaping on Windows so that paths like C:\My Tools\claude.cmd survive intact, but nothing states this reasoning inline. A one-line comment would prevent future edits from "fixing" this as an oversight.

As per coding guidelines, "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."

📝 Suggested comment
   const shouldTreatBackslashAsEscape = (options.platform ?? process.platform) !== 'win32'
+  // Why: Windows paths use `\` as a separator, not an escape char, so backslash
+  // escaping must be disabled there to preserve literal path segments like `C:\Tools`.

Source: Coding guidelines

src/main/agent-hooks/local-agent-cli-presence.ts (1)

44-58: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a short comment explaining the Windows X_OK skip.

Skipping the executable-bit check on win32 (Windows lacks POSIX execute permission semantics) is a non-obvious platform quirk that isn't documented inline.

As per coding guidelines, non-obvious platform-driven behavior should have a short comment explaining why.

📝 Suggested comment
     if (platform === 'win32') {
+      // Why: Windows has no POSIX execute-permission bit; access(X_OK) isn't
+      // a meaningful executability signal there, so file existence suffices.
       return true
     }

Source: Coding guidelines

src/main/agent-hooks/managed-agent-hook-controls.test.ts (1)

1-178: 📐 Maintainability & Code Quality | 🔵 Trivial

Missing test coverage for the detection-failure (cli_presence_unknown) skip path.

The suite covers found/missing gating, shouldContinue gating, and the agents filter, but doesn't exercise detectLocalManagedAgentCliPresenceMock.mockRejectedValue(...), which drives the cli_presence_unknown skip branch in installManagedAgentHooks (lines 36-46 of managed-agent-hook-controls.ts).

✅ Suggested additional test
+  it('skips all agents with cli_presence_unknown when detection throws', async () => {
+    detectLocalManagedAgentCliPresenceMock.mockRejectedValue(new Error('probe failed'))
+
+    const results = await installManagedAgentHooks({ agentCmdOverrides: {} })
+
+    expect(installCodex).not.toHaveBeenCalled()
+    expect(installClaude).not.toHaveBeenCalled()
+    expect(results).toEqual([
+      expect.objectContaining({ agent: 'codex', state: 'skipped', skipReason: 'cli_presence_unknown' }),
+      expect.objectContaining({ agent: 'claude', state: 'skipped', skipReason: 'cli_presence_unknown' })
+    ])
+  })
src/main/ipc/settings.ts (1)

122-125: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the shouldHydrateShellPath gate
app.isPackaged && process.platform !== 'win32' is duplicated in src/main/ipc/settings.ts and src/main/index.ts; moving it into a shared helper or constant would keep the hook-install path and runtime wiring aligned.

src/main/runtime/orca-runtime.ts (1)

2480-2493: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Consider guarding against a rapid re-toggle race with shouldContinue.

updateClientSettings applies updateSettings synchronously and then awaits applyAgentStatusHooksEnabled for the previous toggle target. If a second updateClientSettings call flips the setting back before the first install/remove finishes, the two async operations can complete out of order and leave hook state inconsistent with the final persisted setting. applyAgentStatusHooksEnabled/installManagedAgentHooks already support an options.shouldContinue callback for exactly this purpose — it's used at the startup call site in src/main/index.ts (shouldContinue: () => isAgentStatusHooksEnabled(managedHookStore.getSettings())) but not wired in here.

♻️ Suggested fix
       try {
         await applyAgentStatusHooksEnabled(
           updates.agentStatusHooksEnabled,
           {
             agentCmdOverrides: this.store.getSettings().agentCmdOverrides ?? {}
           },
           {
             shouldHydrateShellPath: this.shouldHydrateShellPathForAgentHooks,
-            onInstallError: recordManagedHookInstallFailure
+            onInstallError: recordManagedHookInstallFailure,
+            shouldContinue: () =>
+              this.store?.getSettings().agentStatusHooksEnabled !== false ===
+              updates.agentStatusHooksEnabled
           }
         )
       } catch (error) {

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 793174eb-83b4-49f6-aa76-802aff72c80d

📥 Commits

Reviewing files that changed from the base of the PR and between 0fa8589 and 478fc19.

📒 Files selected for processing (30)
  • config/reliability-gates.jsonc
  • config/tsconfig.cli.json
  • src/cli/handlers/agent-hooks.test.ts
  • src/cli/handlers/agent-hooks.ts
  • src/main/agent-hooks/install-telemetry.ts
  • src/main/agent-hooks/local-agent-cli-presence.test.ts
  • src/main/agent-hooks/local-agent-cli-presence.ts
  • src/main/agent-hooks/managed-agent-hook-controls.test.ts
  • src/main/agent-hooks/managed-agent-hook-controls.ts
  • src/main/agent-hooks/managed-agent-hook-manifest.test.ts
  • src/main/agent-hooks/managed-agent-hook-manifest.ts
  • src/main/agent-hooks/remote-managed-hook-installers.test.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/index.ts
  • src/main/ipc/settings.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/client-ui.ts
  • src/main/ssh/ssh-relay-session.test.ts
  • src/main/ssh/ssh-relay-session.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/relay/agent-hook-cli-presence-timeout.test.ts
  • src/relay/agent-hook-cli-presence.test.ts
  • src/relay/agent-hook-cli-presence.ts
  • src/relay/relay.ts
  • src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.tsx
  • src/shared/agent-hook-types.ts
  • src/shared/managed-agent-command-token.ts
  • src/shared/managed-agent-hook-targets.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.tsx

Comment thread src/main/ssh/ssh-relay-session.ts Resolved
@euclodius

Copy link
Copy Markdown

Possibly relevant WSL hook-transport edge case from #7565 / #7091.

This PR gates managed hook installation on positive CLI presence. That is useful, but a separate WSL failure mode now looks confirmed: a WSL-spawned agent can have the managed hook/extension installed and launched correctly, but still be unable to report status because the injected hook receiver endpoint points at Windows localhost.

Observed with OMP on Windows desktop app + WSL runtime:

  • OMP launched with Orca's managed --extension <orca-agent-status.ts>.
  • OMP process env included ORCA_AGENT_HOOK_PORT, ORCA_AGENT_HOOK_TOKEN, ORCA_PANE_KEY, ORCA_TERMINAL_HANDLE, and ORCA_AGENT_LAUNCH_TOKEN.
  • From inside WSL, curl http://127.0.0.1:$ORCA_AGENT_HOOK_PORT/hook/omp failed with connection refused / 000.
  • The same payload sent via Windows curl.exe returned 204.
  • After the successful Windows-side POST, the OMP agent appeared/updated in the sidebar.

So for WSL agent hooks, presence/install success is not enough; the injected endpoint must be reachable from the WSL process. If this PR touches hook launch/env validation, it would be worth adding WSL coverage for endpoint reachability from the actual spawned agent environment.

brennanb2025 and others added 4 commits July 9, 2026 13:50
…ixes

- Report agents omitted from the remote presence map as
  remote_presence_unavailable instead of cli_not_found; only a positive
  'missing' probe means the CLI is absent.
- Re-check shouldContinue after the SFTP open await in
  installManagedHooksOnRemote so a disposed/replaced session cannot
  mutate remote agent config.
- Treat relative (non-home, non-absolute) command overrides as unknown
  presence instead of probing them against the main process CWD.

Co-authored-by: Orca <[email protected]>
…ax-lines

- Update the issue #7253 remote-installer coverage test to the manifest +
  presence-gated installRemoteManagedAgentHooks signature (droid/copilot now
  install remotely only with positive CLI presence, preserving the #7253 fix).
- Split the remote managed-hook presence gating tests out of
  ssh-relay-session.test.ts into a focused sibling file so both stay under the
  800-line oxlint max-lines limit without any suppression.
…ve-override guard, gate test path

- Restore per-launch Codex hook upkeep on the interactive PTY launch path via a
  shared maintainCodexLaunchHooks() helper (fire-and-forget from the sync spawn
  path, awaited from commit-message prep). This keeps #7896's runtime /hooks
  approval promotion + user-hook refresh running on every Codex launch, which the
  presence-gating refactor had dropped from the interactive path. Enabled installs
  stay presence-gated.
- Relay CLI presence: report 'unknown' for a relative (non-absolute, non-home)
  override path instead of probing it against the relay process CWD, mirroring the
  local detector's guard. Adds a regression test.
- Repoint the agent-hooks.cli-presence-gating reliability gate at the split-out
  ssh-relay-session-agent-hook-presence.test.ts where those assertions now live.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/check-clis-before-hooks branch from 08cf843 to 2fae001 Compare July 9, 2026 23:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
config/reliability-gates.jsonc (1)

2596-2638: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Map assertionRefs for every contract claimed by the oracle.

The oracle includes config-authoritative status reads and ungated removal, but the assertion references only cover local presence, SSH ordering, and relay timeout cleanup. Add refs for the controls, CLI, IPC, and runtime tests that prove those behaviors, or remove the unreferenced claims.

Based on the reliability-gate validator contract in config/scripts/check-reliability-gates.mjs.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ba821b5b-d412-4be2-bb1a-20e2f2425d26

📥 Commits

Reviewing files that changed from the base of the PR and between 08cf843 and 2fae001.

📒 Files selected for processing (16)
  • config/reliability-gates.jsonc
  • config/tsconfig.cli.json
  • src/cli/handlers/agent-hooks.test.ts
  • src/cli/handlers/agent-hooks.ts
  • src/main/agent-hooks/install-telemetry.ts
  • src/main/agent-hooks/local-agent-cli-presence.test.ts
  • src/main/agent-hooks/local-agent-cli-presence.ts
  • src/main/agent-hooks/managed-agent-hook-controls.test.ts
  • src/main/agent-hooks/managed-agent-hook-controls.ts
  • src/main/agent-hooks/managed-agent-hook-manifest.test.ts
  • src/main/agent-hooks/managed-agent-hook-manifest.ts
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/main/agent-hooks/remote-managed-hook-installers.test.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/index.ts
  • src/main/ipc/settings.ts
💤 Files with no reviewable changes (2)
  • src/main/ipc/settings.ts
  • src/main/index.ts
🚧 Files skipped from review as they are similar to previous changes (12)
  • src/main/agent-hooks/managed-agent-hook-controls.test.ts
  • config/tsconfig.cli.json
  • src/main/agent-hooks/remote-managed-hook-installers.test.ts
  • src/main/agent-hooks/local-agent-cli-presence.test.ts
  • src/cli/handlers/agent-hooks.ts
  • src/main/agent-hooks/local-agent-cli-presence.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/agent-hooks/install-telemetry.ts
  • src/main/agent-hooks/managed-agent-hook-manifest.ts
  • src/main/agent-hooks/managed-agent-hook-manifest.test.ts
  • src/cli/handlers/agent-hooks.test.ts
  • src/main/agent-hooks/managed-agent-hook-controls.ts

Comment thread config/reliability-gates.jsonc Resolved
Brennan Benson added 2 commits July 9, 2026 17:39
…ller loop, honest Windows-remote presence

- Launch-prep no longer drops #7896 approval promotion when the presence
  gate skips the managed install (false-'missing' PATH probe or relative
  command override). Promotion now runs on every Codex launch; only the
  managed-config write stays presence-gated. Guarded by a new predicate test.
- Remove the now-dead duplicated installer loop + errorStatus from
  install-telemetry (production uses the CLI-safe copy in controls); keep the
  electron-coupled recorder there and test it directly. Add fail-open loop
  coverage to controls where the loop actually lives.
- Relay Windows presence reports 'unknown' (honest) instead of a false
  'missing'; drop the unused 'unsupported_remote_platform' skip reason.
Reconcile presence-gated Codex launch prep with main's #7969 WSL runtime-home
status-hook install:
- WSL runtime-home installs (installForRuntimeHome/refreshRuntimeUserHooksForRuntimeHome)
  run unconditionally and synchronously — never presence-gated, since the
  Windows-side PATH probe cannot see a codex CLI living inside the WSL distro
  (gating it would regress #7969).
- Non-WSL launches keep the presence gate plus the always-run #7896 approval
  promotion from this branch's review fixes.
- Keep both new tsconfig.cli entries and the added imports (getDefaultWslDistro,
  codexLaunchNeedsDirectApprovalPromotion).
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Superseded by #11442, which carries installed-CLI hook gating forward on current main across local, SSH, and WSL. Closing this older implementation to avoid parallel maintenance. The separate Pi/OMP bare-shell home fix remains in #10198.

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.

2 participants