Repository navigation
Reap failed Codex app-server startups before retrying - #15977
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
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. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
Review: codex review at 2851bb5 found no actionable defects; the focused startup cleanup regression passed, with broader checks limited by missing React dependencies and unrelated existing failures. Fixed: none needed. Left: none. |
|
Merge receipt for |
e709b69 fix(cloud): stop reconciling panes a Cloud workspace already shows (manaflow-ai#16025) d13dde3 Diff viewer: viewed state, file filter, generated and large diffs collapsed (manaflow-ai#15536) e0d5c5e test: pay the Pi fixtures' first exec before timing them (manaflow-ai#16028) e2e0b61 ci: disable unstable UI test dispatch lane (manaflow-ai#16075) 15996b0 ci: sweep side lanes instead of rescuing workflow runs (manaflow-ai#16076) 3dcf462 Recover terminal chat when transcript files are replaced (manaflow-ai#16045) 272d069 fix(agent-chat): let Stop cancel a queued or starting ACP turn (manaflow-ai#15925) 30bd116 test: cover invalid unquoted Xcode extension paths (manaflow-ai#16054) a24a1b5 Make GitHub references in the agent chat transcript clickable (manaflow-ai#15916) 86d1cfc Reap failed Codex app-server startups before retrying (manaflow-ai#15977) 890cd1e fix(sidebar): expose workspace close button to accessibility (manaflow-ai#15965) faf4c8f docs: define agent fan-out and reusable Cloud work environments (manaflow-ai#15836) ab20b79 ci: cut cmux-tui Testbox warmup hold time (manaflow-ai#15557) 31fb228 Promote devbox images with cmux-tui 7d17754 (VT replay blank-cell fix) (manaflow-ai#16072) e0da0a6 feat(acp): cmux as a read-only ACP host, phase 1 (manaflow-ai#15976) 3ed1d77 Reap failed ACP startups and temporary catalog probes (manaflow-ai#15979) f5c3567 Add a Focus TextBox Input item to the View menu (manaflow-ai#15730) b3a1ca1 Document the 32 CLI verbs the contract table was missing, and guard it (manaflow-ai#15993) 3bba04e Say which app-host result file could not be read (manaflow-ai#15997) 7ef6d3a Resume Cloud Codex chats after app-server restart (manaflow-ai#15915) a803f36 fix: surface simulator process output reader failures (manaflow-ai#15880) f6a0163 Keep terminal approval notices from moving the composer (manaflow-ai#15886) b8ab767 test: isolate feature flag defaults between runs (manaflow-ai#15587) 5150a9b Keep unsent cloud prompts recoverable (manaflow-ai#15902) 233bd6d Restore terminal attention when transcript chat reconnects (manaflow-ai#15891) 573f998 Resolve a dogfood menu path against the direct children of each open menu (manaflow-ai#15923) 7b7a1b2 test(ci): assert the registry guard's exit code, and handle merge_group (manaflow-ai#16017) # Conflicts: # .github/workflows/ci-guards.yml # .github/workflows/ci-owned-pool-rescue.yml # .github/workflows/ci-ui-tests.yml # .github/workflows/ci.yml # .github/workflows/cmux-tui-testbox-warmup.yml
When Codex app-server rejects initialization, Agent Chat returns the error but leaves its child process running. Repeated retries can accumulate orphan servers. A hung startup can also ignore the existing SIGTERM timeout.
Failed startup now kills and reaps the unpublished child before releasing the shared startup promise. The timeout uses SIGKILL, and initialization errors retain their original diagnostic. Successful servers remain alive and are reused. This complements #15915, which restores conversations after an app-server restart.
The regression uses disposable Bun children through the real adapter startup path; it never invokes the installed Codex binary. It covers concurrent callers sharing one startup, repeated rejection, a 30-second timeout with a child that ignores SIGTERM, and successful retry and reuse.
Validation
a2542cc2dae84b78ee61ad0c8eea5f26e2afe4c0,cd agent-chat && bun run test/codex-initialize.test.tsfails withfailed initialization must reap its child before returning the error.2851bb55df50b33e4bbe1015c1da92ca029a2fd0, the same focused command passes.cd agent-chat && bun run checkpasses TypeScript, 24 assertion scripts, and 44 tests across 13 Bun test files.cd agent-chat && bun run buildpasses (25 outputs).git diff --checkpasses.Changelog
Fixed: Reap failed Codex app-server startups so Agent Chat retries do not leave orphan processes running.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes Codex app-server startups so failed or hung initialization no longer leaves orphan child processes that accumulate on retries.
Previously, when the app-server rejected
initialize, Agent Chat returned the error but left the child process running; a hung startup also ignored the existing SIGTERM timeout. Now the unpublished child is killed with SIGKILL and reaped before the shared startup promise is released, and the original initialization error is preserved. Successfully initialized servers remain alive and are reused by later calls.Written for commit 2851bb5. Summary will update on new commits.