mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Support threadless MCP connections without event channels (#34408)
## What changed - Make the MCP connection manager's event sender optional. - Skip startup notifications when a caller has no session event stream. - Decline interactive MCP elicitations in that mode while allowing the underlying operation to continue. - Update threadless resource reads, status snapshots, and connector discovery to use the channel-free path. ## Testing - Extend the app-server MCP resource test to verify that a threadless resource read declines an elicitation and still returns the resource contents. GitOrigin-RevId: 65fea152adbc02a78e09a40cae4134b6dccffd34
This commit is contained in:
1 parent
b7e39aa316
commit
19940967bd
14 files changed
+185
-124
No files matched your search
@@ -163,7 +163,7 @@ impl ElicitationRequestManager {
|
||||
pub(crate) fn make_sender(
|
||||
&self,
|
||||
server_name: String,
|
||||
tx_event: Sender<Event>,
|
||||
tx_event: Option<Sender<Event>>,
|
||||
) -> SendElicitation {
|
||||
let router = self.router.clone();
|
||||
let approval_policy = self.approval_policy.clone();
|
||||
@@ -233,6 +233,14 @@ impl ElicitationRequestManager {
|
||||
}
|
||||
}
|
||||
|
||||
let Some(tx_event) = tx_event else {
|
||||
return Ok(ElicitationResponse {
|
||||
action: ElicitationAction::Decline,
|
||||
content: None,
|
||||
meta: None,
|
||||
});
|
||||
};
|
||||
|
||||
let public_request_id = format!(
|
||||
"codex-mcp-elicitation-{}",
|
||||
NEXT_ELICITATION_REQUEST_ID.fetch_add(1, Ordering::Relaxed)
|
||||
|
||||
Reference in new issue
Block a user