app-server: prepare to run initialized rpcs concurrently (#17372)

## Summary

- Refactors `MessageProcessor` and per-connection session state so
initialized service RPC handling can be moved into spawned tasks in a
follow-up PR.
- Shares the processor and initialized session data with
`Arc`/`OnceLock` instead of mutable borrowed connection state.
- Keeps initialized request handling synchronous in this PR; it does
**not** call `tokio::spawn` for service RPCs yet.

## Testing

- `just fmt`
- `cargo test -p codex-app-server` *(fails on existing hardening gaps
covered by #17375, #17376, and #17377; the pipelined config regression
passed before the unrelated failures)*
- `just fix -p codex-app-server`
This commit is contained in:
Ruslan Nigmatullin
2026-04-14 11:24:34 -07:00
committed by GitHub
parent 769b1c3d7e
commit 23d4098c0f
6 changed files with 282 additions and 168 deletions

View File

@@ -121,7 +121,7 @@ pub(crate) struct ConnectionState {
pub(crate) outbound_initialized: Arc<AtomicBool>,
pub(crate) outbound_experimental_api_enabled: Arc<AtomicBool>,
pub(crate) outbound_opted_out_notification_methods: Arc<RwLock<HashSet<String>>>,
pub(crate) session: ConnectionSessionState,
pub(crate) session: Arc<ConnectionSessionState>,
}
impl ConnectionState {
@@ -134,7 +134,7 @@ impl ConnectionState {
outbound_initialized,
outbound_experimental_api_enabled,
outbound_opted_out_notification_methods,
session: ConnectionSessionState::default(),
session: Arc::new(ConnectionSessionState::default()),
}
}
}