Skip to content

Provision managed Codex accounts with enabled Orca hooks - #23292

Closed
iampaycheck wants to merge 1 commit into
stablyai:mainfrom
iampaycheck:fix-managed-codex-hook-provision
Closed

iampaycheck wants to merge 1 commit into
stablyai:mainfrom
iampaycheck:fix-managed-codex-hook-provision

Conversation

@iampaycheck

@iampaycheck iampaycheck commented Sep 27, 2026 •

Copy link
Copy Markdown

Fixes #23289.

Orca now installs its user-scope managed hook when a Codex managed account is created, before the account is persisted. It enables only the exact installed Orca command and positional trust keys after the existing hash grant, then rereads the trust state; native homes also pass the existing full hook-status check. Missing or incomplete trust fails account creation visibly. Project hooks retain their review state.

The helper is idempotent. Focused tests cover exact-command rejection, preserving a disabled project hook, native account creation, and account import (22 tests passing). Formatting and changed-file lint pass. A full node typecheck exceeded Node’s default 4 GB heap; an 8 GB rerun was stopped after 11 minutes without a diagnostic. This is a draft pending upstream review; no live host configuration was changed.

brennanb2025 added a commit that referenced this pull request Sep 29, 2026
Fixes the Orca part of #23289. A Codex worker could sit forever at
Codex's hooks screen: Orca's own hook entry had the right trusted_hash
but `enabled = false`, so the SessionStart event Orca waits for never
fired. Orca only ever granted the hash and never re-checked `enabled`
(the ledger fast path compared hashes only, the text fallback kept an
existing `enabled = false`, and the SSH installer passed no value), so a
stale `enabled = false` at the position Orca's entry occupies stuck.

Now every launch prep that installs Orca's hook re-derives it: the Codex
app-server grant writes `{ trusted_hash, enabled = true }` for Orca's
exact managed keys and verify fails if one is still disabled; the ledger
fast path misses when the entry is disabled; the local, WSL and SSH
fallbacks write `enabled = true` for Orca's entries. Project and user
hooks are never touched, so their review stays the user's decision.

Orca's own settings stay the only off switch: all of these writes run
only on the install path, which launch prep, session resume, startup and
the SSH/WSL installs take only when status hooks are on for Codex
(#23667's per-agent check). With Codex turned off, launch prep takes the
refresh-user-hooks path, which never writes Orca's hook state, so a
disabled entry stays off; turning Codex back on re-enables it on the next
launch. Supersedes #23292, which enabled the hook once at account creation
with nothing to re-derive it later.
@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#23289) has been resolved on main by #33638 (b29ae01912). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 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.

[Bug]: trusted-but-disabled Orca Codex hook leaves remote worker-start at agent_readiness

2 participants