Repository navigation
Conversation
Handle stdin errors and write receipts without an uncaught exception, fence replacement and turn completion until closure, and preserve uncertain answer delivery.
Keep metadata, admission, thread opens, terminal cleanup and response writes on the original server lease. Refuse retired-generation auth recovery, wait for closing servers, and report only that child's native version.
Carry the server lease through health publication and the actual stale-auth restart/replay decision. Detach old cleanup registries before native withdrawal callbacks, and retain latest-issued identity across closure so old attempts cannot regain recovery authority. Validation: main build, 136 affected cases passed with 13 opt-in native/live skips, and one private Electron regression passed without retries. Full local qualification and protected delivery remain pending.
Supply deterministic missing-file selection and scope readers only for the 1,001-receipt fixture. Preserve the shared scheduler, production deadlines, original assertions and real-filesystem boundary cases. Assert every intended unique selection read and both scope reads. Main compilation and 18 context/scope tests pass; the identical slow-realpath control passes with zero realpath calls. Retain the original full failure and incomplete scope-only correction separately. Fresh full qualification remains pending.
Record the frozen source, passing coverage, six-second Claude test cancellation, isolated diagnostic and repeated window-position failure. Preserve first failures and explicit native/live acceptance limits; require fresh hosted and protected queue qualification before delivery.
Code coverage overviewLanguages: TypeScript TypeScript / code-coverage-agent
View coverage of the 3 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical active issue remains in codex.ts where a stale authentication attempt can replay after a replacement server starts and closes, so generation validation must be fixed to prevent unsafe recovery.
1 open issue
What changed in this PR
This PR hardens Codex app-server lifecycle handling so stdin failures are consumed, pending operations settle deterministically, failed server generations remain owned until closure, and native answer delivery is persisted as uncertain when transport confirmation is unavailable.
Changes:
- Adds server leases, generation checks, transport-failure handling, and guarded recovery across Codex lifecycle operations.
- Adds regression coverage for pipe failures, ownership races, native request delivery, recovery, task-context selection, and Electron responsiveness.
- Documents validation evidence and remaining qualification limits.
| File | Description |
|---|---|
| docs/status.md | Tracks the Codex lifecycle repair as in flight and records pending hosted and protected qualification. |
| docs/reviews/2026-11-14-codex-input-transport.md | Documents the observed transport failure, repair behavior, validation results, and qualification limits. |
| apps/desktop/test/task-context-checks.test.ts | Adds the 1,001-receipt synthetic confirmation fixture and scope-isolation assertions. |
| apps/desktop/test/human-requests-runner.test.ts | Verifies uncertain native-answer persistence and deletion blocking until the failed child closes. |
| apps/desktop/test/codex-transport.test.ts | Covers pipe failures, initialization receipts, stale events, recovery ownership, and replacement-server races. |
| apps/desktop/src/main/engine/backends/codex.ts | Adds transport-failure handling, server leases, closure ownership, and stale-generation protections. |
| apps/desktop/e2e/codex-transport.spec.ts | Exercises a real closed-input Codex peer and confirms Settings remains responsive without uncaught errors. |
Review effort: Lite
| else { | ||
| if (!this.restart("Codex was restarted to pick up a new sign-in.", owner)) return refused(); | ||
| // A synchronous shutdown subscriber may already have started a different server. | ||
| if (this.lease !== null) return refused(); |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Follow-up to #525: Codex app-server stdin failure can raise an uncaught
EPIPE, and that PR's first failed queue run retained the error with anNSAlert runModalsample during a Settings-click failure. Consume stream failures, settle RPC and initialization write receipts, keep the failed child owned until closure, and preserve an accepted native answer as uncertain when delivery fails.Bind asynchronous reads, writes, coding setup, terminal cleanup and native replies to their originating server. Validate health ownership at publication and stale-auth ownership at the actual restart/replay decision; detach old cleanup registries before withdrawal callbacks, and prevent an old attempt regaining recovery permission after a replacement starts and closes. Meaningful failing controls precede each repair. The 1,001-receipt confirmation fixture also isolates synthetic selection/scope metadata without changing the production scheduler, deadlines or existing assertions.
Validation on signed
2069430: build and workspace typechecks pass. Frozen local unit groups record 2,891 passes, 36 skips and one cancellation at the unchanged Claude test's six-second bound; that case passes in an isolated diagnostic in 1.43 seconds. Desktop E2E records 546 passes, 17 skips and one window-position failure (40,60 reopened as 1157,1148, retaining 960×620); site passes 8 and web passes 4, without retries. The new actual pipe-failure regression and Jev contrast cases pass. The 18 context/scope cases and identical slow-metadata control pass. Local full qualification remains failed; fresh hosted qualification must validate the candidate.Scoped agent source review reports no remaining Critical or Important findings and is not human approval. This signed head adds only receipts/status to the tested source. Evidence, first failures and acceptance limits remain explicit. PR #525 has not been requeued; protected merge, installed-release, live-provider, device and human acceptance remain separate gates, and no issue checkbox changes here.