Skip to content

[codex] wire process-owned code mode host into core - #30142

Merged
cconger merged 3 commits into
mainfrom
cconger/code-mode-service-process-host
Jun 26, 2026
Merged

[codex] wire process-owned code mode host into core#30142
cconger merged 3 commits into
mainfrom
cconger/code-mode-service-process-host

Conversation

@cconger

@cconger cconger commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the code_mode_host feature flag and select ProcessOwnedCodeModeSessionProvider in CodeModeService when enabled
  • initialize code-mode sessions lazily so a missing host reports a tool error without failing thread startup
  • resolve codex-code-mode-host beside the running Codex binary by default while preserving CODEX_CODE_MODE_HOST_PATH as an override
  • add unit and end-to-end coverage for host resolution and graceful missing-host behavior

Why

This wires the process-owned session client from #30112 into the core service behind an opt-in rollout gate. Packaged Codex installations can place the helper in the same bin directory as the main executable without relying on PATH, while development and custom installations can continue to override the helper path.

Stack

Validation

Build codex and codex-code-mode-host
CODEX_CODE_MODE_HOST_PATH="$PWD/target/debug/codex-code-mode-host" ./target/debug/codex --enable code_mode_host

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

Pre-approving but my comment stays valid

Comment thread codex-rs/core/src/session/session.rs Outdated
code_mode_service: crate::tools::code_mode::CodeModeService::new(),
code_mode_service: crate::tools::code_mode::CodeModeService::new(
if config.features.enabled(Feature::CodeModeHost) {
Arc::new(codex_code_mode::ProcessOwnedCodeModeSessionProvider::default())

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.

This makes the provider session-scoped, so every app-server thread/subagent gets its own host process. Shouldn’t the provider live at ThreadManager/process scope and be shared across sessions? I don't see cases where different sessions would have different code mode backend

@cconger
cconger force-pushed the cconger/process-owned-session-runtime-4-client branch from 06e7c1c to 36f0421 Compare June 26, 2026 00:48
@cconger
cconger force-pushed the cconger/code-mode-service-process-host branch from 30cafdd to 32513f1 Compare June 26, 2026 01:10
@cconger
cconger force-pushed the cconger/process-owned-session-runtime-4-client branch from 36f0421 to c6cae04 Compare June 26, 2026 01:10
@cconger
cconger force-pushed the cconger/code-mode-service-process-host branch from 32513f1 to 60d23c5 Compare June 26, 2026 04:24
Base automatically changed from cconger/process-owned-session-runtime-4-client to main June 26, 2026 06:46
@cconger
cconger force-pushed the cconger/code-mode-service-process-host branch from 60d23c5 to b98668a Compare June 26, 2026 06:48
@cconger
cconger marked this pull request as ready for review June 26, 2026 07:22
@cconger
cconger requested a review from a team as a code owner June 26, 2026 07:22
@cconger
cconger merged commit 7d8906b into main Jun 26, 2026
31 checks passed
@cconger
cconger deleted the cconger/code-mode-service-process-host branch June 26, 2026 07:23
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants