Skip to content

fix(codex): install Codex's Interrupt hook so an Esc-cancelled turn settles - #24332

Merged
Jinwoo-H merged 6 commits into
mainfrom
jinwoo/codex-interrupt-hook
Oct 1, 2026
Merged

Jinwoo-H merged 6 commits into
mainfrom
jinwoo/codex-interrupt-hook

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​280 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​275
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​71 $\color{#cf222e}{\Huge{\mathbf{−}}}$​40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​31

ELI5

When you press Esc in Codex to cancel a turn (for example to decline a command it wants to run, or to stop a command that is already running), Orca kept showing the pane as "needs you" or "working". Codex tells hook listeners about the cancel through a hook called Interrupt, but Orca never subscribed to it. Now it does, and the pane settles as soon as you cancel.

What Changed

Before: Orca subscribes to 8 Codex hook events. After an Esc, the last one Orca saw was PermissionRequest (pane shows waiting) or PreToolUse (pane shows working), and it stayed that way until the next prompt. The only fallback was Orca guessing a cancel from the Esc keystroke, and that guess deliberately backs off in several cases.

After: Orca also installs Codex's Interrupt hook (Codex 0.150+). When it fires, the pane goes to done and the turn is marked as cancelled.

Mechanism:

  • CODEX_EVENTS and the Codex event-label maps gain Interrupt / interrupt. Every install path that walks that list (local managed home, real ~/.codex, WSL, SSH remote) now writes it, using the same fast posting script as every other event.
  • Codex caps Interrupt hooks at 3 seconds, so Orca writes timeout: 3 for it. One builder (buildCodexManagedHook) owns the per-event timeout, and each installer's trust entry is taken from the hook it actually writes. Writing Orca's usual 10 would make Codex print a clamp warning at every startup.
  • Orca computes Codex's trust hash itself in some paths. Codex hashes the timeout after clamping it (Interrupt: clamp to 1..3, default 1), so the hash function now does the same. The result is pinned against the hash a real Codex 0.159.3 reported for this exact hook.
  • In the hook listener, Interrupt goes through the same lead-turn update as Stop, with a cancelled outcome: the same cancelled-turn record the keystroke guess writes. Subagents stay in the roster and fold in as before, so a pane with a subagent still running reads "working" with the main agent marked cancelled. Codex never sends Interrupt for subagent sessions (its input has no agent_id), so no subagent guard is needed. The relay path (SSH) handles a forwarded Interrupt row the same way.

Why

The hook is Codex's own statement that the turn was cancelled, so it is more reliable than guessing from keystrokes, and it covers cases the guess skips. Reusing the existing cancelled-turn outcome (rather than a new state) means the store's existing hold against late same-turn events also applies here. That matters: in the live check, Codex sent a PostToolUse for the cancelled sleep 40 24 seconds after the Interrupt. The store holds it, so the pane does not flip back to working (covered by a test).

Alternative considered: keep the 10s timeout and only fix the hash. Rejected because Codex would show a clamp warning on every launch.

Compatibility:

  • Older Codex (< 0.150): hooks.json events are parsed into HookEventsToml, which has never had deny_unknown_fields (checked at rust-v0.114.0, 0.120.0, 0.125.0, 0.130.0, 0.140.0 and 0.149.0). The unknown Interrupt key is ignored, the same way Codex versions before PermissionRequest/SubagentStart already ignore those keys. The extra [hooks.state."…:interrupt:0:0"] entry is a map key that old Codex never looks up.
  • Trust prompts: Codex trust is per hook key (<file>:<event>:<group>:<handler>). Adding an event adds one new key and leaves every existing key and hash unchanged, so existing hooks are not re-prompted. Orca writes the new key's trust in the same install pass that writes the hook.
  • Mixed versions over SSH: an older relay drops Interrupt (no status change, same as today). An older desktop receiving a newer relay's Interrupt row recomputes from its own record and shows what it shows today. Nothing regresses.

Known limitation

On WSL, if the hook's normal status post fails, the shared hook script falls back to Windows curl.exe, which can take up to about 5 s. Codex caps Interrupt hooks at 3 s, so on that rare path Codex may kill the hook before it delivers, and that one cancel is lost. The pane then behaves as it does today, without this PR. A fix would need per-event time budgets in the shared hook script; it is deliberately out of scope here.

Linked Issue

Refs STA-9100 (one part of it)

Visual Proof

N/A: this changes the agent status Orca records, not any UI. The sidebar's existing done/cancelled rendering is unchanged. Live evidence is under Testing.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Live check (macOS, codex-cli 0.159.3, isolated CODEX_HOME): I generated hooks.json and the trust entries with Orca's own installer functions, pointed Orca's managed hook script at a local listener, and drove Codex in a PTY with capture-agent-pty-transcript.mjs.

  • hooks/list from Codex's app-server reported all 9 managed hooks as trusted, with Interrupt at timeoutSec: 3.
  • Esc on an approval prompt: UserPromptSubmit → PreToolUse → PermissionRequest → Interrupt.
  • Esc while sleep 40 ran: UserPromptSubmit → PreToolUse → Interrupt, then a late PostToolUse when the shell finished.
  • Interrupt payload: {"session_id":"…","turn_id":"…","transcript_path":"…","cwd":"…","hook_event_name":"Interrupt","model":"…","permission_mode":"default"}. No agent_id, and Codex skips Interrupt for subagent sessions.
  • Replaying the captured events through Orca's listener: PermissionRequest → waiting, then Interrupt → done, interrupted, mainAgent.outcome = cancellation.

Automated:

  • codex-interrupt-hook-trust.test.ts: event list and labels, the 3s timeout, the real-Codex hash pin, clamp-equivalent hashing, matcher ignored.
  • agent-hook-listener-codex-interrupt.test.ts: blocked → done, working → done, child work kept in the fold, next turn clears the verdict, relayed row.
  • server-codex-interrupt-hook.test.ts: the live event order through the real hook HTTP server, including the late PostToolUse 24s after.
  • Updated the pinned event lists and timeouts in the existing install tests.
  • Mutation check: removing the Interrupt outcome mapping, the relay-state update, the hook builder's timeout, the event-list entry, or the hash clamp each fails a test.
  • Gates: pnpm tc, oxlint on the changed files, and check:code-quality:changed all pass. src/main/codex, src/main/agent-hooks, src/shared, src/relay and src/main/startup all pass. One src/shared shell test fails on my machine because of a local fish config, unrelated to this change.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Windows: the .cmd hook script is unchanged. Only the event list and the timeout differ.
  • WSL: the hook script's fast path posts within 1.5s, inside the 3s cap. Its WSL-only fallback to Windows curl.exe can take up to 5s more, so on that rare path Codex may kill the Interrupt hook before it posts. That costs only this one status update.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…ettles

Codex 0.150+ fires an Interrupt hook when the user presses Esc on an
approval prompt or mid-tool, and nothing else. Orca did not install it, so
the pane stayed blocked/working until the next prompt.

- Add Interrupt to the managed Codex events and label maps, written with
  Codex's 3s cap (a larger value triggers a startup clamp warning).
- Hash the timeout Codex hashes (Interrupt is clamped to [1,3], default 1)
  so self-computed trust matches Codex; pinned against a real 0.159.3 hash.
- Map a root Interrupt to the existing cancelled-turn record
  (markCodexLeadTurnInterrupted), keeping child work in the fold; a
  child-scoped Interrupt is ignored. Relayed rows take the same path.
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds Interrupt event handling to Codex hook system.

No new finding is eligible for a separate comment, though the previously resolved stale-Interrupt finding warrants renewed attention before merging.

Findings

  1. P2 WSL Fallback Exceeds Interrupt Timeout ▶

Summary

The PR installs Codex’s Interrupt hook across managed, real-home, WSL, and remote paths, uses its three-second timeout in hook and trust configuration, and maps the event to a cancelled turn.

  • Adds listener, server, trust-hash, and installer coverage.
  • The latest changes remove turn-ID handling and its associated tests.

Reviews (5) · Last reviewed commit: "revert(codex): drop the Interrupt turn-i..."

Comment thread src/main/codex/codex-hook-definition.ts Outdated
Comment on lines 62 to 68
export function getCodexManagedHookTimeoutSeconds(
eventName: (typeof CODEX_EVENTS)[number]
): number {
return eventName === 'Interrupt'
? CODEX_INTERRUPT_HOOK_MAX_TIMEOUT_SECONDS
: MANAGED_HOOK_TIMEOUT_SECONDS
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 WSL Fallback Exceeds Interrupt Timeout

If the first WSL post fails and the curl.exe fallback takes more than the remaining time, Codex can kill the hook at its new three-second deadline. The fallback allows up to five seconds, and spooling happens only after it returns. That can lose the cancellation update and leave the pane showing its previous status.

Knowledge Base Used: Agent integrations and hooks

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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
📝 Walkthrough

Walkthrough

The change adds Codex Interrupt to managed hook events and trust identity mappings. Codex hook builders and local, remote, WSL, and planned installers apply event-specific timeouts. The listener maps Interrupt to a done state with a cancellation outcome. New tests cover trust hashes, installer timeouts, listener state changes, and production hook-server status snapshots.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to a5153

On affected WSL setups, cancelling a Codex turn may leave Orca showing it as active until another event arrives.

Security Architecture Review

Security architecture risk: 🔵 Low · up to a5153

Existing access controls are preserved. The remaining risks concern cancellation notifications being attributed to a later turn or lost during slow delivery, rather than a demonstrated permission bypass.

Retained concerns

  • Low · architecture · inferred: The newly accepted Interrupt event assigns cancellation to the current pane lead without comparing the provider turn ID. If an earlier turn's Interrupt is delivered after a newer prompt on the same pane, it can mark the newer lead done with cancellation. This compromises turn-state ownership and downstream status interpretation; runtime occurrence and any privileged downstream effect remain unverified.
Security review details

Security Blast Radius

  • inferred — The demonstrated cancellation transition changes the selected pane's lead record and propagated verdict. Inspected consumers interpret cancellation as status and attention information; verdict helpers also feed clean-finish policy classification. A complete trace of those policy consumers was not established, so privileged effects beyond the inspected paths remain unverified.

Trust Boundaries and Controls

  • observed — The HTTP handler rejects an incorrect hook token before reading the request body. Existing status-disposition controls suppress closed panes and enforce a launch-token match when a restart fence exists. These controls do not establish turn identity within one continuing process.

Resilience and Maintainability Implications

  • inferred — The new three-second Interrupt deadline can expire during the existing synchronous WSL fallback, which allows a five-second request after the initial transport attempt. Because durable spooling follows that fallback, interruption before delivery can also prevent recovery recording. This establishes a conditional settlement failure, not a command-cancellation or authorization failure; actual timeout behavior was not executed.

Hardening Proposals

  • proposed — Associate terminal Interrupt events with the active provider turn and reject stale turn identities during local normalization, replay and remote reconciliation, while retaining existing pane and launch fencing.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed and covers the user impact, mechanism, rationale, testing, compatibility, known limitation, and checklist. However, the required Linked Issue section contains only `Refs ST… Add a direct link to the issue addressed by this PR. Update the final quality-gate checklist to show the status of pnpm lint, pnpm typecheck, pnpm test, and pnpm build, or state clearly that CI will cover any gate not run locally.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the primary change: installing Codex's Interrupt hook so Esc-cancelled turns settle.
Full details: Description check

Explanation

The description is detailed and covers the user impact, mechanism, rationale, testing, compatibility, known limitation, and checklist. However, the required Linked Issue section contains only Refs STA-9100, not an actual issue link, and the required lint, typecheck, test, and build checklist item remains unchecked.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes — initial review of 0cedca9 (single commit, 17 files).

  • Install the Interrupt hook — CODEX_EVENTS gains Interrupt, written with a 3s timeout (Codex clamps Interrupt/SessionEnd to [1,3], default 1) across the local, real-home, WSL, and SSH install paths, with trust granted for the new key.
  • Trust hash normalization — normalizeCodexHookTimeoutSec reproduces Codex's normalize_command_hook clamp so the Interrupt entry hashes correctly; matcher is dropped for interrupt, matching Codex's HOOK_EVENT_NAMES_WITH_MATCHERS.
  • Listener / relay — a root Interrupt reuses markCodexLeadTurnInterrupted (roster kept, child-scoped Interrupts ignored) and settles the pane to done/cancelled; relayed Interrupt rows reconcile the same way.

I verified the load-bearing external contract directly against openai/codex source (codex-rs/hooks/src/lib.rs, engine/discovery.rs, config/src/hook_config.rs): Interrupt is a real event, its key label is interrupt, it is excluded from matcher events, and normalize_command_hook clamps it to [1,3] (default 1) while other hooks default to 600 — all matching this implementation. Old Codex versions ignore the unknown Interrupt key because deny_unknown_fields is on HooksFile, not on HookEventsToml.

Tests: the new/updated Codex suites pass; src/main/codex is 2498 passed with only the two pre-existing env-dependent app-server integration files failing (same as main); the codex cancel-verdict/resurrection server tests pass; tsc -p config/tsconfig.node.json is clean.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

The managed hook's timeout is now Codex's own normalization of the shared
budget, and every installer derives its trust entry from the hook it wrote,
so no installer repeats the Interrupt special case.

Claude-Session: codex-interrupt-hook review
… outcome

Interrupt now writes the lead record through the same setCodexMainAgentTurnState
call as Stop, so markCodexLeadTurnInterrupted keeps its original signature.
Drops the child-scoped Interrupt guard: Codex never runs Interrupt hooks for
subagents and its input schema has no agent_id.

Claude-Session: codex-interrupt-hook review

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes — re-review of the two commits since the prior pullfrog review at 0cedca9 (f90c4b9, 9c8ded8). Both are refactors of the Interrupt plumbing added by 0cedca9; behavior is preserved.

  • Per-event timeout now lives in a builder — buildCodexManagedHook owns the Interrupt 3s clamp by routing through normalizeCodexHookTimeoutSec, and every install path (local, real-home, WSL, SSH) writes hook.timeout and takes its trust entry's timeoutSec from that same hook. getCodexManagedHookTimeoutSeconds and CODEX_INTERRUPT_HOOK_MAX_TIMEOUT_SECONDS are gone.
  • Interrupt routed through the shared lead update — codexOutcomeRestatedByStop became codexLeadOutcomeForEvent, returning cancellation for Interrupt and otherwise preserving a prior done verdict. The listener and the relay path now use it instead of a dedicated helper, and markCodexLeadTurnInterrupted reverts to the void helper used only by server-inferred interrupts.
  • Dead child-scoped Interrupt guard removed — the listener no longer drops Interrupt payloads carrying an agent_id. Codex's Interrupt schema has no agent_id and hook_runtime.rs skips subagent sessions; a synthesized agent_id payload would route down the existing child branch, which does not update the lead record. Behavior is unchanged for real traffic.
  • Tests realigned — dropped assertions tied to the deleted helper and the unreachable child-Interrupt case, and added per-event timeout coverage in managed-hook-timeout.test.ts.

Verified locally against 9c8ded8: the reviewed-commit suites pass (22 tests), the related listener/install/trust suites pass (54 tests), pnpm tc:node is clean, and oxlint over the touched directories reports no findings.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…rn has started

A replayed or late Interrupt carries the old turn's turn_id; matching it against the turn_id from the
running turn's UserPromptSubmit keeps it from cancelling the new turn. Missing ids still cancel.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes — re-review of the one code commit since the prior pullfrog review at 9c8ded8 (1a030f8; 9badc3c was a clean merge of origin/main and changed no PR code). The commit closes the stale-turn risk flagged at 9c8ded8.

  • Interrupt now carries a turn identity — CodexLeadTurnState gains an optional turnId, recorded from UserPromptSubmit's turn_id and preserved across every other lead write by setCodexMainAgentTurnState.
  • Stale Interrupts are dropped — isStaleCodexInterrupt makes normalizeCodexEvent return early when a root Interrupt names a turn_id different from the running turn's, so a queued Interrupt replayed after the next turn started no longer cancels that new turn. Missing ids on either side keep the previous accept-and-cancel behavior.
  • Tests — three cases added: an old-turn Interrupt ignored (new turn then reaches working / a clean Stop), plus cancellation on a matching-id and an id-less Interrupt. The toBeNull() assertion fails without the guard.

I confirmed the turnId field stays internal to the in-memory lead record and that relayed Codex rows keep applying the check on the execution host before forwarding, so the desktop's reconcile path not tracking turnId is not a gap. The reviewed listener suite passes (agent-hook-listener-codex-interrupt, 8 tests).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

…ordered

Hook events reach Orca in order: Codex waits for the Interrupt hook before the next turn, and the restart spool is one append-only file per pane, replayed in order before live events. The guard protected an unreachable case and could drop a real cancel if the ids ever differed.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes — re-review of the one commit since the prior pullfrog review at 1a030f8 (a5153ef), which reverts the turn-id guard that commit had added.

  • Reverted the stale-Interrupt turn-id guard — CodexLeadTurnState.turnId, isStaleCodexInterrupt, and the early return null in normalizeCodexEvent are gone, restoring plain accept-and-cancel for a root Interrupt.
  • Removed the now-unused plumbing — the turnId persistence in setCodexMainAgentTurnState and the readString import in codex-state.ts.
  • Removed the three guard tests — the stale-id, matching-id, and id-less cases in agent-hook-listener-codex-interrupt.test.ts.

I checked the revert's stated rationale against openai/codex@main source: the session submission loop is serial and awaits interrupt_task → handle_task_abort → run_turn_interrupt_hooks, and Orca's managed hooks are written without async, so Codex reaps each command hook (child.wait_with_output()) before the next turn's UserPromptSubmit can be dispatched. The out-of-order case the guard targeted is unreachable in normal operation, and the guard could have dropped a genuine cancel had the ids ever differed. The only ordering-relevant hole is the 1–3s timeout branch, which kills a slow hook (a drop, not a reorder) — that is the WSL fallback already documented as out of scope.

Verification on a5153ef: agent-hook-listener-codex-interrupt (5), managed-hook-timeout (5), and codex-interrupt-hook-trust (4) all pass; pnpm tc:node is clean; no dangling references to the removed symbol or field remain.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Bound the WSL curl.exe fallback to the Interrupt deadline. · codex-hook-wsl-runtime.ts:84-93

src/main/codex/codex-hook-wsl-runtime.ts:84-93
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Bound the WSL curl.exe fallback to the Interrupt deadline.

When the Linux curl attempt fails and curl.exe is available, the generated WSL hook retries synchronously with --connect-timeout 3 and --max-time 5. The Interrupt hook timeout is only three seconds. A slow curl.exe startup or connection can therefore be terminated before the POST reaches Orca. spool_hook_event runs only after the retry returns, so this path can leave the cancelled turn unmarked.

Use an outer deadline for the complete WSL fallback, including process startup, and keep the existing spool fallback when the deadline expires.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 4a541f43-870d-4fb2-a108-87138c644780

📥 Commits

Reviewing files that changed from the base of the PR and between 1a030f8 and a5153ef.

📒 Files selected for processing (3)
  • src/shared/agent-hook-listener-codex-interrupt.test.ts
  • src/shared/agent-hook-listener/providers/codex-events.ts
  • src/shared/agent-hook-listener/providers/codex-state.ts
💤 Files with no reviewable changes (2)
  • src/shared/agent-hook-listener/providers/codex-events.ts
  • src/shared/agent-hook-listener-codex-interrupt.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@Jinwoo-H
Jinwoo-H merged commit 477e699 into main Oct 1, 2026
49 of 50 checks passed
brennanb2025 added a commit that referenced this pull request Oct 1, 2026
…oks-write-once

Conflicts with #24332 (Codex's Interrupt hook):
- codex-hook-local-install.ts, codex-real-home-hook-entry-plan.ts and
  codex-real-home-frozen-entry.test.ts stay deleted: this branch removed the
  managed-home and real-home installers they belong to.
- hook-service-managed-install.test.ts and hook-service-trust-grant.test.ts
  keep this branch's side: main's side extends tests of those deleted installers.

#24332's intent carried into the session flag:
- The flag defines Interrupt too, and every event's timeout comes from
  buildCodexManagedHook, so Codex's per-event normalization (Interrupt capped
  at 3 s) is what the flag carries and codexHookSessionFlagDefines checks.
- Interrupt is optional: derivation requires the original 8 events, adds
  Interrupt's approval when Codex lists it, and the pre-publish check requires
  it trusted and enabled only then. An older Codex drops the definition
  silently. Real-binary runs: 0.133.0 lists 8 and verifies, with Interrupt
  defined and no warning; 0.150.1 and 0.159.2 list and trust all 9.
- The contract accepts either shape and checks Interrupt is trusted wherever
  Codex lists it, and that a real turn prints no hook warning.
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