Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5d14c00
feat(app-server): add in-process runtime and shared client facade
fcoury Mar 5, 2026
ac7c727
feat(exec): migrate exec to in-process app-server
fcoury Mar 5, 2026
0b78141
refactor(core): restore protocol parity for in-process clients
fcoury Mar 5, 2026
b2fdde9
docs(core): clarify in-process app-server contracts
etraut-openai Mar 8, 2026
eab69aa
fix(exec): surface in-process lag warnings
etraut-openai Mar 8, 2026
39e0b69
docs(core): expand in-process architecture notes
etraut-openai Mar 8, 2026
bf1cb8b
fix(exec): avoid in-process bootstrap stall
etraut-openai Mar 8, 2026
99b1d53
fix(app-server): handle plugin list request ids
fcoury Mar 6, 2026
3ad5c84
fix(exec): resolve in-process protocol drift
etraut-openai Mar 8, 2026
85b2f71
fix(exec): address rust-ci clippy warnings
fcoury Mar 6, 2026
6e61fde
fix(app-server): avoid unnecessary clone in in-process path
etraut-openai Mar 8, 2026
f440091
fix(app-server): cover command exec request ids in tracing
fcoury Mar 8, 2026
aaf337a
Remove ClientSurface from app-server client
etraut-openai Mar 8, 2026
c746138
Address in-process exec review feedback
etraut-openai Mar 8, 2026
0f784d2
Move client request id access into protocol
etraut-openai Mar 8, 2026
794087d
Clarify in-process typed request decode semantics
etraut-openai Mar 8, 2026
9291956
Move exec auth env policy to startup args
etraut-openai Mar 8, 2026
d44ff4d
Add cleanup TODO for synthesized session config
etraut-openai Mar 8, 2026
7c07f4e
Handle closed exec interrupt channel
etraut-openai Mar 8, 2026
29b2c65
Keep in-process requests pumping during client waits
etraut-openai Mar 8, 2026
c8eb062
Document in-process event delivery flow
etraut-openai Mar 8, 2026
23bb325
Preserve exec thread scoping for legacy events
etraut-openai Mar 8, 2026
183e73e
codex: address PR review feedback (#14005)
etraut-openai Mar 8, 2026
b4cf3df
codex: address PR review feedback (#14005)
etraut-openai Mar 8, 2026
dce63d4
codex: address PR review feedback (#14005)
etraut-openai Mar 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions codex-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions codex-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"ansi-escape",
"async-utils",
"app-server",
"app-server-client",
"app-server-protocol",
"app-server-test-client",
"debug-client",
Expand Down Expand Up @@ -86,6 +87,7 @@ codex-api = { path = "codex-api" }
codex-artifacts = { path = "artifacts" }
codex-package-manager = { path = "package-manager" }
codex-app-server = { path = "app-server" }
codex-app-server-client = { path = "app-server-client" }
codex-app-server-protocol = { path = "app-server-protocol" }
codex-app-server-test-client = { path = "app-server-test-client" }
codex-apply-patch = { path = "apply-patch" }
Expand Down
30 changes: 30 additions & 0 deletions codex-rs/app-server-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "codex-app-server-client"
version.workspace = true
edition.workspace = true
license.workspace = true

[lib]
name = "codex_app_server_client"
path = "src/lib.rs"

[lints]
workspace = true

[dependencies]
codex-app-server = { workspace = true }
codex-app-server-protocol = { workspace = true }
codex-arg0 = { workspace = true }
codex-core = { workspace = true }
codex-feedback = { workspace = true }
codex-protocol = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["sync", "time", "rt"] }
toml = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
pretty_assertions = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
67 changes: 67 additions & 0 deletions codex-rs/app-server-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# codex-app-server-client

Shared in-process app-server client used by conversational CLI surfaces:

- `codex-exec`
- `codex-tui`

## Purpose

This crate centralizes startup and lifecycle management for an in-process
`codex-app-server` runtime, so CLI clients do not need to duplicate:

- app-server bootstrap and initialize handshake
- in-memory request/event transport wiring
- lifecycle orchestration around caller-provided startup identity
- graceful shutdown behavior

## Startup identity

Callers pass both the app-server `SessionSource` and the initialize
`client_info.name` explicitly when starting the facade.

That keeps thread metadata (for example in `thread/list` and `thread/read`)
aligned with the originating runtime without baking TUI/exec-specific policy
into the shared client layer.

## Transport model

The in-process path uses typed channels:

- client -> server: `ClientRequest` / `ClientNotification`
- server -> client: `InProcessServerEvent`
- `ServerRequest`
- `ServerNotification`
- `LegacyNotification`

JSON serialization is still used at external transport boundaries
(stdio/websocket), but the in-process hot path is typed.

Typed requests still receive app-server responses through the JSON-RPC
result envelope internally. That is intentional: the in-process path is
meant to preserve app-server semantics while removing the process
boundary, not to introduce a second response contract.

## Bootstrap behavior

The client facade starts an already-initialized in-process runtime, but
thread bootstrap still follows normal app-server flow:

- caller sends `thread/start` or `thread/resume`
- app-server returns the immediate typed response
- richer session metadata may arrive later as a `SessionConfigured`
legacy event

Surfaces such as TUI and exec may therefore need a short bootstrap
phase where they reconcile startup response data with later events.

## Backpressure and shutdown

- Queues are bounded and use `DEFAULT_IN_PROCESS_CHANNEL_CAPACITY` by default.
- Full queues return explicit overload behavior instead of unbounded growth.
- `shutdown()` performs a bounded graceful shutdown and then aborts if timeout
is exceeded.

If the client falls behind on event consumption, the worker emits
`InProcessServerEvent::Lagged` and may reject pending server requests so
approval flows do not hang indefinitely behind a saturated queue.
Loading
Loading