Enable exec-server network policy callbacks (#34770)

## What changed

- Let `exec-server` issue JSON-RPC requests to its client and correlate responses, with bounded concurrency, timeouts, and connection cleanup.
- When `request_policy_decisions` is enabled, forward proxy policy requests with the process ID and network destination, then apply the client's allow, deny, or ask decision.
- Fail closed for invalid inputs, unavailable or malformed responses, timeouts, process shutdown, and disconnects. Keep callbacks active while inherited process streams keep the proxy alive.

## Testing

- Cover response correlation, request limits, timeouts, disconnect cleanup, validation boundaries, decision forwarding, and process lifecycle behavior.

GitOrigin-RevId: 60e658102c50036589ca9de844760a8bffaa53b0
This commit is contained in:
viyatb-oai authored and copyberry committed 2026-07-22 15:22:21 +00:00
1 parent ab816f3ca0
commit 32f4687b8c
11 files changed
+1038 -45

No files matched your search

@@ -539,6 +539,19 @@ impl ExecServerClient {
return;
};
match event {
RpcClientEvent::Request(request) => {
let error = crate::rpc::method_not_found(format!(
"exec-server client does not implement `{}` yet",
request.method
));
if rpc_client.respond_error(request.id, error).await.is_err() {
inner.request_recovery(
rpc_client,
disconnected_message(/*reason*/ None),
);
return;
}
}
RpcClientEvent::Notification(notification) => {
if let Err(error) = handle_server_notification(&inner, notification).await {
rpc_client.close_transport().await;