Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughCodex hook support now includes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
490086a to
600e536
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/relay/agent-hook-server.ts (1)
317-334: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winPrevent duplicate Codex
SessionStartclears on the relay path. Insrc/relay/agent-hook-server.ts:317-334,normalizeHookPayload(..., 'codex', ...)deletes the cached status forSessionStart, so a second identical POST can re-enterforwardSessionStartClearafter the tombstone is written and broadcast a second clear. Skip this branch whenpreviousStatus.hookEventName === 'SessionStart'.
🧹 Nitpick comments (1)
src/main/agent-hooks/server.ts (1)
1310-1330: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the delete-side-effect inference used to detect a Codex SessionStart clear.
previousStatus && !this.state.lastStatusByPaneKey.has(paneKey)only works becausenormalizeHookPayload's Codex branch deletes the cache entry as a side effect of returningnullforSessionStart. Nothing here checkshookEventName/hook_event_namedirectly, so this reads as an accidental correlation rather than an intentional contract, and any future Codex event that also nulls-and-deletes for an unrelated reason would silently route through this same "clear" path (with its listener/telemetry side effects).A one-line comment stating this dependency (and ideally an explicit
hookEventName === 'SessionStart'check inclearStatusForSessionStartitself, mirroring the relay'singestRemoteexplicit check) would make the contract self-evident.Based on coding guidelines: "When code is driven by a design document or non-obvious constraint, add a brief one- or two-line comment explaining why it behaves that way."
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: be012b83-a822-4745-a4d4-09e9d1be5457
📥 Commits
Reviewing files that changed from the base of the PR and between 490086a5908097185ceb180915c6fe9ea60fb225 and 600e536106349bb7dc19b1fcf7dc08f8545cf7c1.
📒 Files selected for processing (16)
src/main/agent-hooks/server.test.tssrc/main/agent-hooks/server.tssrc/main/codex/codex-hook-identity.tssrc/main/codex/config-toml-trust.tssrc/main/codex/hook-service-wsl-runtime.test.tssrc/main/codex/hook-service.test.tssrc/main/codex/hook-service.tssrc/relay/agent-hook-server.test.tssrc/relay/agent-hook-server.tssrc/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.tssrc/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.tssrc/renderer/src/lib/agent-status.test.tssrc/shared/agent-detection.tssrc/shared/agent-hook-listener.test.tssrc/shared/agent-hook-listener.tssrc/shared/agent-title-status.ts
✅ Files skipped from review due to trivial changes (1)
- src/main/codex/hook-service-wsl-runtime.test.ts
🚧 Files skipped from review as they are similar to previous changes (10)
- src/shared/agent-detection.ts
- src/main/codex/codex-hook-identity.ts
- src/renderer/src/lib/agent-status.test.ts
- src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.ts
- src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.ts
- src/shared/agent-title-status.ts
- src/main/codex/hook-service.ts
- src/main/codex/hook-service.test.ts
- src/shared/agent-hook-listener.ts
- src/main/codex/config-toml-trust.ts
600e536 to
1512f04
Compare
|
Addressed the latest CodeRabbit outside-diff finding in The relay now recognizes a prior Post-rebase verification: 3 focused files / 345 tests, full Node/CLI/Web typecheck, targeted lint/format, max-lines, diff check, and independent PASS / APPROVED review. |
1512f04 to
7582f64
Compare
|
Rebased onto latest Conflict resolution kept both import surfaces:
Focused vitest: hook-service, hook-service-wsl-runtime, agent-hook-listener, agent-hooks/server, relay agent-hook-server — all green. |
7582f64 to
6c33818
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
150ea6b to
6711002
Compare
c9b518b to
1272bbe
Compare
|
Rebased onto latest Conflict resolution notes:
|
|
Rebased onto current |
|
Rebased onto current Conflict resolution:
Focused tests: agent-hook-listener + codex hooks/suppression/status 283/283 green (5 skipped). ahead=4 behind=0. |
1272bbe to
cf3af2a
Compare
46ba1c8 to
d8133f1
Compare
d8133f1 to
083f7bd
Compare
|
Rebased onto latest Head: |
f7074e9 to
b7f1e42
Compare
248694d to
19f9898
Compare
|
Rebased onto current |
SessionStart is an idle TUI/resume boundary. Clear the pane instead of publishing working/done, prepend remote hooks with index-addressed trust moves, and forward a working tombstone so old-main cannot treat this as completion. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the working tombstone semantics, but move apply/clear helpers and SessionStart tests out of the over-budget relay files and supply the required completion stateHistory field. Co-authored-by: Cursor <cursoragent@cursor.com>
Child SessionStart, foreign-connection SessionStart, and unrecognized hooks must not replace the root resume id. Cache writes wait until a root event is accepted, except the intentional SessionStart metadata write. Co-authored-by: Cursor <cursoragent@cursor.com>
The three root identity regressions stay intact. They live under main so tsconfig.web does not follow AgentHookServer into telemetry defines. Co-authored-by: Cursor <cursoragent@cursor.com>
A user hook with enabled=false and no trusted_hash must travel with its index shift. Leaving it behind disables the managed hook and inventing a hash would synthesize approval. Co-authored-by: Cursor <cursoragent@cursor.com>
Destination enabled/hash must come only from the source. Vacate both keys before writes so a missing source cannot reuse a stale dest approval, and a missing enabled cannot inherit dest disablement. Adapt the Codex retired-pane case: SessionStart stays idle metadata and the first real event supplies the visible working row. Co-authored-by: Cursor <cursoragent@cursor.com>
…pter and eliminate type assertions
19f9898 to
13ab19a
Compare
ELI5
Opening or resuming an idle Codex session should clear stale turn status without reporting new work or a completed turn. This update retains session identity, keeps child events from replacing the parent session, and preserves remote user-hook approvals when Orca's hook moves to the front.
What Changed
Why
This is the hooks/status replacement extracted from #7950, adapted to the current split implementation. It retains the existing local/app-server trust-rebase mechanism and adds the remaining remote prepend migration. Startup delivery, native chat/session bridging, account configuration and rate-limit work remain outside this PR.
Refs #7950
Visual Proof
N/A — no visual redesign. Status and notification behavior is covered by deterministic listener, relay and renderer-predicate tests; rendered Electron verification was not performed.
Testing
Final focused validation is tied to
248694dc06e3134151bdaf2a28c29305cecf6465, rebased onto main6108ce617c8696c3d52a97d29911aed630a22e78, using Node 26.8.1 and the current lock-matched dependencies on macOS.--composite false; all 33 changed files passed oxlint and oxfmt; diff whitespace check passed.0105225a7a34e74a7f67b84a9e1714fd2d4e20a8: 8,245 files passed / 12 failed / 61 skipped; 76,615 tests passed / 29 failed / 391 skipped, 686.46 seconds. All 28 baseline failures match the clean6108ce6baseline rerun. The sole additional failure expected a synthetic working row from Codex SessionStart; the final retirement test now requires no synthetic row and verifies the first real event revives the pane.The existing SessionStart assertions intentionally change from synthetic working status to no visible event, with the next real prompt retaining identity and cleared turn data. The retired-pane table now gives Codex a dedicated no-row/real-event revival assertion; every other provider remains covered. The public API parity assertion adds the new trust-move export; existing exports remain covered. Relay tests were moved to a dedicated file without removing their assertions.
Review
Cursor supplied an explicit adversarial/security PASS for this SHA. Independent review reproduced and verified fixes for child SessionStart, stale-connection identity, ignored-event identity poisoning disabled/no-hash trust migration, and stale destination approval/disablement inheritance. Tests cover adjacent shifts, reverse move ordering, destination collisions and repeated remote/redirected-home installs.
The optional standalone Grok review attempt failed with HTTP 402 and yielded no verdict; it is not counted as a PASS.
Compatibility and Security
New main consumes SessionStart as a clear. The relay's compatibility tombstone remains
workingplushookEventName: SessionStart, avoiding a syntheticdonethat completion observers would count as finished work. Older mains retain their previous working-row behavior; this PR does not claim they gain the new clear behavior.Only matching unchanged user-hook content has trust state relocated. Missing hashes stay missing; no user approval is synthesized. Managed hooks retain their separate existing grant path. SSH and redirected remote homes use the content mover; native local and WSL runtime installs retain their existing app-server path. No new RPC method or stream opcode is introduced.
Before publication, upstream advanced to
8f78c28248fbfa4d55fb837ab6698ac77d4e35c5. Its changed files do not overlap this PR, package/lock files are unchanged, and a local merge-tree check completed without conflicts. The reviewed branch retains its 6108ce6 base.AI Disclosure
Cursor implemented and reviewed the rebase; OpenAI Codex independently reviewed the diff and verification evidence and reproduced the regression cases.