Skip to content

[codex] add code-mode host failure supervision hooks - #30110

Merged
cconger merged 1 commit into
mainfrom
cconger/process-owned-session-runtime-2-runtime
Jun 25, 2026
Merged

[codex] add code-mode host failure supervision hooks#30110
cconger merged 1 commit into
mainfrom
cconger/process-owned-session-runtime-2-runtime

Conversation

@cconger

@cconger cconger commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Why

A process host should be discarded and rebuilt after critical actor or V8 failure, while the existing in-process production path must keep its current cell-error semantics. This change establishes that failure boundary without adding the host process or remote client.

What changed

  • add optional task-failure supervision to the transport-neutral code-mode session runtime
  • report Tokio cell-actor failures and V8 runtime-thread panics to a host-provided fail-stop handler
  • preserve the existing handler-less in-process behavior
  • make host-owned cell ID allocation fail before numeric wraparound

Follow-up

The V8 panic signal surfaced here should also be consumed by the InProcessCodeModeSession manager in a future change so it can fail the affected cell. This PR intentionally leaves the handler-less in-process behavior unchanged while putting the required panic tracking in place.

Stack

This is 2 of 4 in the process-owned code-mode session stack.

Validation

  • just test -p codex-code-mode — 53 passed
  • just argument-comment-lint -p codex-code-mode
  • just fix -p codex-code-mode

Base automatically changed from cconger/process-owned-session-runtime-1-ipc to main June 25, 2026 20:26
@cconger
cconger force-pushed the cconger/process-owned-session-runtime-2-runtime branch from 93c2ba5 to 9dcaccb Compare June 25, 2026 20:32
@cconger
cconger marked this pull request as ready for review June 25, 2026 20:38

@jif-oai jif-oai 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.

nits so pre-approvign

}
}
}
RuntimeEvent::ThreadPanicked => {

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.

Can we route notification/tool task JoinErrors through the fail-stop handler too? A panic in host.invoke_tool() is currently only logged, leaving the JS promise pending and never
rebuilding the host

Comment thread codex-rs/code-mode/src/session_runtime/mod.rs Outdated
@cconger
cconger force-pushed the cconger/process-owned-session-runtime-2-runtime branch from 9dcaccb to b6b8769 Compare June 25, 2026 21:49
@cconger
cconger merged commit 6c21297 into main Jun 25, 2026
31 checks passed
@cconger
cconger deleted the cconger/process-owned-session-runtime-2-runtime branch June 25, 2026 22:34
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants