Skip to content

fix(codex): improve CLI compatibility across hooks, sessions, and launch - #7950

Closed
bbingz wants to merge 8 commits into
stablyai:mainfrom
bbingz:fix/codex-cli-compat
Closed

bbingz wants to merge 8 commits into
stablyai:mainfrom
bbingz:fix/codex-cli-compat

Conversation

@bbingz

@bbingz bbingz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Full Codex CLI × Orca compatibility pass based on a source-level comparison against openai/codex (local analysis under .tmp-codex-compat/, not committed). Covers hooks/status, startup delivery, managed auth, session rollouts/native chat, TUI catalogs, and usage/config.

Status & hooks

  • SessionStart no longer maps to working (avoids idle “running” flash); UserPromptSubmit remains the working boundary
  • Install + map SubagentStart / SubagentStop (stay working; only root Stopdone)
  • Remote managed hooks prepend like local (groupIndex: 0)
  • Promote Codex PostToolUse tool_response into assistant preview; richer Bash / apply_patch / spawn_agent previews
  • Interrupt markers clear sticky working without inventing a non-existent Codex StopFailure

Startup & drafts

  • Draft paste readiness requires composer placeholder “Ask Codex” after DECSET 2004 (bare during hooks-review no longer unlocks paste)
  • Failed paste releases the delivery consume guard so retries can run
  • Remove dead Codex --prefill myth; shell-ready only for explicit positional PROMPT delivery
  • Windows argv length budget → empty launch + paste-submit fallback
  • Optional Codex -i/--image on buildAgentStartupPlan
  • Unify post-paste submit delay to 500ms

Auth, sessions, native chat

  • Force cli_auth_credentials_store = "file" on managed + runtime CODEX_HOME (multi-account vault requires file-backed auth.json)
  • Decode Paginated item_completed TurnItems (AI Vault + native chat)
  • Discover/read cold *.jsonl.zst via Node zstd
  • Session bridge: hardlink failure → copy (Codex ignores symlinks for resume listing)

UX / usage / config

  • Map native Codex [ ! ] Action Required | project titles → permission without a "codex" title token
  • Refresh slash catalog (btw, apps, quit, debug-config, setup-default-sandbox, …)
  • Skill suggestion path plumbing + scope-preferring dedupe (PTY still inserts $name)
  • Soft YOLO flag matching (extra argv tokens stay yolo)
  • Multi-bucket rateLimitsByLimitId; prefer chatgpt_base_url for reset-credits HTTP
  • Extended path-rewrite keys; profile-v2 *.config.toml overlay mirror
  • WSL host-vs-distro Codex home strip messaging

Other

  • Fix switch exhaustiveness on source-control-manual-review-url (null provider)
  • Isolate Codex PTY rate-limit tests from real fetch under fake timers

Screenshots

No visual redesign. Behavior changes are Codex terminal status/hooks, startup paste readiness, account auth-store, session resume bridge, and status-bar usage multi-bucket display. Manual checklist is under Testing.

Testing

  • pnpm run typecheck (previously run on this branch)
  • pnpm lint (rely on CI once approved)
  • pnpm test full suite (not run in this session — optional CI)
  • pnpm build (not run)
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed
    • Focused vitest: codex hooks, accounts, config mirror, session bridge/parser, native-chat transcript/resolver, startup/draft scanners, slash/permissions/detection, rate-limit fetcher (+ PTY settle/auth)
    • Manual remaining:
      • Open Codex terminal, confirm no idle “running” flash; approve PermissionRequest; nested agent stays working until root stop
      • First-run with hooks review — linked draft should not silently drop
      • Account switch after managed home forces file auth store
      • Resume session bridged from system home when volumes differ (copy path)

AI Review Report

CodeRabbit review threads on this PR: 0 unresolved at last check. Agent maintenance pass:

  • Rebased/merged through multiple origin/main waves (latest 85fb6e762) resolving conflicts in codex-config-mirror.ts, codex-auth-presence.ts, and codex-fetcher.ts while keeping PR auth-store/TOML/URL work + main multi-home changes.
  • Prior review focus areas: hooks status mapping, Windows argv/paste fallback, file-backed auth.json, zstd session discovery, session bridge hardlink→copy, WSL CODEX_HOME strip messaging.

Cross-platform checks:

  • macOS / Linux / Windows: startup plan, paste readiness, slash catalog, rate-limit multi-bucket.
  • Windows: argv length budget → paste-submit fallback; ConPTY/shell launch paths unchanged except Codex-specific delivery.
  • WSL: host-vs-distro Codex home strip messaging; managed hooks prepend parity with local.
  • Paths: session bridge uses hardlink then copy; no symlink-only resume path.
  • Electron / remote: remote managed hooks groupIndex 0; rate-limit tests isolated from real fetch under fake timers.

Security Audit

  • Auth / secrets: forces cli_auth_credentials_store = "file" for managed/runtime CODEX_HOME so multi-account vault has file-backed auth.json (no new secret channel).
  • Command execution: Windows long-argv falls back to empty launch + paste-submit rather than truncated argv injection.
  • Path handling: session bridge prefers hardlink, falls back to copy; WSL strips host-local Codex homes that would not resolve in Linux.
  • IPC: no new unrestricted IPC; changes stay in existing Codex hook/status/rate-limit surfaces.
  • Dependencies: uses Node zstd for cold *.jsonl.zst discovery/read (existing stack patterns).
  • Follow-up: fork PR CI remains action_required until a maintainer approves workflow runs.

Notes

  • Fork PRs show mergeStateStatus: UNSTABLE when community CI is waiting on approval — not a merge conflict.
  • Local analysis artifacts under .tmp-codex-compat/ are not committed.
  • Latest maintenance head: 85fb6e762 (merged main: CDP attach, HTML preview-to-side, Antigravity sandbox flag).

@bbingz
bbingz force-pushed the fix/codex-cli-compat branch from f3910d8 to 4af7356 Compare July 9, 2026 16:17
@bbingz

bbingz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto origin/main and resolved conflicts in config/tsconfig.cli.json (kept both new includes), src/main/codex/hook-service.ts + codex-hook-identity.ts (SubagentStart/Stop via shared label map), and source-control-manual-review-url.ts (main exhaustiveness). Tip: 4af73562f.

@coderabbitai

coderabbitai Bot commented Jul 9, 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
📝 Walkthrough

Walkthrough

This PR adds Codex cold-compressed rollout support across discovery, parsing, bridging, and native-chat transcript reading. It updates managed configuration mirroring, credentials storage, profile overlays, path rewriting, hooks, and WSL home handling. Startup behavior now uses explicit shell-ready delivery, dual composer readiness markers, image-aware launch planning, and retryable delivery attempts. Codex status detection, rate-limit mapping, slash commands, and native chat skill suggestion handling are also expanded.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% 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
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 matches the PR's main scope: Codex CLI compatibility improvements across hooks, sessions, and launch.
Description check ✅ Passed The description includes all required sections and covers summary, testing, review, security, and notes with cross-platform coverage.

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: 3

🧹 Nitpick comments (3)
src/main/codex/codex-session-bridge.ts (1)

226-231: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: avoid redundant marker write in copy fallback path.

tryCopySystemCodexSessionFile writes a marker for replacementPath, then after renameSync the marker is rewritten for targetPath. Since rename preserves file stats on the same filesystem, the first marker write is redundant. Consider splitting the copy and marker write so the marker is only written once against the final path.

♻️ Suggested refactor
 function tryCopySystemCodexSessionFile(
   sourcePath: string,
   targetPath: string,
   relativePath: string
 ): boolean {
   try {
     copyFileSync(sourcePath, targetPath)
-    writeLegacyCopiedSessionMarker(relativePath, sourcePath, targetPath)
     return true
   } catch (error) {
     console.warn('[codex-session-bridge] Failed to copy system Codex session:', sourcePath, error)
     return false
   }
 }

Then update linkSystemCodexSessionFile to write the marker after a successful copy:

 function linkSystemCodexSessionFile(
   sourcePath: string,
   targetPath: string,
   relativePath: string
 ): boolean {
   if (tryHardlinkSystemCodexSessionFile(sourcePath, targetPath)) {
     clearLegacyCopiedSessionMarker(relativePath)
     return true
   }
-  return tryCopySystemCodexSessionFile(sourcePath, targetPath, relativePath)
+  if (tryCopySystemCodexSessionFile(sourcePath, targetPath, relativePath)) {
+    writeLegacyCopiedSessionMarker(relativePath, sourcePath, targetPath)
+    return true
+  }
+  return false
 }

And in replaceSymlinkSessionBridgeWithHardlink, the second writeLegacyCopiedSessionMarker call at line 230 would no longer be needed since the marker is written after the rename against the final path.

src/shared/tui-agent-draft-launch.ts (2)

16-23: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

startupCommandDelivery is declared but never set in buildAgentDraftLaunchPlan.

The AgentDraftLaunchPlan type includes startupCommandDelivery?: StartupCommandDelivery, but buildAgentDraftLaunchPlan never assigns it in either the draftPromptFlag or draftPromptEnvVar branch. If no caller augments the plan with this field, consider removing it to avoid confusion about whether draft launches can opt into shell-ready delivery.


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

Import the shared launch helpers instead of keeping duplicates

src/shared/tui-agent-startup.ts still defines resolveBaseCommand and buildSleepingAgentLaunchConfig locally, so the extraction is incomplete and the two copies can drift. Move them to src/shared/tui-agent-draft-launch.ts and import them here.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 99c19ed2-dd94-46ad-85c9-f5bc32195dda

📥 Commits

Reviewing files that changed from the base of the PR and between 8adfef4 and f3910d8fac1d7d3451faa16c01c933a56fe0a245.

📒 Files selected for processing (78)
  • config/tsconfig.cli.json
  • src/main/ai-vault/session-scanner-codex-item-completed.ts
  • src/main/ai-vault/session-scanner-codex-parser.test.ts
  • src/main/ai-vault/session-scanner-codex-parser.ts
  • src/main/ai-vault/session-scanner-codex-paths.ts
  • src/main/ai-vault/session-scanner-codex-record-consume.ts
  • src/main/ai-vault/session-scanner-codex-rollout-read.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/codex-accounts/service.ts
  • src/main/codex/codex-config-hooks-feature-normalize.ts
  • src/main/codex/codex-config-mirror.test.ts
  • src/main/codex/codex-config-mirror.ts
  • src/main/codex/codex-config-path-reference-rewrite.ts
  • src/main/codex/codex-profile-v2-config-overlay-mirror.ts
  • src/main/codex/codex-session-bridge.test.ts
  • src/main/codex/codex-session-bridge.ts
  • src/main/codex/codex-session-copy-markers.ts
  • src/main/codex/codex-session-file-listing.ts
  • src/main/codex/config-toml-trust.ts
  • src/main/codex/hook-service.test.ts
  • src/main/codex/hook-service.ts
  • src/main/codex/wsl-codex-session-bridge.test.ts
  • src/main/codex/wsl-codex-session-bridge.ts
  • src/main/daemon/pty-subprocess.test.ts
  • src/main/ipc/pty.test.ts
  • src/main/native-chat/session-file-resolver.test.ts
  • src/main/native-chat/session-file-resolver.ts
  • src/main/native-chat/transcript-codex-turn-items.ts
  • src/main/native-chat/transcript-line-decoders.ts
  • src/main/native-chat/transcript-reader.test.ts
  • src/main/native-chat/transcript-reader.ts
  • src/main/pty/codex-home-wsl-env.test.ts
  • src/main/pty/codex-home-wsl-env.ts
  • src/main/rate-limits/codex-auth-presence.ts
  • src/main/rate-limits/codex-fetcher-auth-errors.test.ts
  • src/main/rate-limits/codex-fetcher-pty-settle.test.ts
  • src/main/rate-limits/codex-fetcher.test.ts
  • src/main/rate-limits/codex-fetcher.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/relay/pty-handler.test.ts
  • src/renderer/src/components/native-chat/NativeChatComposer.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-state.test.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.ts
  • src/renderer/src/components/native-chat/use-native-chat-composer-keydown.ts
  • src/renderer/src/components/right-sidebar/source-control-manual-review-url.ts
  • src/renderer/src/components/settings/codex-session-source-home-control.tsx
  • 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/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/renderer/src/lib/agent-startup-delayed-delivery.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/lib/launch-agent-background-session.test.ts
  • src/renderer/src/lib/new-workspace.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/shared/agent-detection.test.ts
  • src/shared/agent-detection.ts
  • src/shared/agent-hook-listener.test.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/codex-startup-delivery.test.ts
  • src/shared/codex-startup-delivery.ts
  • src/shared/draft-paste-ready-scanner.test.ts
  • src/shared/draft-paste-ready-scanner.ts
  • src/shared/native-chat-slash-commands.test.ts
  • src/shared/native-chat-slash-commands.ts
  • src/shared/rate-limit-types.ts
  • src/shared/terminal-title-status.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-draft-launch.ts
  • src/shared/tui-agent-permissions.test.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-startup-codex-launch.ts
  • src/shared/tui-agent-startup.test.ts
  • src/shared/tui-agent-startup.ts

Comment thread src/main/codex/wsl-codex-session-bridge.ts
Comment thread src/shared/tui-agent-permissions.ts
Comment thread src/shared/tui-agent-startup-codex-launch.ts
@bbingz

bbingz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto latest origin/main to resolve merge conflict in config/tsconfig.cli.json (kept both codex-profile-v2-config-overlay-mirror and main's config-settings-promotion). Force-pushed: 352af1335b041b89e9ac2d561ae782bbf8e3b250.

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 77cd4e74-888f-400d-ab29-db81ffee8860

📥 Commits

Reviewing files that changed from the base of the PR and between 7328465389a8cd1fdaa2ed7a97ce3e2c0d76a7c8 and 352af1335b041b89e9ac2d561ae782bbf8e3b250.

📒 Files selected for processing (78)
  • config/tsconfig.cli.json
  • src/main/ai-vault/session-scanner-codex-item-completed.ts
  • src/main/ai-vault/session-scanner-codex-parser.test.ts
  • src/main/ai-vault/session-scanner-codex-parser.ts
  • src/main/ai-vault/session-scanner-codex-paths.ts
  • src/main/ai-vault/session-scanner-codex-record-consume.ts
  • src/main/ai-vault/session-scanner-codex-rollout-read.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/codex-accounts/service.ts
  • src/main/codex/codex-config-hooks-feature-normalize.ts
  • src/main/codex/codex-config-mirror.test.ts
  • src/main/codex/codex-config-mirror.ts
  • src/main/codex/codex-config-path-reference-rewrite.ts
  • src/main/codex/codex-hook-identity.ts
  • src/main/codex/codex-profile-v2-config-overlay-mirror.ts
  • src/main/codex/codex-session-bridge.test.ts
  • src/main/codex/codex-session-bridge.ts
  • src/main/codex/codex-session-copy-markers.ts
  • src/main/codex/codex-session-file-listing.ts
  • src/main/codex/config-toml-trust.ts
  • src/main/codex/hook-service.test.ts
  • src/main/codex/hook-service.ts
  • src/main/codex/wsl-codex-session-bridge.test.ts
  • src/main/codex/wsl-codex-session-bridge.ts
  • src/main/daemon/pty-subprocess.test.ts
  • src/main/ipc/pty.test.ts
  • src/main/native-chat/session-file-resolver.test.ts
  • src/main/native-chat/session-file-resolver.ts
  • src/main/native-chat/transcript-codex-turn-items.ts
  • src/main/native-chat/transcript-line-decoders.ts
  • src/main/native-chat/transcript-reader.test.ts
  • src/main/native-chat/transcript-reader.ts
  • src/main/pty/codex-home-wsl-env.test.ts
  • src/main/pty/codex-home-wsl-env.ts
  • src/main/rate-limits/codex-auth-presence.ts
  • src/main/rate-limits/codex-fetcher-auth-errors.test.ts
  • src/main/rate-limits/codex-fetcher-pty-settle.test.ts
  • src/main/rate-limits/codex-fetcher.test.ts
  • src/main/rate-limits/codex-fetcher.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/relay/pty-handler.test.ts
  • src/renderer/src/components/native-chat/NativeChatComposer.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-state.test.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.ts
  • src/renderer/src/components/native-chat/use-native-chat-composer-keydown.ts
  • src/renderer/src/components/settings/codex-session-source-home-control.tsx
  • 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/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/renderer/src/lib/agent-startup-delayed-delivery.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/lib/launch-agent-background-session.test.ts
  • src/renderer/src/lib/new-workspace.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/shared/agent-detection.test.ts
  • src/shared/agent-detection.ts
  • src/shared/agent-hook-listener.test.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/codex-startup-delivery.test.ts
  • src/shared/codex-startup-delivery.ts
  • src/shared/draft-paste-ready-scanner.test.ts
  • src/shared/draft-paste-ready-scanner.ts
  • src/shared/native-chat-slash-commands.test.ts
  • src/shared/native-chat-slash-commands.ts
  • src/shared/rate-limit-types.ts
  • src/shared/terminal-title-status.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-draft-launch.ts
  • src/shared/tui-agent-permissions.test.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-startup-codex-launch.ts
  • src/shared/tui-agent-startup.test.ts
  • src/shared/tui-agent-startup.ts
✅ Files skipped from review due to trivial changes (4)
  • src/renderer/src/components/settings/codex-session-source-home-control.tsx
  • src/shared/tui-agent-config.ts
  • src/shared/rate-limit-types.ts
  • src/main/rate-limits/codex-auth-presence.ts
🚧 Files skipped from review as they are similar to previous changes (70)
  • src/main/runtime/orca-runtime.test.ts
  • src/shared/tui-agent-permissions.test.ts
  • config/tsconfig.cli.json
  • src/main/codex-accounts/service.ts
  • src/main/ai-vault/session-scanner-codex-item-completed.ts
  • src/main/codex/wsl-codex-session-bridge.test.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/main/codex/codex-hook-identity.ts
  • src/main/pty/codex-home-wsl-env.test.ts
  • src/main/native-chat/session-file-resolver.test.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/codex/config-toml-trust.ts
  • src/renderer/src/lib/new-workspace.ts
  • src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.ts
  • src/main/codex/codex-config-path-reference-rewrite.ts
  • src/main/rate-limits/codex-fetcher-auth-errors.test.ts
  • src/main/daemon/pty-subprocess.test.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/main/native-chat/session-file-resolver.ts
  • src/main/native-chat/transcript-reader.test.ts
  • src/shared/tui-agent-startup.test.ts
  • src/main/rate-limits/codex-fetcher-pty-settle.test.ts
  • src/renderer/src/components/native-chat/NativeChatComposer.tsx
  • src/main/codex/codex-config-hooks-feature-normalize.ts
  • src/main/codex/codex-profile-v2-config-overlay-mirror.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-composer-keydown.ts
  • src/shared/draft-paste-ready-scanner.test.ts
  • src/shared/native-chat-slash-commands.test.ts
  • src/main/ipc/pty.test.ts
  • src/shared/agent-detection.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/native-chat/transcript-reader.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/main/codex/codex-session-file-listing.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.test.ts
  • src/shared/agent-detection.test.ts
  • src/main/codex/hook-service.test.ts
  • src/shared/codex-startup-delivery.ts
  • src/main/native-chat/transcript-codex-turn-items.ts
  • src/shared/terminal-title-status.ts
  • src/main/codex/hook-service.ts
  • src/main/ai-vault/session-scanner-codex-paths.ts
  • src/main/pty/codex-home-wsl-env.ts
  • src/relay/pty-handler.test.ts
  • src/shared/agent-hook-listener.test.ts
  • src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.ts
  • src/main/codex/codex-session-copy-markers.ts
  • src/shared/codex-startup-delivery.test.ts
  • src/renderer/src/lib/launch-agent-background-session.test.ts
  • src/main/native-chat/transcript-line-decoders.ts
  • src/main/rate-limits/codex-fetcher.test.ts
  • src/main/ai-vault/session-scanner-codex-rollout-read.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/shared/tui-agent-draft-launch.ts
  • src/main/ai-vault/session-scanner-codex-parser.test.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/native-chat-slash-commands.ts
  • src/shared/agent-hook-listener.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/ai-vault/session-scanner-codex-parser.ts
  • src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/main/ai-vault/session-scanner-codex-record-consume.ts
  • src/main/codex/codex-config-mirror.test.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.ts
  • src/renderer/src/lib/agent-startup-delayed-delivery.ts
  • src/main/codex/codex-session-bridge.test.ts
  • src/main/codex/codex-session-bridge.ts
  • src/shared/tui-agent-startup.ts
  • src/shared/draft-paste-ready-scanner.ts

Comment thread src/main/rate-limits/codex-fetcher.ts
@bbingz

bbingz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto latest origin/main (post-#7867/#7969). Conflict only in config/tsconfig.cli.json — kept both PR codex-profile-v2-config-overlay-mirror and main codex-wsl-hook-install-plan. Force-pushed: eac09ebc58ab17bd41424dbc20ae385a80a61e00.

@bbingz
bbingz force-pushed the fix/codex-cli-compat branch from 4a3af1d to eac09eb Compare July 10, 2026 00:27

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1994f0fe-d64a-4576-b23c-9ed8e3f2e9f0

📥 Commits

Reviewing files that changed from the base of the PR and between 4a3af1dee88b403e9b839fb33f42bdf5a53ddccb and eac09ebc58ab17bd41424dbc20ae385a80a61e00.

📒 Files selected for processing (78)
  • config/tsconfig.cli.json
  • src/main/ai-vault/session-scanner-codex-item-completed.ts
  • src/main/ai-vault/session-scanner-codex-parser.test.ts
  • src/main/ai-vault/session-scanner-codex-parser.ts
  • src/main/ai-vault/session-scanner-codex-paths.ts
  • src/main/ai-vault/session-scanner-codex-record-consume.ts
  • src/main/ai-vault/session-scanner-codex-rollout-read.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/codex-accounts/service.ts
  • src/main/codex/codex-config-hooks-feature-normalize.ts
  • src/main/codex/codex-config-mirror.test.ts
  • src/main/codex/codex-config-mirror.ts
  • src/main/codex/codex-config-path-reference-rewrite.ts
  • src/main/codex/codex-hook-identity.ts
  • src/main/codex/codex-profile-v2-config-overlay-mirror.ts
  • src/main/codex/codex-session-bridge.test.ts
  • src/main/codex/codex-session-bridge.ts
  • src/main/codex/codex-session-copy-markers.ts
  • src/main/codex/codex-session-file-listing.ts
  • src/main/codex/config-toml-trust.ts
  • src/main/codex/hook-service.test.ts
  • src/main/codex/hook-service.ts
  • src/main/codex/wsl-codex-session-bridge.test.ts
  • src/main/codex/wsl-codex-session-bridge.ts
  • src/main/daemon/pty-subprocess.test.ts
  • src/main/ipc/pty.test.ts
  • src/main/native-chat/session-file-resolver.test.ts
  • src/main/native-chat/session-file-resolver.ts
  • src/main/native-chat/transcript-codex-turn-items.ts
  • src/main/native-chat/transcript-line-decoders.ts
  • src/main/native-chat/transcript-reader.test.ts
  • src/main/native-chat/transcript-reader.ts
  • src/main/pty/codex-home-wsl-env.test.ts
  • src/main/pty/codex-home-wsl-env.ts
  • src/main/rate-limits/codex-auth-presence.ts
  • src/main/rate-limits/codex-fetcher-auth-errors.test.ts
  • src/main/rate-limits/codex-fetcher-pty-settle.test.ts
  • src/main/rate-limits/codex-fetcher.test.ts
  • src/main/rate-limits/codex-fetcher.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/relay/pty-handler.test.ts
  • src/renderer/src/components/native-chat/NativeChatComposer.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-state.test.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.ts
  • src/renderer/src/components/native-chat/use-native-chat-composer-keydown.ts
  • src/renderer/src/components/settings/codex-session-source-home-control.tsx
  • 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/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/renderer/src/lib/agent-startup-delayed-delivery.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/lib/launch-agent-background-session.test.ts
  • src/renderer/src/lib/new-workspace.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/shared/agent-detection.test.ts
  • src/shared/agent-detection.ts
  • src/shared/agent-hook-listener.test.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/codex-startup-delivery.test.ts
  • src/shared/codex-startup-delivery.ts
  • src/shared/draft-paste-ready-scanner.test.ts
  • src/shared/draft-paste-ready-scanner.ts
  • src/shared/native-chat-slash-commands.test.ts
  • src/shared/native-chat-slash-commands.ts
  • src/shared/rate-limit-types.ts
  • src/shared/terminal-title-status.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-draft-launch.ts
  • src/shared/tui-agent-permissions.test.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-startup-codex-launch.ts
  • src/shared/tui-agent-startup.test.ts
  • src/shared/tui-agent-startup.ts
✅ Files skipped from review due to trivial changes (5)
  • src/main/rate-limits/codex-auth-presence.ts
  • src/renderer/src/components/settings/codex-session-source-home-control.tsx
  • src/shared/tui-agent-config.ts
  • src/shared/rate-limit-types.ts
  • config/tsconfig.cli.json
🚧 Files skipped from review as they are similar to previous changes (69)
  • src/shared/agent-detection.test.ts
  • src/main/native-chat/transcript-reader.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/components/native-chat/NativeChatComposer.tsx
  • src/shared/agent-detection.ts
  • src/renderer/src/components/native-chat/use-native-chat-composer-keydown.ts
  • src/shared/native-chat-slash-commands.test.ts
  • src/main/native-chat/transcript-reader.test.ts
  • src/renderer/src/lib/agent-startup-delayed-delivery.ts
  • src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.ts
  • src/main/codex/codex-hook-identity.ts
  • src/renderer/src/lib/launch-agent-background-session.test.ts
  • src/shared/codex-startup-delivery.test.ts
  • src/main/codex-accounts/service.ts
  • src/main/codex/codex-profile-v2-config-overlay-mirror.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-codex-item-completed.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/main/codex/wsl-codex-session-bridge.test.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/relay/pty-handler.test.ts
  • src/shared/native-chat-slash-commands.ts
  • src/main/rate-limits/codex-fetcher-pty-settle.test.ts
  • src/main/ai-vault/session-scanner-codex-rollout-read.ts
  • src/main/pty/codex-home-wsl-env.test.ts
  • src/shared/draft-paste-ready-scanner.test.ts
  • src/shared/tui-agent-permissions.test.ts
  • src/shared/tui-agent-permissions.ts
  • src/main/codex/config-toml-trust.ts
  • src/shared/tui-agent-startup.test.ts
  • src/main/codex/codex-config-path-reference-rewrite.ts
  • src/main/ai-vault/session-scanner-codex-parser.test.ts
  • src/shared/codex-startup-delivery.ts
  • src/renderer/src/lib/agent-paste-draft.ts
  • src/main/rate-limits/codex-fetcher-auth-errors.test.ts
  • src/main/native-chat/session-file-resolver.test.ts
  • src/main/ipc/pty.test.ts
  • src/main/ai-vault/session-scanner-codex-paths.ts
  • src/shared/terminal-title-status.ts
  • src/main/codex/hook-service.ts
  • src/main/native-chat/transcript-codex-turn-items.ts
  • src/main/native-chat/transcript-line-decoders.ts
  • src/main/codex/codex-session-file-listing.ts
  • src/shared/tui-agent-startup-codex-launch.ts
  • src/main/codex/codex-session-copy-markers.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex/codex-config-hooks-feature-normalize.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.test.ts
  • src/main/codex/hook-service.test.ts
  • src/renderer/src/lib/new-workspace.ts
  • src/main/pty/codex-home-wsl-env.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.ts
  • src/shared/tui-agent-draft-launch.ts
  • src/shared/draft-paste-ready-scanner.ts
  • src/shared/agent-hook-listener.test.ts
  • src/main/rate-limits/codex-fetcher.test.ts
  • src/main/native-chat/session-file-resolver.ts
  • src/renderer/src/lib/agent-paste-draft.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/main/ai-vault/session-scanner-codex-record-consume.ts
  • src/main/daemon/pty-subprocess.test.ts
  • src/shared/agent-hook-listener.ts
  • src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.ts
  • src/shared/tui-agent-startup.ts
  • src/main/ai-vault/session-scanner-codex-parser.ts
  • src/main/codex/codex-config-mirror.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/codex/codex-session-bridge.ts

Comment thread src/main/codex/codex-config-mirror.ts Outdated
Comment thread src/main/codex/wsl-codex-session-bridge.ts
Comment thread src/main/rate-limits/codex-fetcher.ts Outdated
Comment thread src/main/rate-limits/codex-fetcher.ts Outdated
Comment thread src/main/rate-limits/codex-fetcher.ts Outdated
@bbingz

bbingz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Merged latest origin/main. Resolved conflicts in codex-config-mirror.ts, codex-auth-presence.ts, and codex-fetcher.ts (kept PR auth-store/TOML/URL work + main multi-home mirror and async auth probes). 73c62f99aaab0a92fe365eb2173a2dc82ffe362d.

@bbingz

bbingz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Merged latest origin/main (no conflicts: CDP attach, HTML preview-to-side, Antigravity sandbox flag). Head: 85fb6e762.

@bbingz

bbingz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Merged latest origin/main. Conflict only in codex-home-wsl-env.ts — kept main's WSL runtime home segments plus PR strip/host-home helpers. 61e605db2dc9476781310aed5bae268ad985a462.

@bbingz

bbingz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Resolved conflicts with latest origin/main via rebase.

Conflict files (reconciled):

  • session-scanner-source-discovery.ts — kept PR zstd/rollout helpers + main subagent import
  • codex-config-mirror.ts — kept main multi-home API + WSL UNC parse + PR file-auth store / profile-v2 overlays
  • codex-home-wsl-env.ts — kept main WSL runtime home segments + PR host/WSL strip helpers
  • codex-auth-presence.ts — kept main async UNC-safe probe + PR file-store commentary
  • codex-fetcher.ts — merged main backend auth/shared-read + PR chatgpt_base_url routing, multi-bucket rateLimitsByLimitId, and preferred-snapshot ordering

Validation: focused vitest 55/55 (codex-fetcher, buckets, auth-presence, config-mirror, wsl-env).

Head: d4ec74de2.

@bbingz
bbingz force-pushed the fix/codex-cli-compat branch from 61e605d to d4ec74d Compare July 10, 2026 08:50
bbingz and others added 7 commits July 10, 2026 18:19
Raise Orca's Codex integration to match current openai/codex behavior
after a full source-level comparison (hooks, startup, CODEX_HOME, rollouts,
TUI UX, usage).

Status & hooks:
- SessionStart no longer flashes working; SubagentStart/Stop installed and mapped
- Remote managed hooks prepend like local; PostToolUse tool_response + better previews
- Interrupt markers clear sticky working without inventing StopFailure

Startup & drafts:
- Composer-ready requires Ask Codex placeholder (not bare › during hooks review)
- Drop dead Codex --prefill myth; Windows argv budget falls back to paste-submit
- Optional -i/--image on startup plans; safer post-paste submit delay

Auth, sessions, native chat:
- Force cli_auth_credentials_store=file on managed/runtime homes
- Decode item_completed TurnItems; read .jsonl.zst; hardlink→copy bridge

UX / usage / config:
- Native Action Required title mapping; slash catalog refresh; skill path plumbing
- Multi-bucket rate limits; config base URL for reset credits; path rewrite keys
- Profile-v2 overlay mirror; WSL host-home strip messaging
- Write .orca-session-copies markers after WSL cp -p session bridge fallback
- Ignore whitespace-only YOLO arg constants (avoid vacuous every())
- Use a tighter inline draft limit when Windows startup shell is cmd.exe
session/weekly already surface the preferred primary/secondary; including them in buckets duplicated the same meter in tooltip/status-bar UI.
- Recognize quoted cli_auth_credentials_store keys
- Compare copy-marker mtimes at second precision (WSL stat)
- Scan top-level TOML keys with structural line state
- Route ChatGPT backends via URL host parsing, not path includes
- Prefer wrapper.rateLimits over first by-id snapshot
…erlays

- Re-sync managed session copies when system source grows after hardlink fail
- Re-queue startup prompt delivery after failed paste (not just clear guard)
- Mirror profile-v2 *.config.toml with relative path rewrite into managed home
- Infer additional rate-limit bucket windows from API remaining minutes
Rebase conflict resolution dropped the ChatGPT backend default constant
used by normalizeCodexBackendBaseUrl, breaking reset-credit URL tests.
@bbingz
bbingz force-pushed the fix/codex-cli-compat branch from d4ec74d to bea7270 Compare July 10, 2026 10:28
@bbingz

bbingz commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by four focused, rebased PRs:

Each replacement targets current main, has its own scoped tests/review notes, and is independently revertible. #8281 was additionally updated after CodeRabbit review so ambiguous or partially acknowledged PTY writes are never replayed.

Closing this conflicting umbrella PR to avoid duplicate review and merge work.

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