Skip to content

Codex restarts keep the configured command before a session is recorded - #33629

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/sta-11741-codex-restart-command
Oct 27, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/sta-11741-codex-restart-command

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​77 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​46
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​68 $\color{#cf222e}{\Huge{\mathbf{−}}}$​34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34

When Restart in place ran before Codex recorded a session, Orca discarded the Codex command configured in Settings and ran bare codex. On Windows this could select the npm PowerShell script and fail under script policy even though the configured native executable worked for the initial launch.

Restart now selects the configured command through the existing launch selector, including the deferred fallback for a pane without a layout leaf. Recorded conversations retain their resume behavior. User-supplied shell commands remain unchanged.

Tracked in STA-11741; also covers duplicate STA-11742.

Review path: full, because this changes terminal restart and process launch. Two review rounds completed; incomplete test fixtures and the remaining importer of the removed constant were repaired in place. Final reference, readiness, performance and main-merge checks passed.

Intended existing differences from the common pattern: terminal commands remain opaque shell text, fresh no-session restarts keep empty appended arguments/environment, WSL Codex retains its fresh-relaunch boundary, and Claude requires a recorded conversation. No new saved fields, wire operations or controls.

Validation: final CI green on f22f288, including typecheck, all five test shards, changed layout specs and Windows packaging. Targeted tests passed through the test gate, and normal pre-commit checks passed. Real Windows QA used a restrictive process-only PowerShell policy, an absolute codex.exe override and real Codex/Claude replies through the existing rendered restart actions. Initial launch and no-session Restart each returned two replies; recorded Codex and Claude sessions retained history, identity and remembered tokens across a graceful previous-build upgrade and Restart.

QA limits: notice-only fixtures exposed existing restart notices/dialogs; organic account-switch discovery and credential migration were not tested. WSL could not run the installed Codex CLI on this machine; its contract tests passed. The detached no-leaf queue-to-mount flow has contract coverage but was not exercised in the running app because no reliable topology fixture preserved the existing UI entry point. Matching-main policy-failure proof was reused from the prior c6ce72d baseline; this run created fresh baseline conversations for upgrade continuity. Full-window screenshots and the review marker are in the review status comment.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 25, 2026 20:27
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

Codex account restart startup now resolves the command from the pane’s launch target, including configured command overrides and the target platform and shell. Detached-pane restarts without a usable layout leaf use this builder. The fixed Codex startup constant was removed, and tests now cover configured commands and Windows-style overrides.

Priority: Normal

Merge Risk: Moderate · up to 446e0

The changed test blocks typecheck. Build its settings from complete defaults before merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description has a clear, substantive account of the change: the problem (bare codex chosen on Windows when no session was recorded), the mechanism (configured command selected through the existi… Add the missing template sections to the PR description: (1) an ELI5 section in plain language; (2) a 'What Changed' section with the before and after as users experience them; (3) a 'Why' section explaining why selecting the configured com…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving the configured Codex command during restarts before a session is recorded.
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.
Full details: Description check

Explanation

The description has a clear, substantive account of the change: the problem (bare codex chosen on Windows when no session was recorded), the mechanism (configured command selected through the existing launch selector, including the deferred detached-pane fallback), scope limits (recorded conversations keep resume behavior, user-supplied shell commands unchanged), tracking references, and detailed Windows QA notes. The template sections ELI5, Linked Issue, Visual Proof, Testing checkboxes, AI Disclosure, the Agent skill upstream boundary checkbox, and the Checklist are missing or unfilled. The 'Fixes #' line in Linked Issue is blank and the PR cites STA-11741 (an internal tracker reference) rather than a GitHub issue. The 'Visual Proof' section is absent, though the PR changes restart behavior that is user-visible in the UI, and the author mentions full-window screenshots exist only in a review status comment rather than in the description. The 'Review' section and 'Notes' cross-platform/SSH/security/performance confirmation are only partially addressed through prose. Because the core content is present but several required template sections are missing or empty, the description is not fully complete.

Resolution

Add the missing template sections to the PR description: (1) an ELI5 section in plain language; (2) a 'What Changed' section with the before and after as users experience them; (3) a 'Why' section explaining why selecting the configured command was chosen over alternatives; (4) a Linked Issue with an actual GitHub issue reference in the 'Fixes #' line (replace the blank line; the STA-11741 tracker reference alone may not satisfy the requirement); (5) a Visual Proof section with before and after screenshots or video of the restart behavior, or N/A with a reason; (6) a Testing section with the checkboxes marked as applicable and the platforms actually tested listed explicitly (Windows is described; macOS, Linux, and SSH status should be stated); (7) an AI Disclosure section, unless the author is a StablyAI team member; (8) the Agent skill upstream boundary checkbox marked; and (9) the Checklist items checked or marked. Also state explicitly the Security, cross-platform, SSH/remote, mobile, backwards compatibility, and performance review results under Notes.

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fafc1c2a-6662-4aa6-900f-736c08e971bf
Commits

Reviewing files that changed from the base of the PR and between 92fd257 and 446e0f2.

Files selected for processing: 6
  • src/renderer/src/components/terminal-pane/codex-detached-pane-restart.test.ts
  • src/renderer/src/components/terminal-pane/codex-detached-pane-restart.ts
  • src/renderer/src/lib/agent-account-restart-startup.test.ts
  • src/renderer/src/lib/agent-account-restart-startup.ts
  • src/renderer/src/lib/codex-session-restart.test.ts
  • src/renderer/src/lib/codex-session-restart.ts
Files with no reviewable changes: 2
  • src/renderer/src/lib/codex-session-restart.test.ts
  • src/renderer/src/lib/codex-session-restart.ts

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

When Restart in place ran before Codex recorded a session, it could discard the command from Settings. On Windows, the npm PowerShell script then failed under script policy even though the configured native executable worked for the first launch.

Restart now keeps the configured command in both fresh fallback paths. Recorded conversations retain their existing resume behavior; no-session arguments/environment remain unchanged.

Two review rounds completed. Fixed incomplete Settings/store fixtures and migrated the remaining integration importer to the real builder; mounted and paired transport assertions now verify the configured command and agent-launch fields. No findings deferred. Final reference, readiness, performance and narrow main-merge checks passed.

Verified on f22f2887c0acded9e28ace377aa682a9e66bc66d: CI green, including typecheck, all five test shards, layout checks and Windows packaging. Targeted test runs passed (70 correctness tests, then 22 tests after fixture repairs). Real Windows initial launch and no-session Restart each produced two genuine Codex replies. Baseline-created Codex and Claude sessions survived a graceful app upgrade and actual Restart, retaining session IDs, history and remembered tokens. Both app copies stopped gracefully; real configuration hashes remained unchanged.

Fixtures and limits: existing notices/dialogs were exposed with disclosed notice-only fixtures; commands, provider identity and replies were genuine. Organic account-switch discovery/credential migration were not exercised. WSL was unavailable for Codex on the admitted machine (missing Linux binary or Node); WSL contracts passed. Detached no-leaf queue-to-mount remains contract-only because no reliable topology fixture preserved its existing UI entry point. The main policy-failure image below is reused matching-baseline evidence from c6ce72d; baseline conversations for this upgrade were newly created in this run.

For Brennan's review

Flow Previous build / main PR result
No-session Restart Matching baseline: PowerShell script refused Configured native Codex: two replies after Restart
Recorded Codex conversation Baseline Codex: two replies and remembered token Same Codex conversation after upgrade and Restart
Recorded Claude conversation Baseline Claude: two replies and remembered token Same Claude conversation after upgrade and Restart
Initial-launch control and configured commands

Initial Codex launch: two genuine replies

Absolute native Codex and Claude command settings

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